function f_karturencanastudi(nimnya, titleyy) { var useridnya, titley, type, hidemhs, hidedosenwali, statusjadwal, semester, hidecari; var dosenwalinya, jumlahambilnya, jumlahsksnya, persen, statsistemkrs; var ds_stkrs = store_stkrs(); var ds_semester = store_semester_private(); var validjadwalkrs = '', validsistemkrs = '', validsemester = '', validdosenwali = '', validpembayaran = '', validsksambil = '', validskssetuju = ''; 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" }] }), 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: 'Kelas', anchor: '100%', readOnly: true, id: 'nmkelas' }, { xtype: 'textfield', fieldLabel: 'Tahun Akademik - Semester', anchor: '100%', readOnly: true, id: 'kdthnakademik' }, { xtype: 'label', text: 'Pembayaran Minimal 50 %', id: 'alertbayar', style: 'color: red;font-size:12px;', hidden:true }, { xtype: 'textfield', fieldLabel: 'Telah dibayar (Persentase)', anchor: '100%', readOnly: true, id: 'persen' }, { xtype: 'textfield', fieldLabel: 'Status Bayar', anchor: '100%', readOnly: true, id: 'stbayar' }, { 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 // }] }] }); 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, renderer: function(value) { Ext.QuickTips.init(); return '
' + value +'
'; } }, { 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: 'syaratmk', sortable: true }, { header: '
Dosen Pengajar
', width: 150, dataIndex: 'namapengajar', sortable: true }, { header: '
Kelas
', width: 100, dataIndex: 'nmkelaspengajar', sortable: true }, /* { 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 Ext.MessageBox.alert('Informasi', 'Matakuliah Ini Tidak Lulus Syarat Matakuliah'); } 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 Ext.MessageBox.alert('Informasi', 'Konfirmasi Dosen Wali Jika Ingin Membatalkan'); } else if (record.data['namapengajar'] == '-') { //jika dosen pengajar belum ada Ext.MessageBox.alert('Informasi', 'Dosen Pengajar Belum Ada'); } else if (record.data['jadwal'] == '-') { //jika jadwal kuliah belum ada Ext.MessageBox.alert('Informasi', 'Jadwal Kuliah Belum Ada'); } 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 Ext.MessageBox.alert('Informasi', 'Matakuliah Ini Tidak Lulus Syarat Matakuliah'); } if (record.data['idstkrs'] == '1') { //jika sudah disetujui //Ext.MessageBox.alert('Informasi', 'Matakuliah Sudah Disetujui'); batalsetuju( Ext.getCmp('kdstsemester').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['jadwal'] == '-') { //jika jadwal kuliah belum ada Ext.MessageBox.alert('Informasi', 'Jadwal Kuliah Belum Ada'); } else { record.set(this.dataIndex, !record.data[this.dataIndex]); } get_skssetuju(); } } } }, { header: '
Nilai
', width: 50, dataIndex: 'nilai', sortable: true }, { header: '
Keterangan
', width: 150, dataIndex: 'namaambil', sortable: true }, { header: '
Status
', width: 120, dataIndex: 'namasetuju', sortable: true } ] }); 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){ awal(Ext.getCmp('nimcari').getValue()); } }, { text: 'Cari Mahasiswa', id:'btncari', name:'btncari', iconCls: 'silk-find', hidden:hidecari, handler:function(){ wGridMhs('KRS'); } },{ text: 'Simpan', id:'btnsimpan', name:'btnsimpan', 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 parsing = ''; parsing = parsing + Ext.getCmp('nim').getValue() + '/' ; parsing = parsing + Ext.getCmp('kdprodi').getValue() + '/' ; parsing = parsing + Ext.getCmp('tahunmsk').getValue() + '/' ; parsing = parsing + KDSTSEMESTER + '/' ; parsing = parsing + Ext.getCmp('idkelas').getValue() + '/' ; parsing = parsing + Ext.getCmp('cb.semester').getValue() + '/' ; parsing = parsing + Ext.getCmp('nidu').getValue(); 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 == 'detjadwalkul') { showJadwalMk(grid, rowIndex); } }, //rowclick: showJadwalMk } }); 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: .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" }] } , { 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: '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); } } }); 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) { mhsDispPanel.getForm().load({ url: BASE_URL + 'e_akademic/c_karturencanastudi/form_mhs', params: { userid: userid, nama: USERNAME, kdstsemester: KDSTSEMESTER }, 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'; } }); } 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(); mhs_foto_ori(Ext.getCmp("foto").getValue()); }, failure: 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.getCmp("btnsimpan").disable();//Ext.MessageBox.alert('Failure', 'Fail to get data'); }, waitMsg: 'Loading..' }); } function jadwalkrs() { 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); Ext.getCmp("btnsimpan").disable(); validjadwalkrs = '0'; } else { labelalertjdwl.setText(""); Ext.getCmp("btnsimpan").enable(); validjadwalkrs = '1'; } sistemkrs(); } }); } function sistemkrs() { 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); Ext.getCmp("btnsimpan").disable(); validsistemkrs = '0'; } else { labelalertsistemkrs.setText(""); Ext.getCmp("idsistemkrs").setValue(r.idsiskrs); Ext.getCmp("sistemkrs").setValue(r.nmsiskrs); Ext.getCmp("btnsimpan").enable(); validsistemkrs = '1'; } kelengkapan(); } }); } function kelengkapan() { 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; niduwali = r.nidu; Ext.getCmp("cb.semester").setValue(semester); Ext.getCmp("nidu").setValue(r.nidu); Ext.getCmp("dosenwali").setValue(dosenwalinya); Ext.getCmp("persen").setValue(parseInt(persen) +" %"); // 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'); } } 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"); Ext.getCmp("btnsimpan").disable(); validsemester = '0'; } else { labelalertidsemester.setText(""); Ext.getCmp("btnsimpan").enable(); validsemester = '1'; } if (Ext.getCmp('nidu').getValue()=="-"){ Ext.getCmp("btnsimpan").disable(); Ext.getCmp("btn_chat").disable(); labelalertdosenwali.setText("Anda Belum Mendapatkan Dosen Wali"); validdosenwali = '0'; } else { Ext.getCmp("btnsimpan").enable(); Ext.getCmp("btn_chat").enable(); labelalertdosenwali.setText(""); validdosenwali = '1'; } if (r.persen < 50){ Ext.getCmp('alertbayar').show(); Ext.getCmp("btnsimpan").disable(); validpembayaran = '0'; } else { Ext.getCmp('alertbayar').hide(); Ext.getCmp("btnsimpan").enable(); validpembayaran = '1'; } 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(); } } }); } 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) { labelalertsks.setText("Jumlah SKS yang diambil kurang dari Jumlah Minimal SKS"); Ext.getCmp("btnsimpan").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' && validsksambil == '1') { Ext.getCmp("btnsimpan").enable(); } else { Ext.getCmp("btnsimpan").disable(); } } 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) { labelalertsks.setText("Jumlah SKS yang disetujui kurang dari Jumlah Minimal SKS"); Ext.getCmp("btnsimpan").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' && validskssetuju == '1') { Ext.getCmp("btnsimpan").enable(); } else { Ext.getCmp("btnsimpan").disable(); } } //====================================AMBIL================================================ function simpanambil(){ var siskrs = Ext.getCmp('idsistemkrs').getValue(); var var_ambil, fn_ambil, cekpengajar, cekjadwal; if (siskrs == '2') { var_ambil = get_ambil_sks(); fn_ambil = 'simpanambilsks'; } else if (siskrs == '1') { var_ambil = get_ambil_paket(); fn_ambil = 'simpanambilpaket'; //cek jadwal dan pengajar grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record cekpengajar = (rowData['nidupengajar'] != '-') ? rowData['nidupengajar']:false; cekjadwal = (rowData['jadwal'] != '-') ? rowData['jadwal']:false; }); if (!cekpengajar) { Ext.MessageBox.alert("Informasi", "Dosen Pengajar Belum Ada"); return; } if (!cekjadwal) { Ext.MessageBox.alert("Informasi", "Jadwal Kuliah Belum Ada"); return; } // end cek jadwal dan pengajar } 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, }, 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'; } }); } waitmsgloadsimpanambil.hide(); Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); 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('kdstsemester').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' + 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('kdstsemester').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' + 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 jadwal dan pengajar grid_nya.getStore().each(function(rec){ var rowData = rec.data; // get record cekpengajar = (rowData['nidupengajar'] != '-') ? rowData['nidupengajar']:false; cekjadwal = (rowData['jadwal'] != '-') ? rowData['jadwal']:false; }); if (!cekpengajar) { Ext.MessageBox.alert("Informasi", "Dosen Pengajar Belum Ada"); return; } if (!cekjadwal) { Ext.MessageBox.alert("Informasi", "Jadwal Kuliah Belum Ada"); return; } // end cek jadwal dan 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('kdstsemester').getValue() +'x'+ Ext.getCmp('kdprodi').getValue() +'x'+ Ext.getCmp('idkelas').getValue() +'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('kdstsemester').getValue() +'x'+ Ext.getCmp('kdprodi').getValue() +'x'+ Ext.getCmp('idkelas').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' + 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"); } }); } } }); } function showJadwalMk(grid, rowIdx){ var record = ds_nya.getAt(rowIdx); 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('kdstsemester').getValue(), kdprodi:Ext.getCmp('kdprodi').getValue(), kdmk:record.data['kdmk'], idkelas:Ext.getCmp('idkelas').getValue(), }, totalProperty: 'results', autoLoad : true, root: 'data', fields: [ { name: 'nmhari' } , { name: 'jam' } , { name: 'nmruangan' } , { name: 'nmkelas' } ] }); var cm_jadwalmk = new Ext.grid.ColumnModel({ columns: [ { header: 'Hari', width: 230, dataIndex: 'nmhari', sortable: true }, { header: 'Jam', width: 230, dataIndex: 'jam', sortable: true }, { header: 'Ruangan', width: 230, dataIndex: 'nmruangan', sortable: true }, { header: 'Kelas', width: 230, dataIndex: 'nmkelas', sortable: true }] }); 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, autoWidth: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', clicksToEdit: 1, height: 100, }); // -- 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: 'Nama Matakuliah', value:record.data['nmmk'], width: 325, xtype: 'textfield', readOnly:true, }] },{ columnWidth:.5, layout: 'form', items: [{ id: 'iddsn', fieldLabel: 'Dosen Pengajar', width: 325, value:record.data['namapengajar'], xtype: 'textfield', readOnly:true, }] }] }] }, { items:[gp_jadwalmk], } ] }); var wJadwalMk = new Ext.Window({ title: 'Jadwal Matakuliah', modal: true, layout: 'fit', width:1000, height:300, items: [fp_jadwalmk] }).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; //=====================================================