function absennilaimhsbydosen() { var ds_stsmt = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'c_mastah/grid_thnakademik2', method: 'POST', success: function(response) { var x = Ext.decode(response.responseText); if(x.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'; } }); } } }), totalProperty: 'results', root: 'data', autoLoad: false, fields: [{ name: 'kdstsemester', mapping: 'kdstsemester' },{ name: 'kdthnakademik', mapping: 'kdthnakademik' },{ name: 'nmthnakademik', mapping: 'nmthnakademik' }] }); //===========================DAFTAR MATAKULIAH======================================== var fields_matkuldos = RH.storeFields('kdstsemester', 'nidu', 'kdmk', 'nmmkind', 'jmlsks', 'kdprodi', 'nmprodi','idkelas','nmkelas'); var ds_matkuldos = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'e_akademic/c_matkulabsennilaimhsdos/get_matkuldos', method: 'POST', success: function(response) { var x = Ext.decode(response.responseText); if(x.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'; } }); } } }), baseParams: { }, root: 'data', totalProperty: 'results', autoLoad: false, fields: fields_matkuldos }); var sm_matkuldos = new Ext.grid.RowSelectionModel({ singleSelect: true, listeners: {} }); var cari_matkuldos = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var grid_matkuldos = new Ext.grid.GridPanel({ title: 'Daftar Matakuliah', store: ds_matkuldos, frame: true, height:200, autoWidth: true, bodyStyle: 'padding:3px 3px 3px 3px', plugins: cari_matkuldos, id: 'grid_matkuldos', forceFit: true, tbar: ['->'], sm: sm_matkuldos, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, columns: [new Ext.grid.RowNumberer(), { header: 'Kode', width: 80, align: 'center', dataIndex: 'kdmk', sortable: true, renderer: function(value) { Ext.QuickTips.init(); return '
' + value +'
'; } },{ header: 'Nama Matakuliah', width: 300, align: 'left', dataIndex: 'nmmkind', sortable: true },{ header: 'SKS', width: 50, align: 'center', dataIndex: 'jmlsks', sortable: true },{ header: 'Program Studi', width: 300, align: 'left', dataIndex: 'nmprodi', sortable: true },{ header: 'Kelas', width: 150, align: 'left', dataIndex: 'nmkelas', sortable: true }], listeners: { cellclick: onCellmatkuldosClick } }); function onCellmatkuldosClick(grid, rowIndex, columnIndex, e) { var t = e.getTarget(); var record = grid.getStore().getAt(rowIndex); var kdprodi = record.data['kdprodi']; var kdstsemester = record.data['kdstsemester']; var kdmk = record.data['kdmk']; var idkelas = record.data['idkelas']; if (t.className == 'klik_kdmk') { Ext.getCmp('cb.temuke').enable(); Ext.getCmp('cb.temuke').setValue(''); Ext.getCmp('cbx.stbsenmhs').enable(); Ext.getCmp('cbx.stbsenmhs').setValue(false); Ext.getCmp('cb.stabsenmhs').enable(); Ext.getCmp('cb.stabsenmhs').setValue(''); Ext.getCmp('bt.saveabsenmhs').enable(); ds_absenmhs.setBaseParam('kdprodi', kdprodi); ds_absenmhs.setBaseParam('kdstsemester', kdstsemester); ds_absenmhs.setBaseParam('kdmk', kdmk); ds_absenmhs.setBaseParam('idkelas', idkelas); ds_absenmhs.load(); ds_nilaimhs.setBaseParam('kdprodi', kdprodi); ds_nilaimhs.setBaseParam('kdstsemester', kdstsemester); ds_nilaimhs.setBaseParam('kdmk', kdmk); ds_nilaimhs.setBaseParam('idkelas', idkelas); ds_nilaimhs.load(); ds_setnilai.setBaseParam('kdprodi', kdprodi); ds_setnilai.setBaseParam('kdstsemester', kdstsemester); ds_setnilai.load(); } } //=================================================================== //===========================DAFTAR ABSEN MAHASISWA======================================== var Skdprodi; var Skdstsemester; var Skdmk; var Snidu; var Snim; var Sidkelas; var SdataIndex; var ds_stabsenmhs = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'e_akademic/c_matkulabsennilaimhsdos/get_stabsenmhs', method: 'POST', success: function(response) { var x = Ext.decode(response.responseText); if(x.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'; } }); } } }), totalProperty: 'results', root: 'data', autoLoad: true, fields: [{ name: 'idstabsenmhs', mapping: 'idstabsenmhs' },{ name: 'kdstabsensimhs', mapping: 'kdstabsensimhs' },{ name: 'stabsensimhs', mapping: 'stabsensimhs' }] }); var fields_absenmhs = RH.storeFields('kdprodi', 'kdstsemester', 'kdmk', 'nidu', 'nim', 'nmmhs', 'kdjnskelamin','thnmasuk','idkelas', 'p1','p2','p3','p4','p5','p6','p7','p8', 'p9','p10','p11','p12','p13','p14','p15','p16'); var ds_absenmhs = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'e_akademic/c_matkulabsennilaimhsdos/get_absenmhs', method: 'POST', success: function(response) { var x = Ext.decode(response.responseText); if(x.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'; } }); } } }), root: 'data', totalProperty: 'results', autoLoad: false, fields : fields_absenmhs, }); function render_stabsen(value) { var val = RH.getRecordFieldValue(ds_stabsenmhs, 'kdstabsensimhs', 'idstabsenmhs', value); return RH.qtipEdit(val,'12px'); } var fnSelect = function(combo, record){ Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_matkulabsennilaimhsdos/update_absenmhs', params: { kdprodi : Skdprodi, kdstsemester : Skdstsemester, kdmk : Skdmk, nidu : Snidu, nim : Snim, idkelas : Sidkelas, field : SdataIndex, value : record.data['idstabsenmhs'] }, success: function(response) { var r = Ext.decode(response.responseText); if(r.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'; } }); } ds_absenmhs.reload(); }, failure: function() { Ext.Msg.alert("Info", "Ubah Data Gagal"); } }); }; var ds_tatapmuka = new Ext.data.JsonStore({ //static data fields: [{ name: 'kode', mapping: 'kode' }], data: [ { "kode":"1"},{ "kode":"2"},{ "kode":"3"},{ "kode":"4"},{ "kode":"5"}, { "kode":"6"},{ "kode":"7"},{ "kode":"8"},{ "kode":"9"},{ "kode":"10"}, { "kode":"11"},{ "kode":"12"},{ "kode":"13"},{ "kode":"14"},{ "kode":"15"}, { "kode":"16"}, ] }); function get_colums_p(np){ var objArr = new Array(); for(var i=0; i' + strP + '', dataIndex: dataindex, width: 45, renderer: render_stabsen, editor: RH.getComboEditor(dataindex, false, ds_stabsenmhs, 'idstabsenmhs', 'kdstabsensimhs', fnSelect), } } return objArr; } var colums_p = get_colums_p(16); var cm_absenmhs = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), { header: 'NPM', width:100, align: 'center', dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 190, dataIndex: 'nmmhs',sortable: true, }, { header: '(L/P)', width: 40, align: 'center', dataIndex: 'kdjnskelamin', } ].concat(colums_p) ); var sm_absenmhs = new Ext.grid.RowSelectionModel({ singleSelect: true }); var gv_absenmhs = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); var cari_absenmhs = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var gp_absenmhs = new Ext.grid.EditorGridPanel({ title: 'Daftar Absen Mahasiswa', ds: ds_absenmhs, cm: cm_absenmhs, view: gv_absenmhs, frame: true, height:245, autoWidth: true, bodyStyle: 'padding:3px 3px 3px 3px', plugins: cari_absenmhs, id: 'gp_absenmhs', forceFit: true, tbar: [{ xtype:'label', text:'Pertemuan ke:', style: 'font-size:12px;margin-right:11px;margin-left:11px', },RH.ActionCombo({ id: 'cb.temuke', label: 'Pertemuan ke', width: 50, data: ds_tatapmuka, key: 'kode', display: 'kode', fnSelect: function(){ fnSetStabsenmhs('cb.temuke', 'cb.stabsenmhs', 'cbx.stbsenmhs'); }//arg.fnSelect_temuke }), { xtype:'label', text:'Pilih Semua:', style: 'font-size:12px;margin-right:11px;margin-left:11px', },{ xtype: 'checkbox', id:'cbx.stbsenmhs', fieldLabel:'Pilih Semua', listeners: { check: function(cb, value) { if(value == true){ Ext.getCmp('cb.temuke').disable(); Ext.getCmp('cb.temuke').setValue(''); fnSetStabsenmhs('cb.temuke', 'cb.stabsenmhs', 'cbx.stbsenmhs'); }else{ Ext.getCmp('cb.temuke').enable(); Ext.getCmp('cb.temuke').setValue(''); } } } },{ xtype:'label', text:'Status:', style: 'font-size:12px;margin-right:11px;margin-left:11px', },RH.ActionCombo({ id: 'cb.stabsenmhs', label: 'Status', width:90, data: ds_stabsenmhs, key: 'idstabsenmhs', display: 'stabsensimhs', fnSelect: function(){ fnSetStabsenmhs('cb.temuke', 'cb.stabsenmhs', 'cbx.stbsenmhs'); }//arg.fnSelect_stabsenmhs }), { xtype:'button', iconCls:'silk-save', text:'Simpan', margins:'0 0 0 10', id:'bt.saveabsenmhs', handler: function(){ saveAbsenMhs(); } },'->'], sm: sm_absenmhs, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, listeners: { cellclick: onCellabsenmhsClick } }); function onCellabsenmhsClick(grid, rowIndex, columnIndex, e) { var record = grid.getStore().getAt(rowIndex); Skdprodi = record.data['kdprodi']; Skdstsemester = record.data['kdstsemester']; Skdmk = record.data['kdmk']; Snidu = record.data['nidu']; Snim = record.data['nim']; Sidkelas = record.data['idkelas']; SdataIndex = grid.getColumnModel().getDataIndex(columnIndex); } function fnSetStabsenmhs(idComboTemu, idComboStatus, idCheckBox){ var pertemuan = RH.getCompValue(idComboTemu,true); var status = RH.getCompValue(idComboStatus,true); var getall = Ext.getCmp(idCheckBox).getValue(); if(Ext.getCmp('gp_absenmhs')){ var grid = Ext.getCmp('gp_absenmhs'); var sel_model = grid.getSelectionModel(); var store = grid.getStore(); var numrec = store.getCount(); //jumlah record if(numrec > 0){ for(var i=0; i 0){ var waitmsg_saveabsenmhs = Ext.MessageBox.wait('Menyimpan Absensi Mahasiswa....', 'Info'); for(var i=0; i' + value + ''; } else if (value == 'C') { return '' + value + ''; } else if (value == 'D' || value == 'E' || value == 'T') { return '' + value + ''; } return value; } function render_nilaihurufsp(value) { 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; } var sb_nilaimhs = RH.searchComp({ id: 'sb_nilaimhs', fields : ['nim:NIM','nmmhs:Nama Mahasiswa', 'klsparalel:Kelas Paralel'], selected : 'nmmhs', store : ds_nilaimhs, textWidth : 200 }); var cm_nilaimhs = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), { 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' }, { 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' }] ); var sm_nilaimhs = new Ext.grid.RowSelectionModel({ singleSelect: true }); var gv_nilaimhs = new Ext.grid.GridView({emptyText: '< Belum ada Data >'}); var cari_nilaimhs = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var gp_nilaimhs = new Ext.grid.EditorGridPanel({ title: 'Daftar Nilai Mahasiswa', ds: ds_nilaimhs, cm: cm_nilaimhs, view: gv_nilaimhs, frame: true, height:245, autoWidth: true, bodyStyle: 'padding:3px 3px 3px 3px', plugins: cari_nilaimhs, id: 'gp_nilaimhs', forceFit: true, tbar: ['->'], sm: sm_nilaimhs, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, listeners: { cellclick: onCellNilaiClick } }); function onCellNilaiClick(grid, rowIndex, cellIndex, e) { var rec = ds_nilaimhs.getAt(rowIndex); var record = grid.getStore().getAt(rowIndex); // Get the Record idnilai = record.data['idnilai']; var columnName = gp_nilaimhs.getColumnModel().getDataIndex(cellIndex); var nilai= rec.data['bobotnilai']; var nilaisp= rec.data['bobotnilaisp']; var n_huruf= rec.data['nilaihuruf']; 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(); } } if (columnName == 'nilaihuruf') { if (nilai > 0.00) { Ext.MessageBox.alert("Informasi", "Anda tidak berhak mengubah nilai"); Ext.getCmp('nilaihuruf').disable(); return; } else{ Ext.getCmp('nilaihuruf').enable(); } } } function updateNilai(nilaihuruf, bobotnilai){ Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_matkulabsennilaimhsdos/update_nilai', params: { idnilai : idnilai, nilaihuruf : nilaihuruf, bobotnilai : bobotnilai, nmcom : CLIENT }, success: function(response) { var x = Ext.decode(response.responseText); if(x.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'; } }); } Ext.Msg.alert("Info", "Ubah Data Berhasil"); ds_nilaimhs.reload(); }, failure: function() { Ext.Msg.alert("Info", "Ubah Data Gagal"); } }); } function updateNilaiSP(nilaihurufsp, bobotnilaisp){ Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_matkulabsennilaimhsdos/update_nilaisp', params: { idnilai : idnilai, nilaihurufsp : nilaihurufsp, bobotnilaisp : bobotnilaisp, nmcom : CLIENT }, success: function(response) { var r = Ext.decode(response.responseText); if(r.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'; } }); } Ext.Msg.alert("Info", "Ubah Data Berhasil"); }, failure: function() { Ext.Msg.alert("Info", "Ubah Data Gagal"); } }); } //=================================================================== var f_absenmhsbydosen = new Ext.form.FormPanel({ id: 'f_absenmhsbydosen', bodyStyle: 'padding: 0px', autoScroll: true, frame: true, title: 'Input Kehadiran Dan Nilai Mahasiswa', items: [{ xtype: 'fieldset', title: '', layout:'column', items: [{ columnWidth: .50, layout: 'form', labelAlign:'right', border: false, items: [{ xtype: 'combo', labelStyle: 'width:170px;', fieldLabel: 'Tahun Akademik - Semester', store: ds_stsmt, name: 'kdstsemester', id: 'kdstsemester', triggerAction: 'all', editable: false, valueField: 'kdstsemester', displayField: 'nmthnakademik', forceSelection: true, submitValue: true, disabled: true, hiddenName: 'h_kdstsemester', listeners: { select: function() { cariMatkul(); } }, typeAhead: true, mode: 'local', emptyText: 'Pilih...', selectOnFocus: true, width: 150 }] }] }, grid_matkuldos, gp_absenmhs, gp_nilaimhs], listeners:{ afterrender: function(){ ds_stsmt.load({ scope : this, callback: function(records, operation, success) { Ext.getCmp('kdstsemester').setValue(KDSTSEMESTER); cariMatkul(KDSTSEMESTER); } }); } } }); function cariMatkul(KDSTSEMESTER) { Ext.getCmp('cb.temuke').disable(); Ext.getCmp('cb.temuke').setValue(''); Ext.getCmp('cbx.stbsenmhs').disable(); Ext.getCmp('cbx.stbsenmhs').setValue(false); Ext.getCmp('cb.stabsenmhs').disable(); Ext.getCmp('cb.stabsenmhs').setValue(''); Ext.getCmp('bt.saveabsenmhs').disable(); ds_matkuldos.setBaseParam('kdstsemester', KDSTSEMESTER); ds_matkuldos.setBaseParam('nidu', USERID); ds_matkuldos.load(); } get_content(f_absenmhsbydosen); Ext.getCmp('cb.temuke').disable(); Ext.getCmp('cbx.stbsenmhs').disable(); Ext.getCmp('cb.stabsenmhs').disable(); Ext.getCmp('bt.saveabsenmhs').disable(); }