function f_karturencanastudi(nimnya, titleyy, vkdstsemester) { var useridnya, titley, type, hidemhs, hidedosenwali, statusjadwal, semester, hidecari; var dosenwalinya, jumlahambilnya, jumlahsksnya, persen, persenadd, mindpp, statsistemkrs; var ds_stkrs = store_stkrs(); var ds_semester = store_semester_private(); var ds_thnakademik2 = store_thnakademik2(); var validjadwalkrs = '', validsistemkrs = '', validsemester = '', validdosenwali = '', validpembayaran = '', validtagihandpp = '', validtagihandpk = '', validsksambil = '', validskssetuju = '', validlunasdpp = '', validlunasdpk = '', VALIDKRS = ''; if (titleyy != '') { //DOSEN titley = 'PERIKSA KRS'; hidemhs = true; hidedosenwali = false; } else { titley = 'KRS ONLINE'; //MHS hidemhs = false; hidedosenwali = true; } if (nimnya != '') { useridnya = nimnya; } else { useridnya = USERID; } if (L_MEMBER=='2' /*mhs*/|| L_MEMBER=='3' /*dsn*/|| L_MEMBER=='4' /*rktr*/|| L_MEMBER=='5' /*pmb*/|| L_MEMBER=='6' || L_MEMBER=='8' /*lppm*/) { hidecari=true; } else {/*helpdeskadmin*/ hidecari=false; } p = new Ext.Panel({ border: true, frame: true, style: 'margin-left: 70px;margin-bottom: 30px', width: 120, height: 135, html: '

PHOTO

' }); var mhsDispPanel = new Ext.form.FormPanel({ id: 'fp.mhsFDisp', border: false, bodyStyle: 'padding:5px 5px 0', frame: true, labelAlign: 'top', layout: 'anchor', forceFit:true, reader: new Ext.data.JsonReader({ root: 'data', totalProperty: 'results', id: 'id', fields: [{ name: "nim", mapping: "nim" }, { name: "tahunmsk", mapping: "tahunmsk" }, { name: "nmmhs", mapping: "nmmhs" }, { name: "nmfakultas", mapping: "nmfakultas" }, { name: "nmprodi", mapping: "nmprodi" }, { name: "kdthnakademik", mapping: "kdthnakademik" }, { name: "persen", mapping: "persen" }, { name: "stbayar", mapping: "stbayar" }, { name: "idjnssemester", mapping: "idjnssemester"//kdstsemester }, { name: "kdstsemester", mapping: "kdstsemester" }, { name: "foto", mapping: "foto" }, { name: "kdprodi", mapping: "kdprodi" }, { name: "idkelas", mapping: "idkelas" }, { name: "nmkelas", mapping: "nmkelas" }, { name: "idklsmhs", mapping: "idklsmhs" }, { name: "kdstawalmhs", mapping: "kdstawalmhs" }, { name: "nmstawalmhs", mapping: "nmstawalmhs" }] }), items: [{ columnWidth: 1, border: false, layout: 'form', items: [p, { xtype: 'compositefield', name: 'comp_npm', fieldLabel: 'NPM - Tahun Masuk', id: 'comp_npm', items: [{ xtype: 'textfield', id: 'nim', width: 150, allowBlank: false, readOnly: true, listeners: {} }, { xtype: 'textfield', width: 90, readOnly: true, id: 'tahunmsk' }] }, { xtype: 'textfield', fieldLabel: 'Nama Mahasiswa', id: 'nmmhs', anchor: '100%', readOnly: true, allowBlank: false }, { xtype: 'textfield', fieldLabel: 'Fakultas', anchor: '100%', readOnly: true, id: 'nmfakultas' }, { xtype: 'textfield', fieldLabel: 'Program Studi', anchor: '100%', readOnly: true, id: 'nmprodi' }, { xtype: 'textfield', fieldLabel: 'Status Masuk', anchor: '100%', readOnly: true, id: 'nmstawalmhs' }, { xtype: 'textfield', fieldLabel: 'Kelas', anchor: '100%', readOnly: true, id: 'nmkelas' }, { xtype: 'textfield', fieldLabel: 'Tahun Akademik - Semester', anchor: '100%', readOnly: true, id: 'kdthnakademik' }, { xtype: 'label', text: '', id: 'alertbayar', style: 'color: red;font-size:12px;', hidden:true }, { xtype: 'textfield', fieldLabel: 'Persentase Pembayaran DPP', anchor: '100%', readOnly: true, id: 'persen' }, { xtype: 'textfield', fieldLabel: 'Status Bayar DPP', anchor: '100%', readOnly: true, id: 'stbayar' }, { xtype: 'textfield', fieldLabel: 'Persentase Pembayaran DP9 (Optional)', anchor: '100%', readOnly: true, id: 'persenopt' }, { xtype: 'textfield', fieldLabel: 'Status Bayar DP9 (Optional)', anchor: '100%', readOnly: true, id: 'stbayaropt' }, { xtype: 'textfield', id: 'idjnssemester', hidden: true }, { xtype: 'textfield', id: 'kdstsemester', hidden: true }, { xtype: 'textfield', id: 'foto', hidden: true /* validator: function(value){ mhs_foto_ori(Ext.getCmp("foto").getValue()); } */ }, { xtype: 'textfield', id: 'kdprodi', hidden: true // }, { xtype: 'textfield', id: 'idkelas', hidden: true // }, { xtype: 'textfield', id: 'idklsmhs', hidden: true // }, { xtype: 'textfield', id: 'kdstawalmhs', hidden: true // }] }] }); var reader = new Ext.data.JsonReader({ root:'data', idProperty: '', totalProperty: 'results', remoteGroup: true, fields: [{ name: "idkurikulum", mapping: "idkurikulum" }, { name: "kdmk", mapping: "kdmk" }, { name: "nmmk", mapping: "nmmk" }, { name: "idsemester", mapping: "idsemester" }, { name: "jmlsks", mapping: "jmlsks" }, { name: "tahunmsk", mapping: "tahunmsk" }, { name: "nidupengajar", mapping: "nidupengajar" }, { name: "namapengajar", mapping: "namapengajar" }, /* { name: "jadwal", mapping: "jadwal" }, */ { name: "ambilval", mapping: "ambilval", type: 'bool' }, { name: "setujuval", mapping: "setujuval", type: 'bool' }, { name: "nilai", mapping: "nilai" }, { name: "idstkrs", mapping: "idstkrs" }, { name: "idstambilmk1", mapping: "idstambilmk1" }, { name: "namaambil", mapping: "namaambil" }, { name: "namasetuju", mapping: "namasetuju" }, { name: "jmlsyaratmk", mapping: "jmlsyaratmk" }, { name: "syaratmk", mapping: "syaratmk" }, { name: "ketsyaratmk", mapping: "ketsyaratmk" }, { name: "idkelaspengajar", mapping: "idkelaspengajar" }, { name: "nmkelaspengajar", mapping: "nmkelaspengajar" }], listeners: { load: function(store, records, options) { } } }); var ds_nya = new Ext.data.GroupingStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'e_akademic/c_karturencanastudi/grid', method: 'POST', 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'; } }); } } }), /* baseParams: { thmasuk: RH.getCompValue('cb.thmasuk-dpk'), idklsmhs: RH.getCompValue('cb.jbayar-dpk') }, */ reader: reader, groupField:'idsemester', //sortInfo:{field:'kdfakultas',direction:'ASC'}, remoteSort: true, }); /* var ds_nya = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'e_akademic/c_karturencanastudi/grid', method: 'POST' }), root: 'data', totalProperty: 'results', fields: [{ name: "idkurikulum", mapping: "idkurikulum" }, { name: "kdmk", mapping: "kdmk" }, { name: "nmmk", mapping: "nmmk" }, { name: "idsemester", mapping: "idsemester" }, { name: "jmlsks", mapping: "jmlsks" }, { name: "tahunmsk", mapping: "tahunmsk" }, { name: "nidupengajar", mapping: "nidupengajar" }, { name: "namapengajar", mapping: "namapengajar" }, { name: "jadwal", mapping: "jadwal" }, { name: "ambilval", mapping: "ambilval", type: 'bool' }, { name: "setujuval", mapping: "setujuval", type: 'bool' }, { name: "nilai", mapping: "nilai" }, { name: "idstkrs", mapping: "idstkrs" }, { name: "idstambilmk1", mapping: "idstambilmk1" }, { name: "namaambil", mapping: "namaambil" }, { name: "namasetuju", mapping: "namasetuju" }, { name: "jmlsyaratmk", mapping: "jmlsyaratmk" }, { name: "syaratmk", mapping: "syaratmk" }, { name: "ketsyaratmk", mapping: "ketsyaratmk" },], listeners: { load: function(store, records, options) { } } }); */ var sm_nya = new Ext.grid.CheckboxSelectionModel({ listeners: { selectionchange: function(sm) { } } }); var cari_data_nya = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var paging = new Ext.PagingToolbar({ pageSize: 50, store: ds_nya, displayInfo: true, displayMsg: 'Data Mata Kuliah Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var vw = new Ext.grid.GridView({ emptyText: '< No Data To Display >' }); var cm = new Ext.grid.ColumnModel({ defaults: { sortable: true }, columns: [ new Ext.grid.RowNumberer(), { header: 'Semester', width: 205, dataIndex: 'idsemester', renderer: function(value, p, r) {return 'Semester ' + r.data['idsemester']} }, { header: '
Kode
Mata Kuliah
', width: 100, dataIndex: 'kdmk', sortable: true }, { header: '
Nama Mata Kuliah
(Bahasa Indonesia)
', width: 250, dataIndex: 'nmmk', sortable: true }/* , { header: '
Semester
', width: 55, dataIndex: 'idsemester', sortable: true } */, { header: '
SKS
', width: 40, dataIndex: 'jmlsks', sortable: true }, { header: '
Syarat Matakuliah
', width: 150, dataIndex: 'ketsyaratmk', sortable: true, renderer: function(value){ Ext.QuickTips.init(); if (value=='Tidak Lulus Syarat') { if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) return '
' + value +'
'; } else { return '
-
'; } } else if (value=='Lulus Syarat') { return '
' + value +'
'; } else { return '
' + value + '
'; } } }, { header: '
Dosen Pengajar
', width: 150, dataIndex: 'namapengajar', sortable: true, renderer: function(value){ if (value=='-') { return '
' + value + '
'; } else { return value; } } }, { header: '
Kelas
', width: 100, dataIndex: 'nmkelaspengajar', sortable: true, renderer: function(value){ if (value=='-') { return '
' + value + '
'; } else { return value; } } }, /* { header: '
Jadwal
', width: 350, dataIndex: 'jadwal', sortable: true }, */ { xtype: 'checkcolumn', header: '
Ambil
', width: 50, dataIndex: 'ambilval', hidden: hidemhs, sortable: true, processEvent : function(name, e, grid, rowIndex, colIndex){ if (titley == 'KRS ONLINE') { if (name == 'mousedown') { var record = grid.store.getAt(rowIndex); if (statusjadwal == '0') { return; } if (Ext.getCmp('idsistemkrs').getValue() == '1') { return; } if (statsistemkrs == '0') { return; } if (record.data['ketsyaratmk'] == 'Tidak Lulus Syarat') { //tidak lulus syarat if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) Ext.MessageBox.alert('Informasi', 'Matakuliah Ini Tidak Lulus Syarat Matakuliah'); return; } } if (record.data['nilai'] != '-') { //jika sudah ada nilainya Ext.MessageBox.alert('Informasi', 'Anda Tidak Dapat Membatalkan Matakuliah Yang Sudah Ada Nilainya'); } else if (record.data['idstkrs'] == '1') { //jika sudah disetujui if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) if (L_MEMBER == '2') { //Jika Mahasiswa Ext.MessageBox.alert('Informasi', 'Konfirmasi Dosen Wali Jika Ingin Membatalkan'); } else { batalsetuju( Ext.getCmp('thnakademikkrs').getValue(), Ext.getCmp('kdprodi').getValue(), Ext.getCmp('idkelas').getValue(), Ext.getCmp('nim').getValue(), record.data['kdmk'], record.data['nidupengajar'] ); } } else { batalsetuju( Ext.getCmp('thnakademikkrs').getValue(), Ext.getCmp('kdprodi').getValue(), Ext.getCmp('idkelas').getValue(), Ext.getCmp('nim').getValue(), record.data['kdmk'], record.data['nidupengajar'] ); } } else if (record.data['namapengajar'] == '-') { //jika dosen pengajar belum ada Ext.MessageBox.alert('Informasi', 'Doseen Pengajar Belum Ada'); } else if (record.data['idsemester'] == '9') { //Optional if (persenadd < 50) { Ext.MessageBox.alert('Informasi', 'Persentase Pembayaran DP9 Minimal 50 %'); return; } else { record.set(this.dataIndex, !record.data[this.dataIndex]); } } else { record.set(this.dataIndex, !record.data[this.dataIndex]); } get_sksambil(); } } } }, { xtype: 'checkcolumn', header: '
Disetujui
', width: 50, dataIndex: 'setujuval', hidden: hidedosenwali, sortable: true, processEvent : function(name, e, grid, rowIndex, colIndex){ if (titley == 'PERIKSA KRS') {//if (titley == 'PERIKSA KRS') { if (name == 'mousedown') { var record = grid.store.getAt(rowIndex); if (statusjadwal == '0') { return; } if (Ext.getCmp('idsistemkrs').getValue() == '1') { return; } if (statsistemkrs == '0') { return; } if (record.data['ketsyaratmk'] == 'Tidak Lulus Syarat') { //tidak lulus syarat if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) Ext.MessageBox.alert('Informasi', 'Matakuliah Ini Tidak Lulus Syarat Matakuliah'); return; } } if (record.data['idstkrs'] == '1') { //jika sudah disetujui //Ext.MessageBox.alert('Informasi', 'Matakuliah Sudah Disetujui'); batalsetuju( Ext.getCmp('thnakademikkrs').getValue(), Ext.getCmp('kdprodi').getValue(), Ext.getCmp('idkelas').getValue(), Ext.getCmp('nim').getValue(), record.data['kdmk'], record.data['nidupengajar'] ); } else if (record.data['namapengajar'] == '-') { //jika dosen pengajar belum ada Ext.MessageBox.alert('Informasi', 'Dosen Pengajar Belum Ada'); } else if (record.data['idsemester'] == '9') { //Optional if (persenadd < 50) { Ext.MessageBox.alert('Informasi', 'Persentase Pembayaran DP9 Minimal 50 %'); return; } else { record.set(this.dataIndex, !record.data[this.dataIndex]); } } else { record.set(this.dataIndex, !record.data[this.dataIndex]); } get_skssetuju(); } } } }, { header: '
Nilai
', width: 50, dataIndex: 'nilai', sortable: true, renderer: function(value){ if (value=='-') { return '
' + value + '
'; } else { return value; } } }, { header: '
Keterangan
', width: 150, dataIndex: 'namaambil', sortable: true, renderer: function(value){ if (value=='-') { return '
' + value + '
'; } else { return value; } } }, { header: '
Status
', width: 120, dataIndex: 'namasetuju', sortable: true, renderer: function(value){ if (value=='-') { return '
' + value + '
'; } else { return value; } } }, { xtype: 'actioncolumn', width: 150, header: '
Jadwal Kuliah
', align:'center', items: [{ getClass: function(v, meta, record) { meta.attr = "style='cursor:pointer;'"; }, icon : BASE_PATH+'/resources/img/icons/fam/report.png', tooltip: 'Lihat Jadwal Kuliah', handler: function(grid, rowIndex) { showJadwalMk(grid, rowIndex); } }] } ] }); var grid_nya = new Ext.grid.EditorGridPanel({ //plugins: cari_data_nya, store: ds_nya, sm: sm_nya, cm: cm, view: new Ext.grid.GroupingView({ forceFit:true, groupTextTpl: '{text} ({[values.rs.length]} {["Matkul"]})', enableGroupingMenu: false, // don't show a grouping menu enableNoGroups: false, // don't let the user ungroup hideGroupedColumn: true, // don't show the column that is being used to create the heading showGroupName: false, // don't show the field name with the group heading startCollapsed: false // the groups start closed/no }), autoScroll: true, columnLines: true, clicksToEdit: 1, loadMask: true, frame: true, height: 310, id: 'grid_det_nya', tbar: [ { xtype: 'textfield', id: 'nimcari', hidden: true, validator: function(value){ if (Ext.getCmp('thnakademikkrs').getValue()) { awal(value, Ext.getCmp('thnakademikkrs').getValue()); } else { awal(value, KDSTSEMESTER); } } }, { text: 'Cari Mahasiswa', id:'btncari', name:'btncari', iconCls: 'silk-find', hidden:hidecari, handler:function(){ wGridMhs('KRS'); } },{ text: 'Simpan', id:'btnsimpan', name:'btnsimpan', //hidden:(titley == 'PERIKSA KRS') ? true:false, iconCls: 'silk-accept', handler:function(){ if (titley == 'KRS ONLINE') { simpanambil(); } else if (titley == 'PERIKSA KRS') { simpansetuju(); } } }, { text: 'Cetak', id:'btncetak', iconCls: 'silk-printer', handler: function() { /*var issetuju = ""; //cek pengajar issetuju = Ext.getCmp('namasetuju').getValue(); if (issetuju = 'Tidak / Belum Disetujui') { issetuju = '0'; }else if(issetuju = 'Disetujui') { issetuju = '1'; } if (issetuju = '1') { var isblanko = ""; Ext.MessageBox.show({ title: "Konfirmasi", msg: "Cetak Blanko?
" + "1. Jika Yes, maka mencetak seluruh daftar matakuliah dengan isian kosong
" + "2. Jika No, maka mencetak matakuliah yang dipilih saja", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { isblanko = "1"; } else if (btn == 'no') { isblanko = "0"; } else { return; } var parsing = ''; parsing = parsing + Ext.getCmp('nim').getValue() + '/' ; parsing = parsing + Ext.getCmp('kdprodi').getValue() + '/' ; parsing = parsing + Ext.getCmp('tahunmsk').getValue() + '/' ; parsing = parsing + Ext.getCmp('thnakademikkrs').getValue() + '/' ; parsing = parsing + Ext.getCmp('idkelas').getValue() + '/' ; parsing = parsing + Ext.getCmp('cb.semester').getValue() + '/' ; parsing = parsing + Ext.getCmp('nidu').getValue() + '/' ; parsing = parsing + isblanko; var win = window.open(); win.location.reload(); win.location = BASE_URL + 'print/cetak_krs/get_cetak_krs/'+parsing; } }); }else{ Ext.MessageBox.alert({ title: "Peringatan", msg: "Tidak bisa cetak KRS
" + "1. Terdapat Matakuliah yang belum di setujui
" + "2. Silahkan hubungi dosen wali masing-masing untuk menyetujui Matakuliah", buttons: Ext.MessageBox.YESNO }); return; }*/ var isblanko = ""; Ext.MessageBox.show({ title: "Konfirmasi", msg: "Cetak Blanko?
" + "1. Jika Yes, maka mencetak seluruh daftar matakuliah dengan isian kosong
" + "2. Jika No, maka mencetak matakuliah yang dipilih saja", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { isblanko = "1"; } else if (btn == 'no') { isblanko = "0"; } else { return; } var parsing = ''; parsing = parsing + Ext.getCmp('nim').getValue() + '/' ; parsing = parsing + Ext.getCmp('kdprodi').getValue() + '/' ; parsing = parsing + Ext.getCmp('tahunmsk').getValue() + '/' ; parsing = parsing + Ext.getCmp('thnakademikkrs').getValue() + '/' ; parsing = parsing + Ext.getCmp('idkelas').getValue() + '/' ; parsing = parsing + Ext.getCmp('cb.semester').getValue() + '/' ; parsing = parsing + Ext.getCmp('nidu').getValue() + '/' ; parsing = parsing + isblanko; var win = window.open(); win.location.reload(); win.location = BASE_URL + 'print/cetak_krs/get_cetak_krs/'+parsing; } }); } },'->', { xtype: 'label', text: '', id: 'alertidsemester', style: 'color: red;margin-right:5px', }, { xtype: 'label', hidden: false, text: 'Semester: ', style: 'margin-right:5px', }, { xtype: 'combo', readOnly: true, id: 'cb.semester', //fieldLabel: 'Semester', store: ds_semester, valueField: 'idsemester', displayField: 'semester', width: 100, triggerAction: 'all',editable: false, forceSelection: true, submitValue: true, mode: 'local', emptyText:'...', //selectOnFocus:true, listeners:{ scope: this, 'select': function(){ /* setGridDPK(); setGridDPKdet(); */ /* ds_nya.setBaseParam('kdprodi', Ext.getCmp('kdprodi').getValue()); ds_nya.setBaseParam('idkelas', Ext.getCmp('idkelas').getValue()); ds_nya.setBaseParam('tahunmsk', Ext.getCmp('tahunmsk').getValue()); // ds_nya.setBaseParam('kdthnakademik', Ext.getCmp('kdthnakademik').getValue()); ds_nya.setBaseParam('nim', Ext.getCmp('nim').getValue()); ds_nya.setBaseParam('kdstsemester', KDSTSEMESTER); ds_nya.setBaseParam('idsemester', Ext.getCmp('cb.semester').getValue()); reload(); */ } } }], listeners: { cellclick : function(grid, rowIndex, cellIndex, e){ var t = e.getTarget(); if (t.className == 'syaratmk') { showSyaratMk(grid, rowIndex);//LIHAT SYARAT MK } }, } }); var paging_nya = new Ext.PagingToolbar({ pageSize: 50, store: ds_nya, displayInfo: true, displayMsg: 'Data KRS Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var form_bp_general = new Ext.form.FormPanel({ id: 'form_bp_general', forceFit: true, title: titley, autoScroll: true, tbar: [], layout: 'column', items: [{ columnWidth: 1, xtype: 'panel', border: false, bodyStyle: 'padding:0px 0px 0px 3px', items: [{ layout: 'form', border: false, items: [{ xtype: 'fieldset', title: 'Periode KRS', id:'infokrs', width: 800, items: [{ layout: 'column', border: false, items: [{ columnWidth: .35, layout: 'form', border: false, items: [{ xtype: 'combo', disabled: true, id: 'thnakademikkrs', name: 'thnakademikkrs', fieldLabel: 'Tahun Akademik - Semester', width:140, store: ds_thnakademik2, triggerAction: 'all', editable: false, valueField: 'kdstsemester', displayField: 'nmthnakademik', forceSelection: true, submitValue: true, emptyText: 'Pilih...', hiddenName: 'h_thakademik', listeners: { select: function(c, r, i) { awal(Ext.getCmp('nim').getValue(),r.get("kdstsemester")); } }, typeAhead: true, mode: 'local', emptyText: 'Belum Dipilih...', selectOnFocus: true }] } , { columnWidth: .30, layout: 'form', border: false, items: [{ xtype: 'datefield', fieldLabel: 'Tanggal Awal', name: 'tglawal', id: 'tglawal', readOnly: true, value: new Date().format('d/m/Y'), format: "d/m/Y" }] } , { columnWidth: .30, layout: 'form', border: false, items: [{ xtype: 'datefield', fieldLabel: 'Tanggal Akhir', name: 'tglakhir', id: 'tglakhir', readOnly: true, value: new Date().format('d/m/Y'), format: "d/m/Y" }] } ] },{ layout: 'column', border: false, items: [{ columnWidth: .35, layout: 'form', border: false, items: [{ xtype: 'label', text: '', id: 'alertjdwlkrs', style: 'color: red;font-size:12px;', }] }] } ] }, { xtype: 'fieldset', title: 'Daftar Mata Kuliah', id:'daftarmakul', items: [grid_nya] }, { xtype: 'fieldset', title: 'Informasi KRS', items: [{ layout: 'column', border: false, items: [{ columnWidth: .65, layout: 'form', border: false, items: [{ xtype: 'textfield', style: 'text-align: right;', labelStyle: 'width:200px;', fieldLabel: 'Jumlah SKS yang diambil', id: 'jmlsks2', name: 'jmlsks2', width: 50, allowBlank: false, readOnly: true, listeners: {} }, { xtype: 'textfield', style: 'text-align: right;', labelStyle: 'width:200px;', fieldLabel: 'Jumlah SKS yang disetujui', id: 'jmlskssetuju', width: 50, allowBlank: false, readOnly: true, listeners: {} }, { xtype: 'textfield', style: 'text-align: right;', labelStyle: 'width:200px;', fieldLabel: 'IP Semester Sebelumnya', id: 'ipsebelumsemester', width: 50, allowBlank: false, readOnly: true, listeners: {} }, { xtype: 'textfield', style: 'text-align: right;', labelStyle: 'width:200px;', fieldLabel: '', id: 'idsistemkrs', width: 50, hidden: true, readOnly: true, listeners: {} }, { xtype: 'textfield', style: 'text-align: left;', labelStyle: 'width:200px;', fieldLabel: 'Sistem KRS', id: 'sistemkrs', width: 100, allowBlank: false, readOnly: true, listeners: {} }, { xtype: 'label', text: '', id: 'alertsistemkrs', style: 'color: red;font-size:12px;', }] }, { columnWidth: .35, layout: 'form', border: false, items: [{ xtype: 'textfield', style: 'text-align: right;', labelStyle: 'width:200px;', fieldLabel: 'Jumlah Minimal SKS yang diambil', id: 'jmlsksmin', width: 50, allowBlank: false, readOnly: true, hidden:true, listeners: {} }, { xtype: 'textfield', style: 'text-align: right;', labelStyle: 'width:200px;', fieldLabel: 'Jumlah Maksimal SKS yang diambil', id: 'jmlsksmax', width: 50, allowBlank: false, readOnly: true, listeners: {} }, { xtype: 'label', text: '', id: 'alertsks', style: 'color: red;font-size:12px;', } ] }] }] }, { xtype: 'fieldset', title: 'Tagihan Pembayaran', id:'bayartagihan', hidden: true, items: [ { xtype: 'compositefield', fieldLabel: 'DPP', labelStyle: 'width:50px;', items: [{ xtype: 'label', text: 'Biaya:', style: 'font-size:12px;', },{ xtype: 'numericfield', style: 'text-align: right;', id: 'biayatagihandpp', maskRe: /[0-9.]/, width: 100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', readOnly: true, listeners: {} },{ xtype: 'label', text: 'Min. Tagihan:', style: 'font-size:12px;', },{ xtype: 'numericfield', style: 'text-align: right;', id: 'mintagihandpp', maskRe: /[0-9.]/, width: 100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', readOnly: true, listeners: {} },{ xtype: 'label', text: 'Akan Bayar:', style: 'font-size:12px;', },{ xtype: 'numericfield', style: 'text-align: right;', id: 'dibayardpp', maskRe: /[0-9.]/, width: 100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', listeners: {} },{ xtype: 'label', text: 'No. Virtual Account:', style: 'font-size:12px;', },{ xtype: 'textfield', style: 'text-align: left;', id: 'noaccountdpp', width: 200, readOnly: true, listeners: {} }] }, { xtype: 'label', id: 'alerttagihandpp', text: '', style: 'color: red;font-size:12px;', }, { xtype: 'compositefield', fieldLabel: 'DPK', labelStyle: 'width:50px;', items: [{ xtype: 'label', text: 'Biaya:', style: 'font-size:12px;', },{ xtype: 'numericfield', style: 'text-align: right;', id: 'biayatagihandpk', maskRe: /[0-9.]/, width: 100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', readOnly: true, listeners: {} },{ xtype: 'label', text: 'Min. Tagihan:', style: 'font-size:12px;', },{ xtype: 'numericfield', style: 'text-align: right;', id: 'mintagihandpk', maskRe: /[0-9.]/, width: 100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', readOnly: true, listeners: {} },{ xtype: 'label', text: 'Akan Bayar:', style: 'font-size:12px;', },{ xtype: 'numericfield', style: 'text-align: right;', id: 'dibayardpk', maskRe: /[0-9.]/, width: 100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', listeners: {} },{ xtype: 'label', text: 'No. Virtual Account:', style: 'font-size:12px;', },{ xtype: 'textfield', style: 'text-align: left;', id: 'noaccountdpk', width: 200, readOnly: true, listeners: {} }] }, { xtype: 'label', id: 'alerttagihandpk', text: '', style: 'color: red;font-size:12px;', }, { xtype: 'button', text: 'Cetak Tagihan', iconCls: 'silk-printer', id: 'btn_ctk_tagih', disabled:true, width: 3, handler: function() { var win = window.open(); win.location.reload(); win.location = BASE_URL + 'print/cetak_tagihan/get_tagihan/' +Ext.getCmp('nim').getValue() +'/'+Ext.getCmp('thnakademikkrs').getValue() +'/'+Ext.getCmp('cb.semester').getValue(); } } ] }, { xtype: 'fieldset', title: 'Perwalian Online', id:'perwalian', height:100, items: [ { xtype: 'compositefield', fieldLabel: 'Dosen Wali', //labelStyle: 'width:160px', items: [{ xtype: 'textfield', id: 'nidu', anchor: '100%', readOnly: true//, //allowBlank: false },{ xtype: 'textfield', id: 'dosenwali', anchor: '100%', readOnly: true, //allowBlank: false },{ xtype: 'button', text: 'Pesan', //hidden:true, // iconCls: 'silk-find', id: 'btn_chat', width: 3, handler: function() { f_pesan(niduwali,Ext.getCmp('nim').getValue()); } }] },{ xtype: 'label', text: '', id: 'alertwali', style: 'color: red;font-size:12px;', } ] }] }] }], listeners: { afterrender: function() { awal(useridnya,(vkdstsemester) ? vkdstsemester:KDSTSEMESTER); } } }); var panelkrs = new Ext.Panel({ layout: 'border', defaults: { autoScroll:true, collapsible: true, split: true, bodyStyle: 'padding:15px' }, items: [{ collapsible: false, bodyStyle: 'padding:0px', region: 'center', id: 'images-view', frame: true, items: [form_bp_general] }, { bodyStyle: 'padding:0px', collapsible: true, region: 'east', minSize: 75, title: 'Informasi Mahasiswa', frame: true, width: 300, height:495, id: 'images-view2', items: [mhsDispPanel] }] }); get_content(panelkrs); //=========================================================================== function awal(userid,kdstsemester) { mhsDispPanel.getForm().load({ url: BASE_URL + 'e_akademic/c_karturencanastudi/form_mhs', params: { userid: userid, nama: USERNAME, kdstsemester: kdstsemester }, success: function(form, action) { ds_nya.setBaseParam('kdprodi', Ext.getCmp('kdprodi').getValue()); ds_nya.setBaseParam('idkelas', Ext.getCmp('idkelas').getValue()); ds_nya.setBaseParam('tahunmsk', Ext.getCmp('tahunmsk').getValue()); // ds_nya.setBaseParam('kdthnakademik', Ext.getCmp('kdthnakademik').getValue()); ds_nya.setBaseParam('nim', Ext.getCmp('nim').getValue()); ds_nya.setBaseParam('kdstsemester', kdstsemester); jadwalkrs(kdstsemester); mhs_foto_ori(Ext.getCmp("foto").getValue()); }, failure: function(form, action) { Ext.getCmp("btnsimpan").disable(); Ext.getCmp("btncetak").disable(); //Ext.MessageBox.alert('Failure', 'Fail to get data'); }, waitMsg: 'Loading..' }); } function jadwalkrs(kdstsemester) { var waitmsgloadjadwalkrs = Ext.MessageBox.wait('Loading Jadwal KRS...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/getjadwalkrs', method: 'POST', params: { kdprodi: Ext.getCmp('kdprodi').getValue(), kdstsemester: kdstsemester }, success: function(response) { waitmsgloadjadwalkrs.hide(); 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'; } }); } var labelalertjdwl = Ext.getCmp('alertjdwlkrs'); var statusjadwal = r.st; Ext.getCmp("tglawal").setValue(r.tglawal); Ext.getCmp("tglakhir").setValue(r.tglakhir); if (statusjadwal == '0') { labelalertjdwl.setText(r.statusperiode); validjadwalkrs = '0'; } else { labelalertjdwl.setText(""); validjadwalkrs = '1'; } Ext.getCmp("thnakademikkrs").setValue(kdstsemester); Ext.getCmp("thnakademikkrs").enable(); sistemkrs(kdstsemester); } }); } function sistemkrs(kdstsemester) { var waitmsgloadsistemkrs = Ext.MessageBox.wait('Loading Setting KRS...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/getsistemkrs', method: 'POST', params: { kdprodi: Ext.getCmp('kdprodi').getValue(), nim: Ext.getCmp('nim').getValue(), kdstsemester: kdstsemester }, success: function(response) { waitmsgloadsistemkrs.hide(); 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'; } }); } var labelalertsistemkrs = Ext.getCmp('alertsistemkrs'); statsistemkrs = r.stat; if (statsistemkrs == '0') { labelalertsistemkrs.setText('Sistem KRS Belum Di Setting'); Ext.getCmp("idsistemkrs").setValue(null); Ext.getCmp("sistemkrs").setValue(null); validsistemkrs = '0'; } else { labelalertsistemkrs.setText(""); Ext.getCmp("idsistemkrs").setValue(r.idsiskrs); Ext.getCmp("sistemkrs").setValue(r.nmsiskrs); validsistemkrs = '1'; } kelengkapan(kdstsemester); } }); } function kelengkapan(kdstsemester) { var labelalertidsemester = Ext.getCmp('alertidsemester'); var labelalertdosenwali = Ext.getCmp('alertwali'); var waitmsgloadkelengkapan = Ext.MessageBox.wait('Loading Kelengkapan Mahasiswa...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/kelengkapan', method: 'POST', params: { nim: Ext.getCmp('nim').getValue(), kdprodi: Ext.getCmp('kdprodi').getValue(), idklsmhs: Ext.getCmp('idklsmhs').getValue(), tahunmsk: Ext.getCmp('tahunmsk').getValue(), kdstsemester: kdstsemester }, 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'; } }); } waitmsgloadkelengkapan.hide(); semester = (r.idsemester) ? r.idsemester:null; dosenwalinya = r.dosenwali; persen = r.persen; persenadd = r.persenadd; mindpp = r.mindpp; niduwali = r.nidu; VALIDKRS = r.validkrs; Ext.getCmp("cb.semester").setValue(semester); Ext.getCmp("nidu").setValue(r.nidu); Ext.getCmp("dosenwali").setValue(dosenwalinya); Ext.getCmp("persen").setValue(parseInt(persen) +" %"); Ext.getCmp("persenopt").setValue(parseInt(persenadd) +" %"); // if(r.persen == "-" || r.persen > 100){ Ext.getCmp('stbayar').setValue("Overload!") }else{ if (r.persen == 100) { Ext.getCmp('stbayar').setValue('Lunas'); } else { Ext.getCmp('stbayar').setValue('Belum Lunas'); } } if(r.persenadd == "-" || r.persenadd > 100){ //Optional Ext.getCmp('stbayaropt').setValue("Overload!") }else{ if (r.persenadd == 100) { Ext.getCmp('stbayaropt').setValue('Lunas'); } else { Ext.getCmp('stbayaropt').setValue('Belum Lunas'); } } if (semester=='9') { mindpp = 100; //validasi spp semester 9 harus 100 % Ext.getCmp("persenopt").hide(); Ext.getCmp("stbayaropt").hide(); Ext.getCmp("persen").label.update('Persentase Pembayaran DP9'); Ext.getCmp("stbayar").label.update('Status Bayar DP9'); } else { Ext.getCmp("persenopt").show(); Ext.getCmp("stbayaropt").show(); Ext.getCmp("persen").label.update('Persentase Pembayaran DPP'); Ext.getCmp("stbayar").label.update('Status Bayar DPP'); } Ext.getCmp("ipsebelumsemester").setValue(r.ipksebelumnya); Ext.getCmp("jmlsksmin").setValue(r.minimalsks); Ext.getCmp("jmlsksmax").setValue(r.maksimalsks); if (!semester) { labelalertidsemester.setText("Semester Mahasiswa Belum di Setting"); validsemester = '0'; } else { labelalertidsemester.setText(""); validsemester = '1'; } if (Ext.getCmp('nidu').getValue()=="-"){ if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) Ext.getCmp("btn_chat").disable(); labelalertdosenwali.setText("Anda Belum Mendapatkan Dosen Wali"); validdosenwali = '0'; } else { Ext.getCmp("btn_chat").enable(); labelalertdosenwali.setText(""); validdosenwali = '1'; } } else { Ext.getCmp("btn_chat").enable(); labelalertdosenwali.setText(""); validdosenwali = '1'; } if (r.persen < mindpp){ //JIKA MINIMAL DPP BELUM TERPENUHI if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) if (r.persenadd == 100) { //JIKA DP9 SUDAH LUNAS Ext.getCmp('alertbayar').hide(); Ext.getCmp("alertbayar").setText(""); validpembayaran = '1'; validtagihandpp = '1'; validtagihandpk = '1'; Ext.getCmp('bayartagihan').hide(); Ext.getCmp('perwalian').show(); reload(); //LANGSUNG RELOAD DATA } else { Ext.getCmp('alertbayar').show(); Ext.getCmp("alertbayar").setText("Pembayaran Minimal "+ mindpp +" %"); validpembayaran = '0'; validtagihandpp = '1'; validtagihandpk = '1'; Ext.getCmp('bayartagihan').hide(); Ext.getCmp('perwalian').show(); } reload(); //LANGSUNG RELOAD DATA } else { Ext.getCmp('alertbayar').hide(); Ext.getCmp("alertbayar").setText(""); validpembayaran = '1'; Ext.getCmp('bayartagihan').show(); Ext.getCmp('perwalian').hide(); biayatagihandpp(kdstsemester); //CEK TAGIHAN DPP/DPK DULU } } else { //JIKA MINIMAL DPP SUDAH TERPENUHI if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) Ext.getCmp('alertbayar').hide(); Ext.getCmp("alertbayar").setText(""); validpembayaran = '1'; validtagihandpp = '1'; validtagihandpk = '1'; Ext.getCmp('bayartagihan').hide(); Ext.getCmp('perwalian').show(); reload(); //LANGSUNG RELOAD DATA } else { Ext.getCmp('alertbayar').hide(); Ext.getCmp("alertbayar").setText(""); validpembayaran = '1'; Ext.getCmp('bayartagihan').show(); Ext.getCmp('perwalian').hide(); biayatagihandpp(kdstsemester); //CEK TAGIHAN DPP/DPK DULU } } } }); } //============= function biayatagihandpp(kdstsemester) { var waitmsgloadbiayatagihan = Ext.MessageBox.wait('Loading Biaya Tagihan...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/get_biaya_dpp', method: 'POST', params: { nim: Ext.getCmp('nim').getValue(), kdprodi: Ext.getCmp('kdprodi').getValue(), idklsmhs: Ext.getCmp('idklsmhs').getValue(), tahunmsk: Ext.getCmp('tahunmsk').getValue(), idjnsbiaya : 1, kdstsemester: kdstsemester }, success: function(response) { waitmsgloadbiayatagihan.hide(); 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'; } }); } var labelalerttagihandpp = Ext.getCmp('alerttagihandpp'); var jsonData = Ext.decode(response.responseText); var biaya = jsonData.biaya - jsonData.diskon; var kuitansi = jsonData.kuitansi; var mintagihan = (jsonData.mintagihan == 0) ? 0:(biaya * jsonData.mintagihan) / 100; var bayar = jsonData.bayar; var novadpp = jsonData.novadpp; Ext.getCmp('biayatagihandpp').setValue(biaya); Ext.getCmp('mintagihandpp').setValue(mintagihan); if (bayar==0) { Ext.getCmp('dibayardpp').setValue(mintagihan); } else { Ext.getCmp('dibayardpp').setValue(bayar); } Ext.getCmp('noaccountdpp').setValue(novadpp); validtagihandpp = '1'; labelalerttagihandpp.setText(""); if (kuitansi == biaya) { labelalerttagihandpp.getEl().setStyle('color','blue'); labelalerttagihandpp.setText("Pembayaran DPP Sudah Lunas"); validlunasdpp = '1'; } else { if (biaya == 0 && mintagihan == 0) { labelalerttagihandpp.setText("Biaya Dan Min. Tagihan DPP Belum Di Setting"); validtagihandpp = '0'; } else { if (biaya == 0) { labelalerttagihandpp.setText("Biaya DPP Belum Di Setting"); validtagihandpp = '0'; } else if (mintagihan == 0) { labelalerttagihandpp.setText("Min. Tagihan DPP Belum Di Setting"); validtagihandpp = '0'; } } validlunasdpp = '0'; } biayatagihandpk(kdstsemester); } }); } function biayatagihandpk(kdstsemester) { var waitmsgloadbiayatagihan = Ext.MessageBox.wait('Loading Biaya Tagihan...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/get_biaya_dpk', method: 'POST', params: { nim: Ext.getCmp('nim').getValue(), kdprodi: Ext.getCmp('kdprodi').getValue(), idklsmhs: Ext.getCmp('idklsmhs').getValue(), tahunmsk: Ext.getCmp('tahunmsk').getValue(), idjnsbiaya : 2, semester: Ext.getCmp('cb.semester').getValue(), kdstsemester: kdstsemester }, success: function(response) { waitmsgloadbiayatagihan.hide(); 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'; } }); } var labelalerttagihandpk = Ext.getCmp('alerttagihandpk'); var jsonData = Ext.decode(response.responseText); var biaya = jsonData.biaya - jsonData.diskon; var kuitansi = jsonData.kuitansi; var mintagihan = jsonData.mintagihan; var bayar = jsonData.bayar; var novadpk = jsonData.novadpk; Ext.getCmp('biayatagihandpk').setValue(biaya); Ext.getCmp('mintagihandpk').setValue(mintagihan); //Ext.getCmp('mintagihandpk').setValue(bayar); if (bayar==0) { Ext.getCmp('dibayardpk').setValue(mintagihan); } else { Ext.getCmp('dibayardpk').setValue(bayar); } Ext.getCmp('noaccountdpk').setValue(novadpk); validtagihandpk = '1'; labelalerttagihandpk.setText(""); if (kuitansi == biaya) { labelalerttagihandpk.getEl().setStyle('color','blue'); labelalerttagihandpk.setText("Pembayaran DPK Sudah Lunas"); validlunasdpk = '1'; } else { if (biaya == 0 && mintagihan == 0) { labelalerttagihandpk.getEl().setStyle('color','red'); labelalerttagihandpk.setText("Biaya Dan Min. Tagihan DPK Belum Di Setting"); validtagihandpk = '0'; } else { if (biaya == 0) { labelalerttagihandpk.getEl().setStyle('color','red'); labelalerttagihandpk.setText("Biaya DPK Belum Di Setting"); validtagihandpk = '0'; } else if (mintagihan == 0) { labelalerttagihandpk.getEl().setStyle('color','red'); labelalerttagihandpk.setText("Min. Tagihan DPK Belum Di Setting"); validtagihandpk = '0'; } } validlunasdpk = '0'; } reload(); } }); } //============= function reload() { ds_nya.load({ scope : this, callback: function(records, operation, success) { jumlahsksnya = 0; jumlahambilnya = 0; ds_nya.each(function (rec) { if (rec.get('ambilval') == true){ jumlahsksnya += parseFloat(rec.get('jmlsks')); } if (rec.get('idstkrs') == '1'){ jumlahambilnya += parseFloat(rec.get('jmlsks')); } }); Ext.getCmp('jmlsks2').setValue(jumlahsksnya); Ext.getCmp('jmlskssetuju').setValue(jumlahambilnya); if (titley == 'KRS ONLINE') { get_sksambil(); } else if (titley == 'PERIKSA KRS') { get_skssetuju(); } } }); if (validtagihandpp == '1' && validtagihandpk == '1') { Ext.getCmp("btn_ctk_tagih").enable(); } else { Ext.getCmp("btn_ctk_tagih").disable(); } } function get_sksambil() { var sksambil =0, rowData, min, maks,countambil, sign =0; var labelalertsks = Ext.getCmp('alertsks'); grid_nya.getStore().each(function(rec){ rowData = rec.data; if (rowData['ambilval']) { sksambil += parseFloat(rowData['jmlsks']); } }); Ext.getCmp('jmlsks2').setValue(sksambil); min = parseInt(Ext.getCmp('jmlsksmin').getValue()); maks = parseInt(Ext.getCmp('jmlsksmax').getValue()); countambil = parseInt(Ext.getCmp('jmlsks2').getValue()); validsksambil = '1'; labelalertsks.setText(""); /* if (countambil < min) { TIDAK ADA BATAS MINIMAL SKS labelalertsks.setText("Jumlah SKS yang diambil kurang dari Jumlah Minimal SKS"); Ext.getCmp("btnsimpan").disable(); Ext.getCmp("btncetak").disable(); } else */if (countambil > maks) { labelalertsks.setText("Jumlah SKS yang diambil melebihi Jumlah Maksimal SKS"); validsksambil = '0'; } else { labelalertsks.setText(""); validsksambil = '1'; } if (validjadwalkrs == '1' && validsistemkrs == '1' && validsemester == '1' && validdosenwali == '1' && validpembayaran == '1' && validtagihandpp == '1' && validtagihandpk == '1' && validsksambil == '1') { Ext.getCmp("btnsimpan").enable(); Ext.getCmp("btncetak").enable(); } else { Ext.getCmp("btnsimpan").disable(); Ext.getCmp("btncetak").disable(); } //alert(validjadwalkrs + validsistemkrs + validsemester + validdosenwali + validpembayaran + validtagihandpp + validtagihandpk + validsksambil); } function get_skssetuju() { var skssetuju =0, rowData, min, maks, countsetuju, sign =0; var labelalertsks = Ext.getCmp('alertsks'); grid_nya.getStore().each(function(rec){ rowData = rec.data; if (rowData['setujuval']) { skssetuju += parseFloat(rowData['jmlsks']); } }); Ext.getCmp('jmlskssetuju').setValue(skssetuju); min = parseInt(Ext.getCmp('jmlsksmin').getValue()); maks = parseInt(Ext.getCmp('jmlsksmax').getValue()); countsetuju = parseInt(Ext.getCmp('jmlskssetuju').getValue()); validskssetuju = '1'; labelalertsks.setText(""); /* if (countsetuju < min) { TIDAK ADA BATAS MINIMAL SKS labelalertsks.setText("Jumlah SKS yang disetujui kurang dari Jumlah Minimal SKS"); Ext.getCmp("btnsimpan").disable(); Ext.getCmp("btncetak").disable(); } else */if (countsetuju > maks) { labelalertsks.setText("Jumlah SKS yang disetujui melebihi Jumlah Maksimal SKS"); validskssetuju = '0'; } else { labelalertsks.setText(""); validskssetuju = '1'; } if (validjadwalkrs == '1' && validsistemkrs == '1' && validsemester == '1' && validdosenwali == '1' && validpembayaran == '1' && validtagihandpp == '1' && validtagihandpk == '1' && validskssetuju == '1') { Ext.getCmp("btnsimpan").enable(); Ext.getCmp("btncetak").enable(); } else { Ext.getCmp("btnsimpan").disable(); Ext.getCmp("btncetak").disable(); } } //====================================AMBIL================================================ function simpanambil(){ var siskrs = Ext.getCmp('idsistemkrs').getValue(); var var_ambil, fn_ambil, validpengajar=0, validsyarat=0; if (siskrs == '2') { var_ambil = get_ambil_sks(); fn_ambil = 'simpanambilsks'; } else if (siskrs == '1') { var_ambil = get_ambil_paket(); fn_ambil = 'simpanambilpaket'; //cek pengajar grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record if (rowData['nidupengajar'] != '-') { validpengajar = validpengajar + 1; } if (rowData['ketsyaratmk'] != 'Tidak Lulus Syarat') { validsyarat = validsyarat + 1; } }); if (validpengajar != grid_nya.getStore().getCount()) { Ext.MessageBox.alert("Informasi", "Dosen Pengajar Belum Lengkap"); return; } if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) if (validsyarat != grid_nya.getStore().getCount()) { Ext.MessageBox.alert("Informasi", "Syarat Matakuliah Belum Lengkap Terpenuhi"); return; } } /* console.log(validpengajar + ' - ' + grid_nya.getStore().getCount()); console.log(validsyarat + ' - ' + grid_nya.getStore().getCount()); return; */ // end cek pengajar } if (VALIDKRS == '0') { //VALIDASI KRS (1=Ya, 0=Tidak) if (validlunasdpp == '0') { if (!Ext.getCmp("dibayardpp").getValue()) { Ext.MessageBox.alert("Informasi", "Silahkan Isi Tagihan Pembayaran DPP"); return; } else { if (Ext.getCmp("dibayardpp").getValue() < Ext.getCmp("mintagihandpp").getValue()) { Ext.MessageBox.alert("Informasi", "Pembayaran DPP Tidak Boleh Kurang Dari Min. Tagihan"); return; } } } if (validlunasdpk == '0') { if (!Ext.getCmp("dibayardpk").getValue()) { Ext.MessageBox.alert("Informasi", "Silahkan Isi Tagihan Pembayaran DPK"); return; } else { if (Ext.getCmp("dibayardpk").getValue() < Ext.getCmp("mintagihandpk").getValue()) { Ext.MessageBox.alert("Informasi", "Pembayaran DPK Tidak Boleh Kurang Dari Min. Tagihan"); return; } } } } var waitmsgloadsimpanambil = Ext.MessageBox.wait('Menyimpan KRS...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/' + fn_ambil, params: { par_ambil: var_ambil, biayatagihandpp:Ext.getCmp("biayatagihandpp").getValue(), mintagihandpp:Ext.getCmp("mintagihandpp").getValue(), dibayardpp:Ext.getCmp("dibayardpp").getValue(), biayatagihandpk:Ext.getCmp("biayatagihandpk").getValue(), mintagihandpk:Ext.getCmp("mintagihandpk").getValue(), dibayardpk:Ext.getCmp("dibayardpk").getValue(), validlunasdpp:validlunasdpp, validlunasdpk:validlunasdpk, validkrs:VALIDKRS }, success: function(response) { waitmsgloadsimpanambil.hide(); 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'; } }); } if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); } else { Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil, Silahkan Cetak Tagihan"); } reload(); }, failure: function() { waitmsgloadsimpanambil.hide(); Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); } function get_ambil_sks() { var par=''; var a= 1; var c = ';'; grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record var i = (rowData['ambilval']) ? 1 : 0; if (a == grid_nya.getStore().getCount()) { c = '' } par += Ext.getCmp('thnakademikkrs').getValue() +'x'+ Ext.getCmp('kdprodi').getValue() +'x'+ Ext.getCmp('nim').getValue() +'x'+ rowData['kdmk'] + 'x' + rowData['nidupengajar'] + 'x' + Ext.getCmp('nidu').getValue() +'x'+ i + 'x' + rowData['nilai'] + 'x' + Ext.getCmp('ipsebelumsemester').getValue() + 'x' + rowData['idkelaspengajar'] + 'x' + c; a= a+1; }); return par; } function get_ambil_paket() { var par=''; var a= 1; var c = ';'; grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record var i = (rowData['ambilval']) ? 1 : 0; if (a == grid_nya.getStore().getCount()) { c = '' } par += Ext.getCmp('thnakademikkrs').getValue() +'x'+ Ext.getCmp('kdprodi').getValue() +'x'+ Ext.getCmp('nim').getValue() +'x'+ rowData['kdmk'] + 'x' + rowData['nidupengajar'] + 'x' + Ext.getCmp('nidu').getValue() +'x'+ rowData['nilai'] + 'x' + Ext.getCmp('ipsebelumsemester').getValue() + 'x' + rowData['idkelaspengajar'] + 'x' + c; a= a+1; }); return par; } //====================================SETUJU================================================ function simpansetuju(){ var siskrs = Ext.getCmp('idsistemkrs').getValue(); var var_setuju, fn_setuju, cekpengajar, cekjadwal; if (siskrs == '2') { var_setuju = get_setuju_sks(); fn_setuju = 'simpansetujusks'; } else if (siskrs == '1') { var_setuju = get_setuju_paket(); fn_setuju = 'simpansetujupaket'; //cek pengajar grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record if (rowData['nidupengajar'] != '-') { validpengajar = validpengajar + 1; } if (rowData['ketsyaratmk'] != 'Tidak Lulus Syarat') { validsyarat = validsyarat + 1; } }); if (validpengajar != grid_nya.getStore().getCount()) { Ext.MessageBox.alert("Informasi", "Dosen Pengajar Belum Lengkap"); return; } if (VALIDKRS == '1') { //VALIDASI KRS (1=Ya, 0=Tidak) if (validsyarat != grid_nya.getStore().getCount()) { Ext.MessageBox.alert("Informasi", "Syarat Matakuliah Belum Lengkap Terpenuhi"); return; } } /* console.log(validpengajar + ' - ' + grid_nya.getStore().getCount()); console.log(validsyarat + ' - ' + grid_nya.getStore().getCount()); return; */ // end cek pengajar } var waitmsgloadsimpansetuju = Ext.MessageBox.wait('Menyimpan KRS...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/' + fn_setuju, params: { par_setuju: var_setuju }, 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'; } }); } waitmsgloadsimpansetuju.hide(); Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); reload(); }, failure: function() { waitmsgloadsimpansetuju.hide(); Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); } function get_setuju_sks() { var par=''; var a= 1; var c = ';'; grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record var i = (rowData['ambilval']) ? 1 : 0; var j = (rowData['setujuval']) ? 1 : 0; if (a == grid_nya.getStore().getCount()) { c = '' } par += Ext.getCmp('thnakademikkrs').getValue() +'x'+ Ext.getCmp('kdprodi').getValue() +'x'+ rowData['idkelaspengajar'] + 'x' + Ext.getCmp('nim').getValue() +'x'+ rowData['kdmk'] + 'x' + rowData['nidupengajar'] + 'x' + Ext.getCmp('nidu').getValue() +'x'+ i + 'x' + j + 'x' + rowData['nilai'] + 'x' + Ext.getCmp('ipsebelumsemester').getValue() + 'x' + c; a= a+1; }); return par; } function get_setuju_paket() { var par=''; var a= 1; var c = ';'; grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record var i = (rowData['ambilval']) ? 1 : 0; var j = (rowData['setujuval']) ? 1 : 0; if (a == grid_nya.getStore().getCount()) { c = '' } par += Ext.getCmp('thnakademikkrs').getValue() +'x'+ Ext.getCmp('kdprodi').getValue() +'x'+ rowData['idkelaspengajar'] + 'x' + Ext.getCmp('nim').getValue() +'x'+ rowData['kdmk'] + 'x' + rowData['nidupengajar'] + 'x' + Ext.getCmp('nidu').getValue() +'x'+ rowData['nilai'] + 'x' + Ext.getCmp('ipsebelumsemester').getValue() + 'x' + c; a= a+1; }); return par; } function batalsetuju(kdstsemester, kdprodi, idkelas, nim, kdmk, nidupengajar) { Ext.MessageBox.show({ title: "Konfirmasi", msg: "Anda Yakin Untuk Membatalkan Matakuliah Ini?", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_karturencanastudi/batalsetuju', params: { kdstsemester: kdstsemester, kdprodi : kdprodi, idkelas : idkelas, nim : nim, kdmk : kdmk, nidupengajar: nidupengajar }, 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.MessageBox.alert("Informasi", "Matakuliah Ini Berhasil Dibatalkan"); reload(); }, failure: function() { Ext.MessageBox.alert("Informasi", "Matakuliah Ini Gagal Dibatalkan"); } }); } } }); } //JADWAL MATAKULIAH function showJadwalMk(grid, rowIdx){ var record = ds_nya.getAt(rowIdx); var kdstawal = Ext.getCmp('kdstawalmhs').getValue(); var ganjilgenap = Ext.getCmp('thnakademikkrs').getValue().substr(4,1); //var hiddencol = (/* kdstawal=="P" && */ganjilgenap=="2") ? false:true; var hiddencol = (/* kdstawal=="P" && */ganjilgenap=="2") ? false:false; var ds_jadwalmk = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'e_akademic/c_karturencanastudi/gridjadwalmkklik', method: 'POST', 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'; } }); } } }), baseParams: { kdstsemester:Ext.getCmp('thnakademikkrs').getValue(), kdprodi :Ext.getCmp('kdprodi').getValue(), kdmk :record.data['kdmk'], nidu :record.data['nidupengajar'], idkelas :record.data['idkelaspengajar'], kdstawalmhs :kdstawal, ganjilgenap :ganjilgenap }, totalProperty: 'results', autoLoad : true, root: 'data', fields: [ { name: 'nmhari' } , { name: 'jam' } , { name: 'nmruangan' } , { name: 'nmkelas' } , { name: 'idkelas' } , { name: 'nidu' } , { name: 'nmdosdgngelar' } ] }); var cm_jadwalmk = new Ext.grid.ColumnModel({ columns: [ { xtype: 'actioncolumn', width: 50, header: '
Pilih
', align:'center', hidden:hiddencol, items: [{ getClass: function(v, meta, record) { meta.attr = "style='cursor:pointer;'"; }, icon : BASE_PATH+'/resources/img/icons/fam/accept.png', tooltip: 'Pilih Jadwal Kuliah', handler: function(grid, rowIndex) { var kelasnya = ds_jadwalmk.getAt(rowIndex); record.set('idkelaspengajar',kelasnya.get('idkelas')); record.set('nmkelaspengajar',kelasnya.get('nmkelas')); record.set('nidupengajar',kelasnya.get('nidu')); record.set('namapengajar',kelasnya.get('nmdosdgngelar')); wJadwalMk.close(); } }] }, { header: 'Hari', width: 80, dataIndex: 'nmhari', sortable: true }, { header: 'Jam', width: 120, dataIndex: 'jam', sortable: true }, { header: 'Ruangan', width: 200, dataIndex: 'nmruangan', sortable: true }, { header: 'Kelas', width: 200, dataIndex: 'nmkelas', sortable: true }, { header: 'Dosen Pengajar', width: 250, dataIndex: 'nmdosdgngelar', sortable: true }, { header: 'Keterangan', width: 100, hidden:hiddencol, dataIndex: 'idkelas', sortable: true, renderer: function(value, p, r) { if (value == Ext.getCmp('idkelas').getValue()){ return 'Kelas Utama'; } else { return 'Kelas Pilihan'; } } }] }); var gp_jadwalmk = new Ext.grid.GridPanel({ id: 'gp.jadwalmk', ds: ds_jadwalmk, cm: cm_jadwalmk, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), forceFit: true, frame:true, autoScroll: true, height: 195, autoWidth: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', clicksToEdit: 1, }); // -- FORM PANEL (DISPLAY) DETAIL JADWAL MK var fp_jadwalmk = new Ext.form.FormPanel({ id: 'fp.JMKshow', layout: 'form', forceFit: true, maskDisabled: false, monitorValid: true, autoScroll: true, margin: '0 0 10', frame: true, //defaults: { labelWidth: 250, labelAlign: 'right'}, items: [{ xtype: 'fieldset', items: [{ layout:'column', items:[{ columnWidth:.5, layout: 'form', items: [{ id: 'idnmmkind', fieldLabel: 'Kode Matakuliah', value:record.data['kdmk'], width: 325, xtype: 'textfield', readOnly:true, }] },{ columnWidth:.5, layout: 'form', items: [{ id: 'iddsn', fieldLabel: 'Nama Matakuliah', width: 325, value:record.data['nmmk'], xtype: 'textfield', readOnly:true, }] }] }] }, { items:[gp_jadwalmk], } ] }); var wJadwalMk = new Ext.Window({ title: 'Jadwal Matakuliah', modal: true, layout: 'fit', width:1050, height:300, items: [fp_jadwalmk] }).show(); } //SYARAT MATAKULIAH function showSyaratMk(grid, rowIdx){ var record = ds_nya.getAt(rowIdx); var ds_syaratmk = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'e_akademic/c_karturencanastudi/gridsyaratmkklik', method: 'POST', 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'; } }); } } }), baseParams: { idkurikulum:record.data['idkurikulum'], tahunmsk:record.data['tahunmsk'], nim:Ext.getCmp('nim').getValue(), }, totalProperty: 'results', autoLoad : true, root: 'data', fields: [ { name: 'kdmk' } , { name: 'nmmkind' } , { name: 'idsemester' } , { name: 'jmlsks' } , { name: 'nmlvlsyaratmk' } , { name: 'nilaihurufmin' } , { name: 'nilaihurufmhs' } , { name: 'keterangan' } ] }); var cm_syaratmk = new Ext.grid.ColumnModel({ columns: [ { header: 'Kode Matakuliah', width: 100, dataIndex: 'kdmk', sortable: true }, { header: 'Nama Matakuliah (Bahasa Indonesia)', width: 250, dataIndex: 'nmmkind', sortable: true }, { header: 'Semester', width: 70, dataIndex: 'idsemester', sortable: true }, { header: 'SKS', width: 40, align: 'center', dataIndex: 'jmlsks', sortable: true }, { header: 'Syarat Ke-', width: 80, align: 'center', dataIndex: 'nmlvlsyaratmk', sortable: true }, { header: 'Nilai Minimal', width: 80, dataIndex: 'nilaihurufmin', sortable: true }, { header: 'Nilai Mahasiswa', width: 100, align: 'center', dataIndex: 'nilaihurufmhs', sortable: true }, { header: 'Keterangan', width: 120, align: 'center', dataIndex: 'keterangan', sortable: true }] }); var gp_syaratmk = new Ext.grid.GridPanel({ id: 'gp.syaratmk', ds: ds_syaratmk, cm: cm_syaratmk, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), forceFit: true, frame:true, autoScroll: true, height: 195, width:870, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', clicksToEdit: 1, }); var wSyaratMk = new Ext.Window({ title: 'Syarat Matakuliah', modal: true, items: [gp_syaratmk] }).show(); } } //=========================SAMPLE CHECK COLUMN, JANGAN DI HAPUS================================ // Ext.ux.grid.CheckColumn = Ext.extend(Ext.grid.Column, { // // /** // * @private // * Process and refire events routed from the GridView's processEvent method. // */ // processEvent : function(name, e, grid, rowIndex, colIndex){ // if (name == 'mousedown') { // var record = grid.store.getAt(rowIndex); // record.set(this.dataIndex, !record.data[this.dataIndex]); // return false; // Cancel row selection. // } else { // return Ext.grid.ActionColumn.superclass.processEvent.apply(this, arguments); // } // }, // // renderer : function(v, p, record){ // p.css += ' x-grid3-check-col-td'; // return String.format('
 
', v ? '-on' : ''); // }, // // // Deprecate use as a plugin. Remove in 4.0 // init: Ext.emptyFn //}); // //// register ptype. Deprecate. Remove in 4.0 //Ext.preg('checkcolumn', Ext.ux.grid.CheckColumn); // //// backwards compat. Remove in 4.0 //Ext.grid.CheckColumn = Ext.ux.grid.CheckColumn; // //// register Column xtype //Ext.grid.Column.types.checkcolumn = Ext.ux.grid.CheckColumn; //=====================================================