function pNilaiMahasiswa(){ var nmcom = CLIENT; var pageTitle = 'Nilai Mahasiswa'; var pageIcon = 'silk-report'; var idcb_prodi = 'cb.prodi'; var idcb_stsemester = 'cb.stsemester'; var pnDosId = 'fp.detil-dosen'; var pnMhsId = 'fp.detil-mhs'; var pnMatkulHeight = 235; var pnDosHeight = 190; var pnMhsHeight = 425; var pnMhsTitle = 'Daftar Mahasiswa'; var IdDetObj = { dosen : pnDosId, mahasiswa : pnMhsId }; var Skdprodi; var Skdstsemester; var Skdmk; var Snidu; var Sniduasist; var Sidkelas; var Sidsemester; /** COMON STORES */ var ds_prodireg = store_prodireg(); var ds_stsmt = store_stsmt(); /** GRID PANEL MATKUL */ var gp_matkul = cMatkul(idcb_prodi, idcb_stsemester, IdDetObj); var fpMain = new Ext.Panel({ title: pageTitle, iconCls: pageIcon, buttonAlign: 'left', //bodyStyle: 'padding: 5px', border: true, layout:'border', labelWidth: 150, waitMsg: 'Waiting...', maskDisabled: false, monitorValid: true, autoScroll:true, frame: true, items: [{ layout: 'form', region:'north', height:40, //autoHeight:true, items:[ headerProdiSmt({ idcb_prodi : idcb_prodi, cb_prodi_width: 300, idcb_stsmt : idcb_stsemester, cb_stsmt_width : 150, space : 10, fnReload : function(){reloadGridMatkul();}, extracomp: comboButtonPrintNilai() }), ] },{ layout: 'form', region:'center', autoScroll:true, items: [ { xtype: 'panel', layout:'fit', title:'Mata Kuliah', id:'fp.master', height:pnMatkulHeight, frame:true, items: [gp_matkul], }, RH.vSpacer(5), { xtype: 'panel', layout:'fit', hidden:false, height:pnDosHeight, frame:true, title:'Dosen Pengajar', id: pnDosId, //items: [gp_dosen], }, RH.vSpacer(5), { xtype:'fieldset', hidden:false, items:[ { xtype:'textfield', fieldLabel: 'Mata Kuliah', id:'info.nmmatkul', width: 350, disabled:true, }, { xtype:'hidden', id:'info.kdmatkul' }, { xtype: 'hidden', id:'idsemester', } ] }] },{ layout: 'form', region:'east', width:'50%', margins:'0 0 0 10', split:true, autoScroll:true, items: [{ xtype: 'panel', layout:'fit', hidden:false, height:pnMhsHeight, frame:true, title: pnMhsTitle, id: pnMhsId, }, RH.vSpacer(5), { xtype:'fieldset', hidden:false, items:[ { xtype:'textfield', fieldLabel: 'Dosen Pengajar', id:'info.nmdos', width: 350, disabled:true, }, { xtype:'hidden', id:'info.nidu' }, { xtype:'hidden', id:'info.niduasist' }, { xtype:'hidden', id:'hidden.idklsmhs' }, { xtype:'hidden', id:'hidden.idkelas' } ] }] }] }); SET_PAGE_CONTENT(fpMain); /** FUNCTIONS */ function removeAllDetails(){ RH.removeDetail(IdDetObj.dosen); RH.removeDetail(IdDetObj.mahasiswa); } function reloadGridMatkul(){ //remove details removeAllDetails(); clearInfoMatkulDos(); //reload master-grid gp_matkul.store.reload({ params: { kdprodi: RH.getCompValue(idcb_prodi, true), kdstsemester: RH.getCompValue(idcb_stsemester, true) } }); } function clearInfoMatkulDos(){ RH.setCompValue('info.kdmatkul',''); RH.setCompValue('info.nmmatkul',''); RH.setCompValue('info.nidu',''); RH.setCompValue('info.nmdos',''); } /** MASTER: MATKUL from struprog ======================== */ function cMatkul(idcb_prodi, idcb_stsemester, IdDetObj){ var pageSize = 10; var nmmatkulWidth = 330; var fields_matkul = RH.storeFields('kdprodi', 'kdstsemester', 'kdmk', 'nmmkind', 'jmldos', 'idsemester'); //from struprog join matakuliah /** GRID STORE: MTAKULIAH */ var ds_matkul = RH.JsonStore({ url : BASE_URL + 'matkuldos_controller/get_matkulProdiSmt', fields : fields_matkul, limit: pageSize, params: [ {key:'kdprodi', id: idcb_prodi} ,{key:'kdstsemester', id: idcb_stsemester} ], enableSearch: true, }); ds_matkul.on('beforeload', function(){ removeMatkulDetails() }); //SEARCH COMPONENT var sb_matkul = RH.searchComp({ id : 'sb_matkul', fields : ['kdmk:Kode Mata Kuliah','nmmkind:Nama Mata Kuliah'], selected : 'kdmk', store : ds_matkul, textWidth : 250 }); /** GRID COLUMN MODEL */ var cm_matkul = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), //for rows numbering { header: 'Kode', width:80, dataIndex: 'kdmk', renderer: RH.keyToDetil, sortable: true }, { header: 'Nama Mata Kuliah ', width: nmmatkulWidth, dataIndex: 'nmmkind', sortable: true, }, { header: 'Jumlah Dosen', width: 80, dataIndex: 'jmldos', align:'right' }] ); // Selection Model var sm_matkul = new Ext.grid.RowSelectionModel({ singleSelect: true }); // Grid View var gv_matkul = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); /** GRID PANEL */ var gp_matkul = new Ext.grid.GridPanel({ ds: ds_matkul, cm: cm_matkul, sm: sm_matkul, view: gv_matkul, forceFit: true, //height:200, //autoHeight: (idmenu != MENU.absen), layout:'anchor', //autoSizeColumns: true, //autoExpandColumn: 'nmmkind', autoScroll:true, //enableColumnResize: true, columnLines: true, loadMask: true, tbar:[sb_matkul], bbar: new Ext.PagingToolbar({ store: ds_matkul, displayInfo: true, pageSize: pageSize, mode: 'local', displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data" }), listeners: { cellclick: onCellMatkulClick } }); return gp_matkul; function onCellMatkulClick(grid, rowIndex, columnIndex, e) { var t = e.getTarget(); var record = grid.getStore().getAt(rowIndex); // Get the Record var kdprodi = record.data['kdprodi']; var kdstsemester = record.data['kdstsemester']; var kdmk = record.data['kdmk']; var idsemester = record.data['idsemester']; removeMatkulDetails(); if (t.className == 'keyMasterDetail') { //if(idmenu == MENU.absen){ var nmmk = record.data['nmmkind']; RH.setCompValue('info.kdmatkul',kdmk); RH.setCompValue('info.nmmatkul',nmmk); RH.setCompValue('info.nidu',''); RH.setCompValue('info.nmdos',''); RH.setCompValue('idsemester',idsemester); Sidsemester = idsemester; //} var gridPanelDet = cDosenMatkul(kdprodi, kdstsemester, kdmk, IdDetObj); RH.loadDetail(IdDetObj.dosen, gridPanelDet); } } function removeMatkulDetails(){ RH.removeDetail(IdDetObj.dosen); RH.removeDetail(IdDetObj.mahasiswa); } } /** DETIL#1: DOSEN ===================================== */ function cDosenMatkul(kdprodi, kdstsemester, kdmk, IdDetObj){ //var nidu = ''; //param for detail to jadwal var fields_dosmk = RH.storeFields('kdprodi', 'kdstsemester', 'kdmk', 'nidu', 'nidudisp', 'nmdosen', 'niduasist', 'nmdosasist', 'idkelas','nmkelas','idklsmhs','nmklsmhs','jmlmhs'); //from struprogdet join dosen /** GRID STORE: DOSEN MATKUL */ var ds_dosmk = RH.JsonStore({ url : BASE_URL + 'matkuldos_controller/get_dosmk', fields : fields_dosmk, limit: 3, params: [ {key:'kdprodi', value: kdprodi} ,{key:'kdstsemester', value: kdstsemester} ,{key:'kdmk', value: kdmk} ], enableSearch: false, }); ds_dosmk.on('beforeload', function(){ removeDosenDetails() }); /** GRID COLUMN MODEL */ var cm_dosmk = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), //for rows numbering { header: 'NIDU
(Koordinator)', width:90, dataIndex: 'nidudisp', renderer: RH.keyToDetil, sortable: true }, { header: 'Nama Dosen (Koordinator)', width: 170, dataIndex: 'nmdosen', sortable: true, }, { header: 'NIDU
(Asisten)', width:90, dataIndex: 'niduasist', sortable: true }, { header: 'Nama Dosen (Asisten)', width: 170, dataIndex: 'nmdosasist', sortable: true, }, { header: 'Kelas Perkuliahan', width: 100, dataIndex: 'nmkelas', }, { header: 'Kelas Mahasiswa', width: 100, dataIndex: 'nmklsmhs', }, { header: 'Jml Mahasiswa', width: 80, dataIndex: 'jmlmhs', align:'right' }] ); // Selection Model var sm_dosmk = new Ext.grid.RowSelectionModel({ singleSelect: true }); // Grid View var gv_dosmk = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); /** GRID PANEL */ var gp_dosmk = new Ext.grid.GridPanel({ id:'gp_dosmk', ds: ds_dosmk, cm: cm_dosmk, sm: sm_dosmk, view: gv_dosmk, forceFit: true, //height: 200, //autoHeight: (idmenu != MENU.absen),//true, layout:'anchor', autoScroll:true, columnLines: true, loadMask: true, //tbar:[RH.searchBar()], bbar: new Ext.PagingToolbar({ store: ds_dosmk, displayInfo: true, mode: 'local', pageSize: 3, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data" }), listeners: { cellclick: onCellDosmkClick } }); return gp_dosmk; function onCellDosmkClick(grid, rowIndex, columnIndex, e) { var t = e.getTarget(); var record = grid.getStore().getAt(rowIndex); // Get the Record var nidu = record.data['nidu']; var niduasist = record.data['niduasist']; var idklsmhs = record.data['idklsmhs']; var idkelas = record.data['idkelas']; var jmlmhs = record.data['jmlmhs']; removeDosenDetails(); if (t.className == 'keyMasterDetail') { Sniduasist = (niduasist) ? niduasist:"-"; RH.setCompValue('info.nidu',nidu); RH.setCompValue('info.niduasist',niduasist); RH.setCompValue('info.nmdos',record.data['nmdosen']); RH.setCompValue('hidden.idkelas',idkelas); if(Ext.getCmp('hidden.idklsmhs')) RH.setCompValue('hidden.idklsmhs',idklsmhs); var gridPanelDet = cMahasiswaMatkul(kdprodi, kdstsemester, kdmk, nidu, idkelas, gp_dosmk); RH.loadDetail(IdDetObj.mahasiswa, gridPanelDet); } //function cek(){} } function removeDosenDetails(){ RH.removeDetail(IdDetObj.mahasiswa); } } /** DETIL#2a: MAHASISWA from Nilai ===================================== */ function cMahasiswaMatkul(kdprodi, kdstsemester, kdmk, nidu, idkelas, gp_dosmkx){ Skdprodi = kdprodi; Skdstsemester = kdstsemester; Skdmk = kdmk; Snidu = nidu; Sidkelas = idkelas; var pageSize = 50; var gpheight = 540; /** FOR COMBO EDITOR (KLSPARALEL & NILAI HURUF)==================================*/ var ds_klsparalel = store_klsparalel(); var fields_setnilai = RH.storeFields('kdprodi','kdstsemester','nilaihuruf','bobotnilai'); var ds_setnilai = RH.JsonStore({ url : BASE_URL + 'nilai_controller/get_bonilaiByProdiSmt', fields : fields_setnilai, params: [ {key:'kdprodi', value: kdprodi} ,{key:'kdstsemester', value: kdstsemester} ], enableSearch: false, }); var fnSelectKlsparalel = function(combo, record){ var klsparalel = record.data['klsparalel']; updateKlsparalel(klsparalel); }; function render_klsparalel(value) { return RH.qtipEdit(value,'12px'); } var fnSelectNilai = function(combo, record){ var nilaihuruf = record.data['nilaihuruf']; var bobotnilai = record.data['bobotnilai']; /* if (bobotnilai == '4.00') { Ext.getCmp('nilaihurufsp').enable(); //return '' + value + ''; } else if (bobotnilai == '3.00') { Ext.getCmp('nilaihurufsp').disable(); //return '' + value + ''; } */ //Update nilai updateNilai(nilaihuruf, bobotnilai); }; var fnSelectNilaiSP = function(combo, record){ var nilaihuruf = Ext.getCmp('nilaihurufsp').getRawValue(); if (nilaihuruf == 'A') { //Ext.getCmp('nilaihurufsp').enable(); //return '' + value + ''; } else if (nilaihuruf == '3.00') { Ext.getCmp('nilaihurufsp').disable(); //return '' + value + ''; } var nilaihurufsp = record.data['nilaihuruf']; var bobotnilaisp = record.data['bobotnilai']; //Update nilai updateNilaiSP(nilaihurufsp, bobotnilaisp); }; function render_nilaihuruf(value) { var val = RH.getRecordFieldValue(ds_setnilai, 'nilaihuruf', 'nilaihuruf', value); //return RH.qtipEditDenGreen(val,'12px'); if (value == 'A' || value == 'B') { return '' + value + ''; } else if (value == 'C') { return '' + value + ''; } else if (value == 'D' || value == 'E' || value == 'T') { return '' + value + ''; } return value; } function render_nilaihurufsp(value) { var val = RH.getRecordFieldValue(ds_setnilai, 'nilaihuruf', 'nilaihuruf', value); //return RH.qtipEditDenRed(val,'12px'); if (value == 'A' || value == 'B') { return '' + value + ''; } else if (value == 'C') { return '' + value + ''; } else if (value == 'D' || value == 'E' || value == 'T') { return '' + value + ''; } return value; } /** =============THE GRID PROPERTIES ================================= */ var fields_mhsmk = RH.storeFields('idnilai','kdprodi', 'kdstsemester', 'kdmk', 'nidu', 'nim', 'nmmhs', 'kdjnskelamin','thnmasuk', 'kdstawalmhs','nmstawalmhs', 'idklsmhs','nmklsmhs', 'nilaihuruf','bobotnilai','nilaihurufsp','bobotnilaisp','klsparalel'); var ds_mhsmk = RH.JsonStore({ url : BASE_URL + 'nilai_controller/get_nilaimahasiswa', fields : fields_mhsmk, limit: pageSize, params: [ {key:'kdprodi', value: kdprodi} ,{key:'kdstsemester', value: kdstsemester} ,{key:'kdmk', value: kdmk} ,{key:'nidu', value: nidu} ,{key:'idkelas', value: idkelas} ], enableSearch: false, }); var sb_mhsmk = RH.searchComp({ id: 'sb_mhsmk', fields : ['nim:NIM','nmmhs:Nama Mahasiswa', 'klsparalel:Kelas Paralel'], selected : 'nmmhs', store : ds_mhsmk, textWidth : 200 }); var cm_mhsmk = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), { header:'idnilai', dataIndex:'idnilai', hidden:true }, { header: 'NPM', width:100, dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 150, dataIndex: 'nmmhs',sortable: true, }, { header: '(L/P)', width: 35, dataIndex: 'kdjnskelamin', align:'center' }, { header: 'Nilai
Huruf', width:70, align:'center', dataIndex: 'nilaihuruf', renderer: render_nilaihuruf, editor: RH.getComboEditor('nilaihuruf', false, ds_setnilai, 'nilaihuruf', 'nilaihuruf', fnSelectNilai) }, { header: 'Bobot Nilai', width:80, align:'center', dataIndex: 'bobotnilai', xtype:'numbercolumn' /* editor: new Ext.form.TextField({ allowBlank: true, id: 'idbotnilai', //readOnly: true, validator:function(value){ var set = Ext.getCmp('idbotnilai').getValue(); //var val = record.get('statut'); if (set == "4.00") { Ext.getCmp('idbotnilai').enable(); } else if (set == "3.00") { Ext.getCmp('idbotnilai').disable(); } } }), */ }, { header: 'Nilai
Huruf SP', width:75, align:'center', dataIndex: 'nilaihurufsp', renderer: render_nilaihurufsp, editor: RH.getComboEditor('nilaihurufsp', false, ds_setnilai, 'nilaihuruf', 'nilaihuruf', fnSelectNilaiSP) }, { header: 'Bobot Nilai SP', width:80, align:'center', dataIndex: 'bobotnilaisp', xtype:'numbercolumn' }] ); function aa (value) { //var idx = combo.store.find(combo.valueField, value); //var rec = combo.store.getAt(idx); var a = Ext.getCmp('idnil').getRawValue(); if (a == "1.00") { new Ext.form.TextField({ allowBlank: true, readOnly: false, }); } else { new Ext.form.TextField({ allowBlank: true, readOnly: true, }); } } /** GRID PANEL */ var gp_mhsmk = RH.EditorGridPanel_T1({ ds: ds_mhsmk, cm: cm_mhsmk, singleSelect: true, clicksToEdit: 1, searchComp: [sb_mhsmk,{ xtype:'button', text: 'Tambah Mahasiswa', id:'btntmbhmhs', iconCls: 'silk-add', margins:'0 0 0 10', hidden:(L_MEMBER == '1' || L_MEMBER == '2') ? false:true, handler:function(){ if(RH.getCompValue('info.kdmatkul')==''){ RH.warning('Mata Kuliah Belum Dipilih!'); return; } if(RH.getCompValue('info.nidu')==''){ RH.warning('Dosen Mata Kuliah Belum Dipilih!'); return; } wGridMhsAddNilai(kdprodi, kdstsemester, kdmk, nidu, idkelas, gp_dosmkx, gp_mhsmk); } }], allowAdd: false, pageSize: pageSize, cellclick: onCellClick, customButton: { xtype:'textfield', id:'hidden.idnilai', hidden:true }, }); return gp_mhsmk; /* function onCellClick(grid, rowIndex, columnIndex, e) { var record = grid.getStore().getAt(rowIndex); // Get the Record var idnilai = record.data['idnilai']; RH.setCompValue('hidden.idnilai', idnilai); } */ function onCellClick(grid, rowIndex, cellIndex, e) { var rec = ds_mhsmk.getAt(rowIndex); var record = grid.getStore().getAt(rowIndex); // Get the Record var idnilai = record.data['idnilai']; var columnName = gp_mhsmk.getColumnModel().getDataIndex(cellIndex); //idnilai = rec.data['idnilai']; var nilai= rec.data['bobotnilai']; var nilaisp= rec.data['bobotnilaisp']; if (columnName == 'nilaihurufsp') { if (nilai > 2.00 ) { Ext.MessageBox.alert("Informasi", "Nilai Sudah Diatas Minimal"); Ext.getCmp('nilaihurufsp').disable(); return; }else{ Ext.getCmp('nilaihurufsp').enable(); } } RH.setCompValue('hidden.idnilai', idnilai); } function updateKlsparalel(klsparalel){ Ext.Ajax.request({ url: BASE_URL + 'nilai_controller/update_klsparalel', params: { idnilai : RH.getCompValue('hidden.idnilai'), klsparalel : klsparalel, }, success: function() { ds_mhsmk.reload(); if(Ext.getCmp('gp_jdwkul')){ var grid = Ext.getCmp('gp_jdwkul'); grid.store.reload(); } }, failure: function() { Ext.Msg.alert("Info", "Ubah Data Gagal"); } }); } function updateNilai(nilaihuruf, bobotnilai){ Ext.Ajax.request({ url: BASE_URL + 'nilai_controller/update_nilai', params: { idnilai : RH.getCompValue('hidden.idnilai'), nilaihuruf : nilaihuruf, bobotnilai : bobotnilai, nmcom : RH.getCompValue('nmcom'), //nilaihurufsp: nilaihurufsp, //bobotnilaisp: bobotnilaisp }, success: function() { Ext.Msg.alert("Info", "Ubah Data Berhasil"); //ds_mhsmk.reload(); }, failure: function() { Ext.Msg.alert("Info", "Ubah Data Gagal"); } }); } function updateNilaiSP(nilaihurufsp, bobotnilaisp){ Ext.Ajax.request({ url: BASE_URL + 'nilai_controller/update_nilaisp', params: { idnilai : RH.getCompValue('hidden.idnilai'), nilaihurufsp : nilaihurufsp, bobotnilaisp : bobotnilaisp, nmcom : RH.getCompValue('nmcom'), }, success: function() { Ext.Msg.alert("Info", "Ubah Data Berhasil"); //ds_mhsmk.reload(); }, failure: function() { Ext.Msg.alert("Info", "Ubah Data Gagal"); } }); } } function comboButtonPrintNilai(){ var ds_jujian = store_jujian(); var comp = [{ layout:'form', labelWidth:150, labelAlign:'right', items:[ RH.ActionCombo({ id: 'cb.selUjian', label: 'Cetak Form Nilai', width: 80, data: ds_jujian, key: 'idjnsujian', display: 'kdjnsujian', fnSelect: function(){} }) ] },{ xtype:'button', iconCls:'silk-printer', text:'Cetak Blanko', margins:'0 0 0 10', handler: function(){ printBlankoNilai(); } },{ xtype:'button', iconCls:'silk-printer', text:'Cetak Blanko Tanpa Absen', margins:'0 0 0 10', handler: function(){ printBlankoNilaiTanpaAbsen(); } },{ xtype:'button', iconCls:'silk-printer', text:'Cetak Ujian Susulan', margins:'0 0 0 10', handler: function(){ addmhsSusulan(Skdprodi, Skdstsemester, Skdmk, Snidu, Sniduasist, Sidkelas, Ext.getCmp('cb.selUjian')); } },{ xtype: 'textfield', fieldLabel: 'Nama Komputer', hidden:true, readOnly:true, id: 'nmcom', name: 'nmcom', value:nmcom }] return comp; } function printBlankoNilai(){ if(RH.getCompValue('info.kdmatkul')==''){ RH.warning('Mata Kuliah Belum Dipilih!'); return; } if(RH.getCompValue('info.nidu')==''){ RH.warning('Dosen Mata Kuliah Belum Dipilih!'); return; } if(RH.getCompValue('cb.selUjian')==''){ RH.warning('Pilih Jenis Ujian!'); return; } var kdprodi = RH.getCompValue('cb.prodi'); var kdstsemester= RH.getCompValue('cb.stsemester'); var kdmk = RH.getCompValue('info.kdmatkul'); var nidu = RH.getCompValue('info.nidu'); var niduasist = (RH.getCompValue('info.niduasist')) ? RH.getCompValue('info.niduasist'):"-"; var idklsmhs = RH.getCompValue('hidden.idklsmhs'); var idkelas = RH.getCompValue('hidden.idkelas'); var idsemester = RH.getCompValue('idsemester'); var idjnsujian = RH.getCompValue('cb.selUjian'); if(RH.getCompValue('cb.selUjian')=='1'){ RH.ShowReport(BASE_URL + 'rpt/rpt_peserta_uts/get_peserta_uts/' +kdprodi+'/'+kdstsemester+'/'+idkelas+'/'+idjnsujian+'/'+kdmk+'/'+nidu+'/'+idsemester+'/'+niduasist+'/'+0); } if(RH.getCompValue('cb.selUjian')=='2'){ RH.ShowReport(BASE_URL + 'rpt/rpt_pesertauas/get_peserta_uas/' +kdprodi+'/'+kdstsemester+'/'+idkelas+'/'+idjnsujian+'/'+kdmk+'/'+nidu+'/'+idsemester+'/'+niduasist+'/'+0); } } function printBlankoNilaiTanpaAbsen(){ /*RH.warning('sedang di buat'); return;*/ if(RH.getCompValue('info.kdmatkul')==''){ RH.warning('Mata Kuliah Belum Dipilih!'); return; } if(RH.getCompValue('info.nidu')==''){ RH.warning('Dosen Mata Kuliah Belum Dipilih!'); return; } if(RH.getCompValue('cb.selUjian')==''){ RH.warning('Pilih Jenis Ujian!'); return; } var kdprodi = RH.getCompValue('cb.prodi'); var kdstsemester= RH.getCompValue('cb.stsemester'); var kdmk = RH.getCompValue('info.kdmatkul'); var nidu = RH.getCompValue('info.nidu'); var niduasist = (RH.getCompValue('info.niduasist')) ? RH.getCompValue('info.niduasist'):"-"; var idklsmhs = RH.getCompValue('hidden.idklsmhs'); var idkelas = RH.getCompValue('hidden.idkelas'); var idsemester = RH.getCompValue('idsemester'); var idjnsujian = RH.getCompValue('cb.selUjian'); if(RH.getCompValue('cb.selUjian')=='1'){ RH.ShowReport(BASE_URL + 'rpt/rpt_peserta_uts/get_peserta_uts/' +kdprodi+'/'+kdstsemester+'/'+idkelas+'/'+idjnsujian+'/'+kdmk+'/'+nidu+'/'+idsemester+'/'+niduasist+'/'+0); } if(RH.getCompValue('cb.selUjian')=='2'){ RH.ShowReport(BASE_URL + 'rpt/rpt_pesertauas/get_peserta_uas_tanpa_absen/' +kdprodi+'/'+kdstsemester+'/'+idkelas+'/'+idjnsujian+'/'+kdmk+'/'+nidu+'/'+idsemester+'/'+niduasist+'/'+0); } } function wGridMhsAddNilai(kdprodi, kdstsemester, kdmk, nidu, idkelas, gdosen, gmhs){ //,kdstsemester var fields_lookup_prodi = RH.storeFields('nim','nmmhs','kdjnskelamin','thnmasuk','stdaftar','staktif'); //DATA STORE var pageSize = 20; var ds_lookup_prodi = RH.JsonStore({ url : BASE_URL + 'nilai_controller/get_mahasiswa_addnilai', fields : fields_lookup_prodi, autoLoad: true, root: 'data', params: [ {key:'kdprodi', value: kdprodi} ,{key:'kdstsemester', value: kdstsemester} ,{key:'kdmk', value: kdmk} ,{key:'nidu', value: nidu} ,{key:'idkelas', value: idkelas} ], limit: pageSize, }); //SEARCH COMPONENT var sb_lookup = RH.searchComp({ id: 'sb_lookup', fields : ['nim:NPM','nmmhs:Nama Mahasiswa','thnmasuk:Tahun Masuk'], selected : 'nmmhs', store : ds_lookup_prodi, textWidth : 200 }); // Selection Model var sm_mhs_prodi = new Ext.grid.CheckboxSelectionModel(); //COLUMN MODEL var cm_mahasiswa_prodi = new Ext.grid.ColumnModel( [sm_mhs_prodi,new Ext.grid.RowNumberer(), { header: 'NPM', width: 100, dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 200, dataIndex: 'nmmhs', sortable: true }, { header: '(L/P)', width: 50, dataIndex: 'kdjnskelamin', sortable: true }, { header: 'Tahun Masuk', width: 100, dataIndex: 'thnmasuk', sortable: true }, { header: 'Status Daftar', width: 100, dataIndex: 'stdaftar', sortable: true }, { header: 'Status Aktifitas', width: 100, dataIndex: 'staktif', sortable: true }] ); // Grid View var gv_mhs_prodi = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); //GRID PANEL var gp_mhs_prodi = new Ext.grid.GridPanel({ id: 'gp.search-mhs', ds: ds_lookup_prodi, cm: cm_mahasiswa_prodi, sm: sm_mhs_prodi, view: gv_mhs_prodi, 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,{ text: 'Tambah', iconCls: 'silk-add', handler: function(){ var select = gp_mhs_prodi.getSelectionModel().getSelections(); if(select.length > 0){ Ext.MessageBox.confirm('Message', 'Anda Yakin Menambah Data?', add); }else{ Ext.MessageBox.alert('Message', 'Data Belum Di Pilih!'); } } }], bbar: new Ext.PagingToolbar({ store: ds_lookup_prodi, displayInfo: true, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data", }), listeners: { rowdblclick: function(grid, rowIdx) { } } }); var win_mhs_prodi = new Ext.Window({ id: 'w.search-mhs', title: 'Daftar Mahasiswa', modal: true, layout: 'fit', width:720, height:400, items: [gp_mhs_prodi] }).show(); function add(btn, grid, rowIdx){ if(btn == 'yes'){ var m = gp_mhs_prodi.getSelectionModel().getSelections(); var par =''; var split ='x'; var rec =''; var endpar = ';'; for(var i=0; i< m.length; i++){ if (i == m.length-1) { endpar = ''; } rec = m[i]; par += rec.data['nim'] + split + kdprodi + split + kdstsemester + split + kdmk + split + nidu + split + idkelas + split + endpar; } Ext.Ajax.request({ url: BASE_URL +'nilai_controller/insert_nilai_bypass', method: 'POST', params: { par : par }, waitMsg: 'Tunggu, sedang proses menyimpan...', success: function() { Ext.Msg.alert("Info", "Simpan Data Berhasil"); gdosen.getStore().reload(); win_mhs_prodi.close(); }, failure: function(result){ Ext.Msg.alert("Info", "Simpan Data Gagal"); gmhs.getStore().reload(); gp_mhs_prodi.getStore().reload(); } }); } } } //DAFTAR PILIHAN MHS SUSULAN function addmhsSusulan(kdprodi, kdstsemester, kdmk, nidu, niduasist, idkelas, jujian){ //,kdstsemester if(RH.getCompValue('info.kdmatkul')==''){ RH.warning('Mata Kuliah Belum Dipilih!'); return; } if(RH.getCompValue('info.nidu')==''){ RH.warning('Dosen Mata Kuliah Belum Dipilih!'); return; } if(RH.getCompValue('cb.selUjian')==''){ RH.warning('Pilih Jenis Ujian!'); return; } var fields_mhsmk_susulan = RH.storeFields('idnilai','kdprodi', 'kdstsemester', 'kdmk', 'nidu', 'nim', 'nmmhs', 'kdjnskelamin','thnmasuk', 'kdstawalmhs','nmstawalmhs', 'idklsmhs','nmklsmhs', 'nilaihuruf','bobotnilai','nilaihurufsp','bobotnilaisp','klsparalel'); var ds_mhsmk_susulan = RH.JsonStore({ url : BASE_URL + 'nilai_controller/get_nilaimahasiswa_susulan', fields : fields_mhsmk_susulan, params: [ {key:'kdprodi', value: kdprodi} ,{key:'kdstsemester', value: kdstsemester} ,{key:'kdmk', value: kdmk} ,{key:'nidu', value: nidu} ,{key:'idkelas', value: idkelas} ], enableSearch: false, }); //SEARCH COMPONENT var sb_mhsmk_susulan = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; // Selection Model var sm_mhsmk_susulan = new Ext.grid.CheckboxSelectionModel(); //COLUMN MODEL var cm_mhsmk_susulan = new Ext.grid.ColumnModel( [sm_mhsmk_susulan,new Ext.grid.RowNumberer(), { header: 'NPM', width: 120, dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 300, dataIndex: 'nmmhs', sortable: true }, { header: '(L/P)', width: 50, dataIndex: 'kdjnskelamin', sortable: true }] ); // Grid View var gv_mhsmk_susulan = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); //GRID PANEL var gp_mhsmk_susulan = new Ext.grid.GridPanel({ id: 'gp_mhsmk_susulan', ds: ds_mhsmk_susulan, cm: cm_mhsmk_susulan, sm: sm_mhsmk_susulan, view: gv_mhsmk_susulan, forceFit: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, plugins: sb_mhsmk_susulan, layout: 'anchor', tbar:[{ text: 'Tambah', iconCls: 'silk-add', handler: function(){ var select = gp_mhsmk_susulan.getSelectionModel().getSelections(); if(select.length > 0){ Ext.MessageBox.confirm('Message', 'Anda Yakin Menambah Data?', add_mhsmk_susulan); }else{ Ext.MessageBox.alert('Message', 'Data Belum Di Pilih!'); } } },{ text: 'Lanjut Cetak', id: 'btcetaksusulan', disabled: true, iconCls: 'silk-printer', handler: function(){ if(jujian.getValue()=='1'){ RH.ShowReport(BASE_URL + 'rpt/rpt_peserta_uts/get_peserta_uts/' +kdprodi+'/'+kdstsemester+'/'+idkelas+'/'+jujian.getValue()+'/'+kdmk+'/'+nidu+'/'+Sidsemester+'/'+Sniduasist+'/'+1); } if(jujian.getValue()=='2'){ RH.ShowReport(BASE_URL + 'rpt/rpt_pesertauas/get_peserta_uas/' +kdprodi+'/'+kdstsemester+'/'+idkelas+'/'+jujian.getValue()+'/'+kdmk+'/'+nidu+'/'+Sidsemester+'/'+Sniduasist+'/'+1); } } },'->'], listeners: { rowdblclick: function(grid, rowIdx) { } } }); var win_mhsmk_susulan = new Ext.Window({ id: 'w.search-mhs', title: 'Pilih Daftar Mahasiswa Ujian ' + jujian.getRawValue() + ' Susulan', modal: true, layout: 'fit', width:570, height:400, items: [gp_mhsmk_susulan] }).show(); function add_mhsmk_susulan(btn, grid, rowIdx){ if(btn == 'yes'){ Ext.getCmp('btcetaksusulan').disable(); var waitmsg = Ext.MessageBox.wait('Menambah Data...', 'Info'); var m = gp_mhsmk_susulan.getSelectionModel().getSelections(); var par =''; var split ='x'; var rec =''; var endpar = ';'; for(var i=0; i< m.length; i++){ if (i == m.length-1) { endpar = ''; } rec = m[i]; par += rec.data['nim'] + split + jujian.getValue() + split + endpar; } Ext.Ajax.request({ url: BASE_URL +'nilai_controller/delete_insert_ujian_susulan', method: 'POST', params: { par : par, idjnsujianx :jujian.getValue() }, success: function() { waitmsg.hide(); Ext.Msg.alert("Info", "Simpan Data Berhasil"); Ext.getCmp('btcetaksusulan').enable(); }, failure: function(result){ waitmsg.hide(); Ext.Msg.alert("Info", "Simpan Data Gagal"); } }); } } } }