SabRang Studioz — Staff Portal
Sab Rang Studioz
سب رنگ سٹوڈیوز · All Colors · Staff Portal
Sign In
Register
SabRang Studioz · MapTheSkills (Pvt.) Ltd.
✅ Submitted! Admin will activate your account.
🏭
Sab Rang Studioz
U
User
Role
Dashboard
');w.document.close();} function pdfHead(t,s){return '
SabRang Studioz
سب رنگ سٹوڈیوز — All Colors
MapTheSkills (Pvt.) Ltd. · SECP CUIN: 0327776 · maptheskills.org/sabrangstudioz
'+t+'
'+s+'
';} function pdfFoot(){return '
SabRang Studioz · maptheskills.org/sabrangstudioz · maptheskills@gmail.com · +92-317-5853399
MapTheSkills (Pvt.) Ltd. · SECP CUIN 0327776 · P-114 Paradise Floor, Siddique Trade Center, Gulberg III, Lahore
';} function detFields(fields){return fields.filter(f=>f[1]).map(f=>'
'+f[0]+'
'+f[1]+'
').join('');}function pdfStudent(s){openPdf(pdfHead('Student Profile','Generated: '+new Date().toLocaleDateString('en-PK'))+'
'+s['Full Name']+'
ID: '+s['ID']+'
'+detFields([["Father's Name",s['Father Name']],['Email',s['Email']],['Phone',s['Phone']],['DOB',s['DOB']],['Gender',s['Gender']],['CNIC',s['CNIC']],['City',s['City']],['Course',s['Course']],['Monthly Fee','Rs '+(s['Monthly Fee']||'—')],['Teacher',s['Teacher Name']],['Institution',s['Institution Name']],['Admitted',s['Enrollment Date']],['Status',s['Status']],['Added By',s['Added By Name']]])+pdfFoot(),'Student: '+s['Full Name']);} function pdfTeacher(t){openPdf(pdfHead('Trainer Profile','Generated: '+new Date().toLocaleDateString('en-PK'))+'
'+t['Full Name']+'
ID: '+t['ID']+'
'+detFields([['Email',t['Email']],['Phone',t['Phone']],['Gender',t['Gender']],['CNIC',t['CNIC']],['Qualification',t['Qualification']],['Specialization',t['Specialization']],['Institution',t['Institution Name']],['Join Date',t['Join Date']],['Status',t['Status']],['Added By',t['Added By Name']]])+pdfFoot(),'Trainer: '+t['Full Name']);} function pdfInst(i){openPdf(pdfHead('Institution Profile','Generated: '+new Date().toLocaleDateString('en-PK'))+'
'+i['Institution Name']+'
ID: '+i['ID']+'
'+detFields([['Contact',i['Contact Person']],['Email',i['Email']],['Phone',i['Phone']],['City',i['City']],['Address',i['Address']],['NTN',i['NTN Number']],['Join Date',i['Join Date']],['Capacity',i['Total Capacity']],['Bank',i['Bank Name']],['Account No',i['Account Number']],['Account Title',i['Account Title']],['Status',i['Status']],['Added By',i['Added By Name']]])+pdfFoot(),'Institution: '+i['Institution Name']);} function pdfFee(x){var total=Number(x['Total Fee']||0);openPdf(pdfHead('Fee Receipt','Receipt: '+x['Receipt No']+' · '+new Date().toLocaleDateString('en-PK'))+detFields([['Student',x['Student Name']],['Student ID',x['Student ID']],['Course',x['Course']],['Month / Year',x['Month']+' '+x['Year']],['Payment Date',x['Payment Date']],['Method',x['Payment Method']],['Total Fee','Rs '+total.toLocaleString()],['Status',x['Payment Status']]])+pdfFoot(),'Fee Receipt '+x['Receipt No']);}function expStudsPDF(){var rows=window._SD||[];if(!rows.length){toast('❌ Load Students panel first',true);return;}openPdf(pdfHead('Students Register','Total: '+rows.length+' · '+new Date().toLocaleDateString('en-PK'))+''+rows.map(s=>'').join('')+'
IDStudent NameFatherCourseTeacherInstitutionFee/moAdmittedStatus
'+s['ID']+''+s['Full Name']+''+s['Father Name']+''+s['Course']+''+s['Teacher Name']+''+s['Institution Name']+'Rs '+s['Monthly Fee']+''+s['Enrollment Date']+''+s['Status']+'
Assessment: Practical 60% + Written 30% + Attendance 10% · Grades: A(85-100%) B(70-84%) C(50-69%) F(<50%)
'+pdfFoot(),'Students Register');} function expTeachersPDF(){var rows=window._TD||[];if(!rows.length){toast('❌ Load Teachers panel first',true);return;}openPdf(pdfHead('Trainers Register','Total: '+rows.length+' · '+new Date().toLocaleDateString('en-PK'))+''+rows.map(t=>'').join('')+'
IDNameSpecializationInstitutionPhoneQualificationJoin DateStatus
'+t['ID']+''+t['Full Name']+''+t['Specialization']+''+t['Institution Name']+''+t['Phone']+''+t['Qualification']+''+t['Join Date']+''+t['Status']+'
'+pdfFoot(),'Trainers Register');} function expInstsPDF(){var rows=window._ID||[];if(!rows.length){toast('❌ Load Institutions panel first',true);return;}openPdf(pdfHead('Institutions Register','Total: '+rows.length+' · '+new Date().toLocaleDateString('en-PK'))+''+rows.map(i=>'').join('')+'
IDInstitutionContactCityPhoneJoin DateCapacityStatus
'+i['ID']+''+i['Institution Name']+''+i['Contact Person']+''+i['City']+''+i['Phone']+''+i['Join Date']+''+i['Total Capacity']+''+i['Status']+'
'+pdfFoot(),'Institutions Register');} function expCoursesPDF(){var rows=window._CD||[];if(!rows.length){toast('❌ Load Courses panel first',true);return;}openPdf(pdfHead('Course Catalog','Total: '+rows.length+' · '+new Date().toLocaleDateString('en-PK'))+''+rows.map(c=>'').join('')+'
IDCourse NameCategoryDurationFeeDescription
'+c['ID']+''+c['Course Name']+''+c['Category']+''+c['Duration']+'Rs '+Number(c['Fee']||0).toLocaleString()+''+c['Description']+'
'+pdfFoot(),'Course Catalog');} function expFeesPDF(){api('getFees',Object.assign({role:CU.role,userId:CU.id,institutionId:CU.institutionId,institutionName:CU.institutionName},me())).then(r=>{var recs=(r&&r.records)||[],tot=(r&&r.totals)||{};if(!recs.length){toast('❌ No fee records',true);return;}openPdf(pdfHead('Fee & Revenue Report','Total records: '+recs.length+' · '+new Date().toLocaleDateString('en-PK'))+''+recs.map(x=>'').join('')+'
ReceiptMonthStudentCourseTotalTrainer 50%Inst 35%MTS 15%Status
'+x['Receipt No']+''+x['Month']+' '+x['Year']+''+x['Student Name']+''+x['Course']+'Rs '+Number(x['Total Fee']||0).toLocaleString()+'Rs '+Number(x['Trainer Share (50%)']||0).toLocaleString()+'Rs '+Number(x['Institution Share (35%)']||0).toLocaleString()+'Rs '+Number(x['MTS Share (15%)']||0).toLocaleString()+''+x['Payment Status']+'
TOTALRs '+Math.round(tot.total||0).toLocaleString()+'Rs '+Math.round(tot.trainer||0).toLocaleString()+'Rs '+Math.round(tot.institution||0).toLocaleString()+'Rs '+Math.round(tot.mts||0).toLocaleString()+'
'+pdfFoot(),'Fee Report');});}// ═══════════════════════════════════════════════════ // DETAIL MODAL // ═══════════════════════════════════════════════════ function detModal(title,subtitle,rows){ var m=document.createElement('div');m.className='ov'; m.innerHTML=''; document.body.appendChild(m);m.addEventListener('click',e=>{if(e.target===m)m.remove();}); }// ═══════════════════════════════════════════════════ // TOPBAR ACTIONS // ═══════════════════════════════════════════════════ function topAdd(){var m={institutions:'iform',teachers:'tform',students:'sform',courses:'cform'};if(PNL==='accounts'){document.getElementById('ac-nm')&&document.getElementById('ac-nm').focus();return;}var fid=m[PNL];if(fid)tog(fid);} function topExport(){var fn={students:expStudsPDF,teachers:expTeachersPDF,institutions:expInstsPDF,courses:expCoursesPDF,fees:expFeesPDF,earnings:expFeesPDF};var f=fn[PNL];if(f)f();else toast('📄 Navigate to a data panel to export PDF.');}// ═══════════════════════════════════════════════════ // FILTER & UTILS // ═══════════════════════════════════════════════════ function filt(inp,tbodyId){var q=inp.value.toLowerCase();document.querySelectorAll('#'+tbodyId+' tr').forEach(r=>r.style.display=r.textContent.toLowerCase().includes(q)?'':'none');} function toast(msg,isErr){var t=document.getElementById('toast');t.textContent=msg;t.className='on'+(isErr?' err':'');clearTimeout(toast._t);toast._t=setTimeout(()=>{t.className='';},3500);} document.addEventListener('keydown',e=>{if(e.key==='Enter'&&document.getElementById('auth').style.display!=='none')doLogin();});