//SEARCH FIELDS MAHASISWA function wGridDosProdi(opsi, kdprodi, kdstsemester){ var ds_prodireg = store_prodireg(); var ds_stsmt = store_stsmt(); var fields_lookup = RH.storeFields('nmfakultas','nourutprodi','nmprodi','lnmprodi' ,'nmjabak','nmstaktiv','nmstikj','kdjnskelamin' ,'nmdosen'//extract //TABLE DOSEN ,'kdprodi','kdstdosen','nidu','nidn' ,'nmdostpgelar','nmdosdgngelar','kdjabakademik'); //DATA STORE var pageSize = 20; var ds_lookup = RH.JsonStore({ url : BASE_URL + 'dosen_controller/lookup_add_dosprodi', fields : fields_lookup, autoLoad: true, root: 'data', params: [ {key:'kdprodi', value: kdprodi} ,{key:'kdstsemester', value: kdstsemester} ], limit: pageSize, }); //SEARCH COMPONENT var sb_lookup = RH.searchComp({ id: 'sb_lookup', fields : ['nidu:NIDU','nmdosen:Nama Dosen'], selected : 'nmdosen', store : ds_lookup, textWidth : 200 }); //COLUMN MODEL var cm_dosen = new Ext.grid.ColumnModel( [{ header: 'NIDU', width: 100, dataIndex: 'nidu', sortable: true }, { header: 'NIDN', width: 100, dataIndex: 'nidn', sortable: true }, { header: 'Nama Dosen', width: 200, dataIndex: 'nmdosen', sortable: true }, { header: '(L/P)', width: 40, dataIndex: 'kdjnskelamin', sortable: true }, { header: 'Jabatan Akademik', width: 140, dataIndex: 'nmjabak', sortable: true }, { header: 'Status Aktiv', width: 100, dataIndex: 'nmstaktiv', sortable: true }] ); // Selection Model var sm_dos = new Ext.grid.RowSelectionModel({singleSelect: true}); // Grid View var gv_dos = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); //GRID PANEL var gp_mhs = new Ext.grid.GridPanel({ id: 'gp.search-mhs', ds: ds_lookup, cm: cm_dosen, sm: sm_dos, view: gv_dos, forceFit: true,//height: 400,width: 720, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, //buttonAlign: 'left', layout: 'anchor', tbar:[sb_lookup], bbar: new Ext.PagingToolbar({ store: ds_lookup, displayInfo: true, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data", }), listeners: { rowdblclick: dblclk_mhs } }); var win_mhs = new Ext.Window({ id: 'w.search-mhs', title: 'Daftar Dosen (Program Studi)', modal: true, layout: 'fit', width:720, height:400, items: [gp_mhs] }).show(); function dblclk_mhs(grid, rowIdx) { var store = Ext.getCmp('gp.search-mhs').store; var rec = store.getAt(rowIdx); var npm = rec.data['nim']; var nama = rec.data['nmmhs']; var nmortu = rec.data['nmortu']; var alamatasal = rec.data['alamatasal']; var idpekerjaanmhs = rec.data['idpekerjaanmhs']; var kdfakultas = rec.data['kdfakultas']; var fakultas = rec.data['nmfakultas']; var prodi = rec.data['lnmprodi']; var kdprodi = rec.data['kdprodi']; var thmasuk = rec.data['thnmasuk']; var nmstawal = rec.data['nmstawal']; var nmstaktiv = rec.data['nmstaktiv']; var biaya = rec.data['biaya']; var idsetbiaya = rec.data['idsetbiaya']; var foto = rec.data['foto']; var ttl = rec.data['ttl']; //dosen// var nidu = rec.data['nidu']; var nidn = rec.data['nidn']; var nmdos = rec.data['nmdosen']; if (opsi == 'Surat') { Ext.getCmp('tf.frm.nim').setValue(npm); Ext.getCmp('tf.frm.nmmhs').setValue(nama); Ext.getCmp('tf.frm.programstudi').setValue(prodi); //Ext.getCmp('frm.npm.nim').setValue(npm); Ext.getCmp('tf.frm.jenjangstudi').setValue(Right(Ext.getCmp('tf.frm.programstudi').getValue(),5)); Ext.getCmp('w.search-mhs').close(); } else if (opsi == 'SuratPernyataan') { Ext.getCmp('tf.frm.nim').setValue(npm); Ext.getCmp('tf.frm.nmmhs').setValue(nama); Ext.getCmp('tf.frm.programstudi').setValue(prodi); Ext.getCmp('tf.frm.pekerjaanmhs').setValue(idpekerjaanmhs); Ext.getCmp('tf.frm.nmortu').setValue(nmortu); Ext.getCmp('tf.frm.alamat').setValue(alamatasal); Ext.getCmp('hkdprodi').setValue(kdprodi); Ext.getCmp('w.search-mhs').close(); } else if (opsi == 'surat_berhenti') { Ext.getCmp('tf.frm.nim').setValue(npm); Ext.getCmp('tf.frm.nmmhs').setValue(nama); Ext.getCmp('tf.frm.programstudi').setValue(prodi); Ext.getCmp('w.search-mhs').close(); } else if (opsi == 'surat_cuti') { Ext.getCmp('tf.frm.nim').setValue(npm); Ext.getCmp('tf.frm.nmmhs').setValue(nama); Ext.getCmp('tf.frm.programstudi').setValue(prodi); Ext.getCmp('w.search-mhs').close(); } else if (opsi == 'srt_ketkul') { Ext.getCmp('tf.frm.nim').setValue(npm); Ext.getCmp('tf.frm.nmmhs').setValue(nama); Ext.getCmp('tf.frm.programstudi').setValue(prodi); Ext.getCmp('tf.frm.fakultas').setValue(fakultas); Ext.getCmp('kode_prodi').setValue(kdprodi); Ext.getCmp('kode_fakultas').setValue(kdfakultas); Ext.getCmp('tf.frm.ttl').setValue(ttl); Ext.getCmp('tf.frm.alamat').setValue(alamatasal); Ext.getCmp('tf.frm.nmortu').setValue(nmortu); Ext.getCmp('w.search-mhs').close(); /////////DEDEDN/////// } else if (opsi == 'srt_observasi') { Ext.getCmp('tf.frm.nim').setValue(npm); Ext.getCmp('tf.frm.nmmhs').setValue(nama); Ext.getCmp('tf.frm.programstudi').setValue(prodi); Ext.getCmp('tf.frm.fakultas').setValue(fakultas); Ext.getCmp('kode_prodi').setValue(kdprodi); Ext.getCmp('kode_fakultas').setValue(kdfakultas); Ext.getCmp('w.search-mhs').close(); } /////////DEDEDN/////// else if (opsi == 'stdossmt') { Ext.getCmp('tf.frm.nidu').setValue(nidu); Ext.getCmp('id.nidn').setValue(nidn); Ext.getCmp('id.nmdos').setValue(nmdos); Ext.getCmp('w.search-mhs').close(); } else if (opsi == 'KHS') { var store = Ext.getCmp('gp.search-mhs').store; var rec = store.getAt(rowIdx); Ext.getCmp('frm.nim').setValue(rec.data['nim']); Ext.getCmp('frm.nama').setValue(rec.data['nmmhs']); Ext.getCmp('frm.fakultas').setValue(rec.data['nmfakultas']); Ext.getCmp('frm.prodi').setValue(rec.data['lnmprodi']); Ext.getCmp('frm.thmasuk').setValue(rec.data['thnmasuk']); Ext.getCmp('frm.staktiv').setValue(rec.data['nmstaktiv']); Ext.getCmp('frm.stawal').setValue(rec.data['nmstawal']); Ext.getCmp('w.search-mhs').close(); } else if (opsi == 'Transkrip') { var store = Ext.getCmp('gp.search-mhs').store; var rec = store.getAt(rowIdx); Ext.getCmp('frm.nim').setValue(rec.data['nim']); Ext.getCmp('frm.nama').setValue(rec.data['nmmhs']); Ext.getCmp('frm.fakultas').setValue(rec.data['nmfakultas']); Ext.getCmp('frm.prodi').setValue(rec.data['lnmprodi']); Ext.getCmp('frm.thmasuk').setValue(rec.data['thnmasuk']); Ext.getCmp('frm.staktiv').setValue(rec.data['nmstaktiv']); Ext.getCmp('frm.stawal').setValue(rec.data['nmstawal']); Ext.getCmp('w.search-mhs').close(); } else { //SETUP disableMhsContents(); resetMhsContents(); Ext.getCmp('fp.mhsFDisp').getForm().reset(); Ext.getCmp('tb.save-mhs').disable(); Ext.getCmp('tb.update-mhs').disable(); Ext.getCmp('tabpanel-mhs').setActiveTab(0); //FORM DISPLAY Ext.getCmp('file_gambar').setValue(foto); Ext.getCmp('frm.npm').setValue(npm); Ext.getCmp('frm.nama').setValue(nama); Ext.getCmp('frm.fakultas').setValue(fakultas); Ext.getCmp('frm.prodi').setValue(prodi); Ext.getCmp('frm.thmasuk').setValue(thmasuk); Ext.getCmp('frm.staktiv').setValue(nmstaktiv); Ext.getCmp('frm.stawal').setValue(nmstawal); Ext.getCmp('frm.foto').setValue(foto); //FIND MHS BY ID (AJAX REQUEST) Ext.Ajax.request({ url: BASE_URL + 'mahasiswa_controller/get_mhsById', method: 'POST', params :{ nim: npm }, scope: this, async:false, //waitMsg: "sedang diproses...", success: function(result){ var jsonData = Ext.decode(result.responseText); //bisa utk Ext3 dan Ext4 if(jsonData.status == false){ Ext.Ajax.request({ url: BASE_URL + 'user/ext_logout', method: 'POST', success: function(xhr) { localStorage.removeItem('access_token'); window.location = BASE_URL + 'user/login'; } }); } var dataArray = jsonData.data; if(dataArray == null || dataArray =='') return; var data = dataArray[0]; if(data == null || data =='') return; if(data.nim == null || data.nim == '') return; //RH.setCompValue('tf.npm-mhs', data.nim); setDataDosen(data); Ext.getCmp('w.search-mhs').close(); } }); } } }; function Right(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } function setDataDosen(data){ //PERSONAL TAB RH.setCompValue('tf.npm-mhs', data.nim); RH.setCompValue('tf.nama-mhs', data.nmmhs); RH.setCompValue('cb.gender-mhs', data.kdjnskelamin); RH.setCompValue('tf.tplahir-mhs', data.tptlahir); RH.setCompValue('df.tglahir-mhs', data.tgllahir); RH.setCompValue('cb.agama-mhs', data.kdagama); RH.setCompValue('cb.goldarah-mhs', data.idgoldarah); RH.setCompValue('cb.wn-mhs', data.kdwn); RH.setCompValue('tf.telp-mhs', data.notelpmhs); RH.setCompValue('tf.hp-mhs', data.nohpmhs); RH.setCompValue('tf.alamat_asal-mhs', data.alamatasal); RH.setCompValue('tf.kel_asal-mhs', data.kelurahanasal); RH.setCompValue('tf.kec_asal-mhs', data.kecamatanasal); RH.setCompValue('lu.kdkotkabasal', data.kdkotkabasal); RH.setCompValue('lu.nmkotkabasal', data.nmkotkabasal); RH.setCompValue('tf.kdpos_asal-mhs', data.kdposasal); RH.setCompValue('tf.alamat_surat-mhs', data.alamatsurat); RH.setCompValue('tf.kel_surat-mhs', data.kelurahansurat); RH.setCompValue('tf.kec_surat-mhs', data.kecamatansurat); RH.setCompValue('lu.kdkotkabsurat', data.kdkotkabsurat); RH.setCompValue('lu.nmkotkabsurat', data.nmkotkabsurat); RH.setCompValue('tf.kdpos_surat-mhs', data.kdpossurat); //ORTU TAB's Fields RH.setCompValue('tf.namaortu', data.nmortu); RH.setCompValue('cb.jobortu', data.idpekerjaanortu); RH.setCompValue('cb.eduortu', data.idpendidikanortu); RH.setCompValue('tf.alamatortu', data.alamatortu); RH.setCompValue('tf.kelortu', data.kelurahanortu); RH.setCompValue('tf.kecortu', data.kecamatanortu); RH.setCompValue('lu.kdkotkabortu', data.kdkotkabortu); RH.setCompValue('lu.nmkotkabortu', data.nmkotkabortu); RH.setCompValue('tf.kdposortu', data.kdposortu); RH.setCompValue('tf.tlportu', data.notelportu); //DAFTAR TAB's Fields RH.setCompValue('tf.nopmb', data.nopmb); RH.setCompValue('cb.stsmt', data.kdstsemester); RH.setCompValue('cb.prodireg', data.kdprodi); RH.setCompValue('cb.shift', data.shiftmhs); RH.setCompValue('cb.class', data.idklsmhs); RH.setCompValue('cb.thmasuk', data.thnmasuk); RH.setCompValue('df.tgmasuk', data.tglmasuk); RH.setCompValue('cb.stawal', data.kdstawalmhs); RH.setCompValue('cb.staktiv', data.kdstaktivitasmhs); RH.setCompValue('lu.kdpropinsislta', data.kdpropinsislta); RH.setCompValue('lu.nmproslta', data.nmproslta); RH.setCompValue('cb.batasstudi', data.btsstudi); //SLTA TAB's Fields RH.setCompValue('tf.nmslta', data.nmslta); RH.setCompValue('lu.kdkotkabslta', data.kdkotkabslta); RH.setCompValue('lu.nmkotkabslta', data.nmkotkabslta); RH.setCompValue('cb.jnslta', data.idjnsslta); RH.setCompValue('cb.stakrslta', data.idstakreditasislta); RH.setCompValue('cb.thlulusslta', data.thnlulusslta); RH.setCompValue('tf.nemslta', data.nemslta); RH.setCompValue('tf.rankslta', data.rangkingslta); RH.setCompValue('tf.noijzslta', data.noijazahslta); RH.setCompValue('df.tgijzslta', data.tglijazahslta); // ASAL PT/PINDAHAN RH.setCompValue('lu.kdptasal', data.kdptasal); RH.setCompValue('lu.nmptasal', data.nmptasal); RH.setCompValue('cb.jnpt-asal', data.idjnspt); RH.setCompValue('cb.stakr-asal', data.idstakreditasi); RH.setCompValue('cb.kuakr-asal', data.idkuakreditasi); RH.setCompValue('tf.jjgstudi-asal', data.kdjenjangstudiasal); RH.setCompValue('tf.fakultas-asal', data.fakultasasal); RH.setCompValue('lu.kdprodiasal', data.kdprodiasal); RH.setCompValue('lu.nmprodiasal', data.nmprodiasal); RH.setCompValue('tf.npm-asal', data.nimasal); RH.setCompValue('tf.noijzpt-asal', data.noijazahasal); RH.setCompValue('df.tgijzpt-asal', data.tglijazahasal); RH.setCompValue('nf.smtpindah-asal', data.idsemesterpindah); RH.setCompValue('nf.jumsks-asal', data.jmlsksdiakui); RH.setCompValue('ta.alasanpindah', data.alasanpindah); // PEKERJAAN MAHASISWA RH.setCompValue('cb.idjob-mhs', data.idpekerjaanmhs); RH.setCompValue('tf.tpjob-mhs', data.nmtptbekerjamhs); RH.setCompValue('tf.alamatjob-mhs', data.alamatkerkamhs); RH.setCompValue('tf.jabjob-mhs', data.jabatanmhs); // ALUMNI RH.setCompValue('cb.idjob-alumni', data.idpekerjaanalumni); RH.setCompValue('tf.tpjob-alumni', data.nmtptbekerjaalumni); RH.setCompValue('tf.alamatjob-alumni', data.alamatkerjaalumni); RH.setCompValue('tf.jabjob-alumni', data.jabatanalumni); RH.setCompValue('cb.thout-alumni', data.thnkeluar); RH.setCompValue('df.tglulus-alumni', data.tgllulus); //S3 /* RH.setCompValue('cb.biaya-s3', data.kdbiayastudi); RH.setCompValue('tf.kdpt-s3', data.kdpttptbekerja); RH.setCompValue('tf.nmpt-s3', data.nmpttptbekerja); RH.setCompValue('tf.kdprodi-s3', data.kdproditptbekerja); RH.setCompValue('tf.nmprodi-s3', data.nmproditptbekerja); RH.setCompValue('tf.nippro', data.nidupromotor); RH.setCompValue('tf.nipko1', data.nidukopromotor1); RH.setCompValue('tf.nipko2', data.nidukopromotor2); RH.setCompValue('tf.nipko3', data.nidukopromotor3); RH.setCompValue('tf.nipko4', data.nidukopromotor4); */ //LAINNYA RH.setCompValue('tf.email-mhs', data.email); RH.setCompValue('tf.fb-mhs', data.facebook); RH.setCompValue('tf.twit-mhs', data.twitter); RH.setCompValue('tf.pinbb-mhs', data.pinbb); RH.setCompValue('tf.web-mhs', data.website); /* RH.setCompValue('fform', data.field); RH.setCompValue('fform', data.field); */ }