function fKonversi(isUpdate,grid,record,storesObj) { var ds_years = storesObj.years; var ds_stkonversi = storesObj.stkonversi; var ds_jenpdkpendaftar = storesObj.jenpdkpendaftar var ds_prodi = storesObj.prodi; var ds_nilai = storesObj.nilai; var disabletext = false ; if(isUpdate){ disabletext = (record.data['idstkonversi']=='2') ? true:false; } var reader_matkul_kurikulum = new Ext.data.JsonReader({ root:'data', idProperty: '', totalProperty: 'results', remoteGroup: true, fields: [ { name: 'kdprodi' } , { name: 'kdmk' } , { name: 'nmmkind' } , { name: 'idsemester' } , { name: 'idsemesternya' } , { name: 'jmlsks' } , { name: 'nmmkasal' } , { name: 'sksasal' } , { name: 'nilaiasal' } , { name: 'nilaidiakui' } , { name: 'countnilai' } , { name: 'kdstsemester' } , { name: 'pilihmk' ,type:'bool'} ] }); var ds_matkul_kurikulum = new Ext.data.GroupingStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'konversi_controller/get_matkul_kurikulum', method: 'POST', }), reader: reader_matkul_kurikulum, groupField:'idsemesternya', remoteSort: true, }); var cm_matkul_kurikulum = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer({width: 40, align: 'center',}), { header: '
Kode
', width: 75, dataIndex: 'kdmk', align: 'center', sortable: true }, { header: '
Mata Kuliah UNLA
', width: 300, dataIndex: 'nmmkind', sortable: true, /* editor: { xtype: 'textfield', id: 'nmmkind', name: 'nmmkind', readOnly: true, } */ }, { header: '
SKS
', width: 50, dataIndex: 'jmlsks', align: 'center', sortable: true }, { xtype: 'actioncolumn', width: 50, header: '
', align:'center', items: [{ getClass: function(v, meta, record) { meta.attr = "style='cursor:pointer;'"; }, icon : 'resources/img/icons/fam/page_copy.png', tooltip: 'Copy Nama Matakuliah', handler: function(grid, rowIndex) { if(isUpdate){ if (record.data['idstkonversi']=='2') { return; } } var rec = ds_matkul_kurikulum.getAt(rowIndex); if (!rec.get('nmmkasal')) { rec.set('nmmkasal',rec.get('nmmkind')); } } }] }, { header: '
idsemester
', width: 300, dataIndex: 'idsemesternya', align: 'center', sortable: true }, { header: '
Mata Kuliah PTS Asal
', width: 300, dataIndex: 'nmmkasal', sortable: true, editor: { xtype: 'textfield', id: 'nmmkasal', name: 'nmmkasal', disabled: disabletext } }, { header: '
SKSA
', width: 50, dataIndex: 'sksasal', sortable: true, align: 'center', editor: { xtype: 'numberfield', id: 'sksasal', name: 'sksasal', disabled: disabletext, listeners: { 'change': function(field, newVal, oldVal){ if(newVal) { } } } } }, { header: '
Nilai Asal
', width: 100, dataIndex: 'nilaiasal', sortable: true, align: 'center', editor: { xtype: 'textfield', id: 'nilaiasal', name: 'nilaiasal', disabled: disabletext } }, { header: '
Nilai Diakui
', width: 100, dataIndex: 'nilaidiakui', sortable: true, align: 'center', editor: { xtype: 'combo', id: 'nilaidiakui', fieldLabel: '', store: ds_nilai, triggerAction: 'all', width: 100, valueField: 'nilaihuruf', displayField: 'nilaihuruf', editable: false, forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:true, allowBlank: true, disabled: disabletext, listeners:{ scope: this, 'select': function(){ } } } }, { header: '
Keterangan
', width: 110, dataIndex: 'countnilai', align: 'center', renderer:render_countnilai, sortable: true }, { xtype: 'checkcolumn', header: '
Pilih
', width: 100, dataIndex: 'pilihmk', sortable: true, processEvent : function(name, e, grid, rowIndex, colIndex){ var rec = grid.store.getAt(rowIndex); if (isUpdate) { if (record.data['idstkonversi']=='2') { return; } } else { if (Ext.getCmp('cb.stkonversi').getValue() == '2') { return; } } if (!rec.data['nmmkasal']) { return; } if (!rec.data['sksasal']) { return; } if (!rec.data['nilaiasal']) { return; } if (!rec.data['nilaidiakui']) { return; } if (rec.data['countnilai']>0) { return; } rec.set(this.dataIndex, !rec.data[this.dataIndex]); get_checklist(); } },{ header: '
T.A - Semester
', width: 110, dataIndex: 'kdstsemester', align: 'kdstsemester', hidden: true, sortable: true },{ xtype: 'actioncolumn', width: 50, header: '
', align:'center', items: [{ getClass: function(v, meta, record) { meta.attr = "style='cursor:pointer;'"; }, icon : 'resources/img/icons/fam/cancel.png', tooltip: 'Batal', handler: function(grid, rowIndex) { var rec = ds_matkul_kurikulum.getAt(rowIndex); var params = new Object({ idkn : record.data['idkn'], kdprodi : record.data['kdprodi'], kdmk : rec.get('kdmk'), kdstsemester : rec.get('kdstsemester') }); Ext.Msg.show({ title: 'Konfirmasi', msg: 'Hapus data yang dipilih?', buttons: Ext.Msg.YESNO, icon: Ext.MessageBox.QUESTION, fn: function (response) { if ('yes' !== response) { return; } Ext.Ajax.request({ url: BASE_URL + 'konversi_controller/delete_konversidet', method: 'POST', params: params, success: function() { Ext.Msg.alert("Info", "Hapus Data Berhasil"); g_matkul_kurikulum.getStore().reload(); }, failure: function(result){ Ext.MessageBox.alert("Info", "Hapus Data Gagal"); } }); } }); } }] } ]); var sm_matkul_kurikulum = new Ext.grid.CheckboxSelectionModel({ listeners: {} }); var cari_matkul_kurikulum = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var g_matkul_kurikulum = new Ext.grid.EditorGridPanel({ //title: 'Daftar Matakuliah', plugins: cari_matkul_kurikulum, ds: ds_matkul_kurikulum, cm: cm_matkul_kurikulum, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GroupingView({ forceFit:true, groupTextTpl: '{text} ({[values.rs.length]} {["Mata Kuliah"]})', 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 }), clicksToEdit: 1, //for cell editing (single click =1, dblclick=2) forceFit: true, //autoHeight: true, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, frame: true, layout: 'anchor', tbar:[{ text: 'Simpan', id:'bt.save-kon', iconCls: 'silk-save', handler: function() { if (!isUpdate) { fnSimpanKonversi(); } else if (Ext.getCmp('cb.stkonversi').getValue() == '1' && isUpdate) { fnUpdateKonversi(); } else if (Ext.getCmp('cb.stkonversi').getValue() == '2' && isUpdate) { fnBatalKonversi(); } } } , { text: 'Cetak', iconCls: 'silk-printer', id:'bt.cetak-kon', disabled: true, handler: function() { var idkn = record.data['idkn']; var kdprodi = record.data['kdprodi']; var tahun = record.data['tahun']; var sksunla = Ext.getCmp('sksunla').getValue(); var skskonversi = Ext.getCmp('skskonversi').getValue(); var skstempuh = Ext.getCmp('skstempuh').getValue(); var ipkkonversi = Ext.getCmp('ipkkonversi').getValue(); RH.ShowReport(BASE_URL + 'rpt/rpt_konversi/get_konversi/' +idkn+'/'+kdprodi+'/'+tahun +'/'+sksunla+'/'+skskonversi+'/'+skstempuh+'/'+ipkkonversi); } } , { text: 'Insert Konversi Ke Nilai', id:'bt.kon-nilai',iconCls: 'silk-page-copy', disabled:true, hidden:false, handler: function(){ fnCheckBayarKonversi(Ext.getCmp('tf.nim').getValue()); } }, { text: 'Kembali', id:'bt.back-kon',iconCls: 'silk-arrow-undo', disabled:false, handler: function(){ win_fkonversi.close(); } },'->'], }); function render_countnilai(val) { Ext.QuickTips.init(); if (val==0) { return 'Belum Ambil ' + ''; } else { return 'Sudah Ambil ' + ''; } } var formKonversi = new Ext.Panel({ //title: 'Konversi Nilai', id: 'fKonversi', layout: 'anchor', forceFit: true, maskDisabled: false, monitorValid: true, autoScroll: true, margin: '0 0 0', frame: true, xtype: 'form', defaults: { labelWidth: 115, labelAlign: 'right'}, items: [RH.vSpacer(5), { layout: 'column', border: false, items: [{ columnWidth: .50, border: false, layout: 'form', bodyStyle: 'padding:0px 0px 0px 0px', // atas, kanan, bawah, kiri defaults: { labelWidth: 135, labelAlign: 'right' }, items: [{ xtype: 'fieldset', title: 'Program Studi Baru', items: [{ xtype: 'combo', id: 'cb.prodi', fieldLabel: 'Program Studi', store: ds_prodi, valueField: 'kdprodi', displayField: 'lnmprodi', triggerAction: 'all',editable: false, width: 350, forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:true, allowBlank: false, listeners:{ scope: this, 'select': function(combo, record){ var field = combo.getId(); var value = ''; Ext.getCmp("nidukajur").setValue(record.data['nidu']); Ext.getCmp("kajur").setValue(record.data['nmdosdgngelar']); reload_matkul_kurikulum(''); } } }, { xtype: 'combo', id: 'cb.thmasuk', fieldLabel: 'Tahun Masuk/Angkatan', store: ds_years, triggerAction: 'all', width: 100, valueField: 'kode', displayField: 'nama', editable: false, forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:true, allowBlank: false, listeners:{ scope: this, 'select': function(){ reload_matkul_kurikulum(''); } } }, { xtype: 'compositefield', name: 'comp_mhs', fieldLabel: 'NPM', id: 'comp_mhs', items: [{ xtype: 'textfield', id: 'tf.nim', disabled: true, width: 200, allowBlank: false, listeners: { 'render': function(c) { c.getEl().on('keypress', function(e) { if (e.getKey() == 13) Ext.getCmp('btn_simpan_product').focus(); }, c); } } }] }, { xtype: 'textfield', fieldLabel: 'Nama Mahasiswa', id: 'tf.namamhs', disabled: true, width: 350 }, { xtype: 'combo', id: 'cb.stkonversi', fieldLabel: 'Status Konversi', store:ds_stkonversi, triggerAction: 'all', width: 350, valueField: 'idstkonversi', displayField: 'nmstkonversi', forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', selectOnFocus:true, editable: false, listeners:{ scope: this, 'select': function(){ } } }, { xtype: 'compositefield', name: 'comp_usertgl', fieldLabel: 'User Input/Tgl. Input', id: 'comp_usertgl', items: [{ xtype: 'textfield', fieldLabel: '', id: 'useridinput', disabled:true, hidden:true, width: 200, value:USERID, listeners: {} },{ xtype: 'textfield', fieldLabel: '', id: 'usernameinput', disabled:true, width: 245, value:USERNAME, listeners: {} }, { xtype: 'datefield', fieldLabel: '', id: 'tglkonversi', width: 100, disabled:true, readOnly:true, name: 'tglkonversi', value: new Date() }] } ] }] }, { columnWidth: .50, border: false, layout: 'form', bodyStyle: 'padding:0px 0px 0px 0px', // atas, kanan, bawah, kiri defaults: { labelWidth: 150, labelAlign: 'right' }, items: [{ xtype: 'fieldset', title: 'Program Studi Asal/Pindahan', items: [{ xtype: 'compositefield', name: 'comp_pmb', fieldLabel: 'No PMB', id: 'comp_pmb', items: [{ id: 'tf.nopmb', xtype:'textfield', fieldLabel: 'No PMB', width: 145, allowBlank: false, disabled: true, }, { xtype: 'button', fieldLabel: 'Cari', labelStyle: 'width:160px', id: 'btncari', iconCls: 'silk-find', name: 'btncari', width: 3, handler: function(){ wLookupPindahan(); } } ] }, { xtype: 'textfield', fieldLabel: 'Nama Pendaftar', id: 'tf.namapendftr', disabled: true, width: 350 }, { xtype: 'textfield', fieldLabel: '', id: 'tf.idptpts', disabled: true, hidden: true, width: 350 }, { xtype: 'textfield', fieldLabel: 'PT/PTS', id: 'tf.ptpts', disabled: true, width: 350 }, { xtype: 'textfield', fieldLabel: '', id: 'tf.kdprodijur', disabled: true, hidden: true, width: 350 }, { xtype: 'textfield', fieldLabel: 'Program Studi/Jurusan', id: 'tf.prodijur', disabled: true, width: 350 }, { xtype: 'textfield', fieldLabel: '', id: 'tf.kdjenjstudi', disabled: true, hidden: true, width: 350 }, { xtype: 'textfield', fieldLabel: 'Jenjang Studi', id: 'tf.jenjstudi', disabled: true, width: 350 }, { xtype: 'compositefield', name: 'comp_ijazah', fieldLabel: 'No/Tanggal Ijazah', id: 'comp_ijazah', items: [{ xtype: 'textfield', fieldLabel: '', id: 'noijazah', disabled:true, width: 245, listeners: {} }, { xtype: 'datefield', fieldLabel: '', id: 'tglijazah', width: 100, disabled:true, readOnly:true, name: 'tglijazah', value: new Date() }] } ] }] }] }, { border: false, layout:'column', region: 'center', items: [{ columnWidth: 1, border: false, layout: 'fit', bodyStyle: 'padding:0px 0px 0px 0px', // atas, kanan, bawah, kiri items: [{ xtype: 'fieldset', id:'fs.kon_nilai', height: 250, layout:'fit', title: 'Konversi Nilai', items: [g_matkul_kurikulum] }] }] }, RH.vSpacer(10), { layout: 'column', border: false, items: [{ columnWidth: .40, border: false, layout: 'form', bodyStyle: 'padding:0px 0px 0px 0px', // atas, kanan, bawah, kiri defaults: { labelWidth: 250, labelAlign: 'right' }, items: [{ xtype: 'fieldset', title: 'Total', items: [{ id: 'sksunla', xtype:'textfield', fieldLabel: 'JUMLAH SKS UNLA', width: 145, disabled: true, }, { id: 'skskonversi', xtype:'textfield', fieldLabel: 'JUMLAH SKS YANG DIKONVERSI/DIAKUI', width: 145, disabled: true, }, { id: 'skstempuh', xtype:'textfield', fieldLabel: 'JUMLAH SKS YANG HARUS DI TEMPUH', width: 145, disabled: true, }, { id: 'ipkkonversi', xtype:'textfield', fieldLabel: 'IPK SKS YANG DIAKUI', width: 145, disabled: true, }, ] }] }, { columnWidth: .60, border: false, layout: 'form', bodyStyle: 'padding:0px 0px 0px 0px', // atas, kanan, bawah, kiri items: [{ xtype: 'fieldset', title: 'Keterangan', items: [{ id: 'keterangan', xtype:'textarea', anchor:'99%', width: 145, }, { xtype: 'compositefield', name: 'comp_ket', fieldLabel: 'Ketua Jurusan/
Pengkonversi', id: 'comp_ket', items: [{ xtype: 'textfield', fieldLabel: '', id: 'nidukajur', hidden:true, width: 200, listeners: {} },{ xtype: 'textfield', fieldLabel: '', id: 'kajur', disabled:true, width: 200, listeners: {} },{ xtype: 'textfield', fieldLabel: '', id: 'konverterhide', hidden:true, width: 200, value:USERID, listeners: {} },{ xtype: 'textfield', fieldLabel: '', id: 'konverter', disabled:true, width: 245, value:USERNAME, listeners: {} }] } ] }] }] } ] }); var win_fkonversi = new Ext.Window({ title: (isUpdate) ? 'Konversi Nilai (Edit)':'Konversi Nilai (Entry)', modal: true, layout: 'fit', items: [formKonversi], resizable: false, draggable: false, height: 600, width: 1250, }).show(); Ext.getCmp('cb.prodi').disable(); Ext.getCmp('cb.thmasuk').disable(); Ext.getCmp('cb.stkonversi').disable(); if (isUpdate) { //jika sudah konversi Ext.getCmp('tf.nim').setValue(record.data['nim']); Ext.getCmp('tf.namamhs').setValue(record.data['nmmhs']); Ext.getCmp('cb.prodi').setValue(record.data['kdprodi']); Ext.getCmp('cb.thmasuk').setValue(record.data['tahun']); Ext.getCmp('cb.stkonversi').setValue(record.data['idstkonversi']); Ext.getCmp('useridinput').setValue(record.data['userid']); Ext.getCmp('usernameinput').setValue(record.data['nmuserinput']) Ext.getCmp('tglkonversi').setValue(record.data['tglkn']); var nidukajurnya = RH.getRecordFieldValue(ds_prodi, 'nidu', 'kdprodi', record.data['kdprodi']); var kajurnya = RH.getRecordFieldValue(ds_prodi, 'nmdosdgngelar', 'kdprodi', record.data['kdprodi']); Ext.getCmp('nidukajur').setValue(nidukajurnya); Ext.getCmp('kajur').setValue(kajurnya); Ext.getCmp('keterangan').setValue(record.data['keterangan']); Ext.getCmp('konverterhide').setValue(record.data['pengkonversi']); Ext.getCmp('konverter').setValue(record.data['nmpengkonversi']); Ext.getCmp('tf.nopmb').setValue(record.data['nopmb']); Ext.getCmp('tf.namapendftr').setValue(record.data['nmpendaftar']); Ext.getCmp('tf.idptpts').setValue(record.data['kdptasal']); Ext.getCmp('tf.ptpts').setValue(record.data['nmptasal']); Ext.getCmp('tf.kdprodijur').setValue(record.data['kdprodiasal']); Ext.getCmp('tf.prodijur').setValue(record.data['nmprodiasal']); Ext.getCmp('tf.kdjenjstudi').setValue(record.data['kdjenjangstudiasal']); //var nmjenjangstudiasal = RH.getRecordFieldValue(ds_jenpdkpendaftar, 'nmjenpdkpendaftar', 'idjenpdkpendaftar', record.data['kdjenjangstudiasal']); Ext.getCmp('tf.jenjstudi').setValue(record.data['nmjenjangstudiasal']); Ext.getCmp('noijazah').setValue(record.data['noijazahasal']); Ext.getCmp('tglijazah').setValue(record.data['tglijazahasal']); reload_matkul_kurikulum(record.data['idkn']); Ext.getCmp('btncari').disable(); if (record.data['idstkonversi']=='2') { Ext.getCmp('bt.save-kon').disable(); Ext.getCmp('bt.cetak-kon').disable(); Ext.getCmp('bt.kon-nilai').disable(); Ext.getCmp('cb.stkonversi').disable(); } } else { Ext.getCmp('bt.save-kon').enable(); } //====================================================LOOKUP MHS PINDAHAN================================================ function wLookupPindahan(){ fields_pindahan = RH.storeFields('nopmb','nama','kdptasal','nmptasal','kdprodi','kdprodi1','kdprodi2','nmprodi', 'idjenpdkpendaftar','nmjenpdkpendaftar','noijazalasal','tglijazahasal','nim','thnmasuk'); var ds_pindahan = RH.JsonStore({ url : BASE_URL + 'konversi_controller/get_lookup_mhs_pindahan', fields : fields_pindahan, limit:20, enableSearch: true, }); var cm_pindahan = new Ext.grid.ColumnModel([{ header: 'No PMB', width: 100, dataIndex: 'nopmb', sortable: true }, { header: 'Nama Mahasiswa', width: 130, dataIndex: 'nama', sortable: true }, { header: 'PT/PTS', width: 130, dataIndex: 'nmptasal', sortable: true }, { header: 'Program Studi', width: 130, dataIndex: 'nmprodi', sortable: true }, { header: 'Jenjang Studi', width: 130, dataIndex: 'nmjenpdkpendaftar', sortable: true }, { header: 'No. Ijazah', width: 130, dataIndex: 'noijazalasal', sortable: true }, { header: 'Tanggal Ijazah', width: 130, dataIndex: 'tglijazahasal', sortable: true }, { header: 'NPM', width: 100, dataIndex: 'nim', sortable: true }, { header: 'Tahun Masuk', width: 100, dataIndex: 'thnmasuk', sortable: true }] ); var sm_pindahan = new Ext.grid.RowSelectionModel({ singleSelect: true }); var gv_pindahan = new Ext.grid.GridView({ emptyText: '< Belum ada Data >' }); //SEARCH COMPONENT var sb_pindahan = RH.searchComp({ id : 'sb_pindahan', fields : ['nopmb:No. PMB','nim:NPM','nama:Nama Mahasiswa','thnmasuk:Tahun Masuk','nmptasal:PT/PTS','nmprodi:Program Studi','nmjenpdkpendaftar:Jenjang Studi'], selected : 'nopmb', store : ds_pindahan }); //GRID PANEL var gp_pindahan = new Ext.grid.GridPanel({ ds: ds_pindahan, cm: cm_pindahan, sm: sm_pindahan, view: gv_pindahan, forceFit: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, //buttonAlign: 'left', layout: 'anchor', anchorSize: {//width: 400,//height: 300 }, tbar:[sb_pindahan], bbar: new Ext.PagingToolbar({ store: ds_pindahan, pageSize: 20, displayInfo: true, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data", }), listeners: { rowclick: rowLookupclick } }); var win_pindahan = new Ext.Window({ title: 'Daftar Mahasiswa Pindahan', modal: true, layout: 'fit', items: [gp_pindahan], height: 400, width: 1120, }).show(); function rowLookupclick(grid, rowIdx) { var rec = ds_pindahan.getAt(rowIdx); var waitmsg = Ext.MessageBox.wait('Loading...', 'Info'); Ext.getCmp('cb.prodi').setValue(null); ds_prodi.setBaseParam('kdprodi1', rec.data['kdprodi1']); ds_prodi.setBaseParam('kdprodi2', rec.data['kdprodi2']); ds_prodi.load({ scope : this, callback: function(records, operation, success) { ds_prodi.each(function (rec) { Ext.getCmp('cb.prodi').setValue(rec.get('kdprodi')); }); Ext.getCmp('tf.nim').setValue(rec.data['nim']); Ext.getCmp('tf.namamhs').setValue(rec.data['nama']); Ext.getCmp('tf.nopmb').setValue(rec.data['nopmb']); Ext.getCmp('tf.namapendftr').setValue(rec.data['nama']); Ext.getCmp('tf.idptpts').setValue(rec.data['kdptasal']); Ext.getCmp('tf.ptpts').setValue(rec.data['nmptasal']); Ext.getCmp('tf.kdprodijur').setValue(rec.data['kdprodi']); Ext.getCmp('tf.prodijur').setValue(rec.data['nmprodi']); Ext.getCmp('tf.kdjenjstudi').setValue(rec.data['idjenpdkpendaftar']); Ext.getCmp('tf.jenjstudi').setValue(rec.data['nmjenpdkpendaftar']); Ext.getCmp('noijazah').setValue(rec.data['noijazalasal']); Ext.getCmp('tglijazah').setValue(rec.data['tglijazahasal']); Ext.getCmp('cb.prodi').enable(); Ext.getCmp('cb.thmasuk').enable(); Ext.getCmp('cb.thmasuk').setValue(rec.data['thnmasuk']); Ext.getCmp('cb.stkonversi').setValue('1'); Ext.getCmp('cb.stkonversi').disable(); waitmsg.hide(); reload_matkul_kurikulum(''); } }); waitmsg.hide(); win_pindahan.close(); } } function reload_matkul_kurikulum(idkn) { if (!RH.getCompValue('cb.prodi', true) || !RH.getCompValue('cb.thmasuk', true)) return; ds_nilai.reload({ params: { kdprodi: RH.getCompValue('cb.prodi', true), kdstsemester: RH.getCompValue('cb.thmasuk', true) + '1' } }); ds_matkul_kurikulum.reload({ params: { idkn: idkn, kdprodi: RH.getCompValue('cb.prodi', true), thnmasuk: RH.getCompValue('cb.thmasuk', true), nim: RH.getCompValue('tf.nim', true) }, scope : this, callback: function(records, operation, success) { var jumlahsksunla = 0,jumlahskskonv = 0,jumlahskstempuh = 0, bobotakui = 0,jmlmutuakui = 0,ipkakui = 0; ds_matkul_kurikulum.each(function (rec) { jumlahsksunla += parseFloat(rec.get('jmlsks')); if (rec.get('sksasal') && rec.get('nilaidiakui')) { jumlahskskonv += parseFloat(rec.get('sksasal')); bobotakui += parseFloat(RH.getRecordFieldValue(ds_nilai, 'bobotnilai', 'nilaihuruf', rec.get('nilaidiakui'))); jmlmutuakui += bobotakui * parseFloat(rec.get('jmlsks')); } else { jumlahskstempuh += parseFloat(rec.get('jmlsks')); } }); ipkakui = (jmlmutuakui / jumlahskskonv) ? jmlmutuakui / jumlahskskonv:0; Ext.getCmp('sksunla').setValue(jumlahsksunla); Ext.getCmp('skskonversi').setValue(jumlahskskonv); Ext.getCmp('skstempuh').setValue(jumlahskstempuh); Ext.getCmp('ipkkonversi').setValue(ipkakui.toFixed(2)); if (record) { if (record.data['idstkonversi']=='2') { Ext.getCmp('bt.save-kon').disable(); Ext.getCmp('bt.cetak-kon').disable(); Ext.getCmp('bt.kon-nilai').disable(); Ext.getCmp('cb.stkonversi').disable(); } else { if (jumlahskskonv == 0) { Ext.getCmp('bt.kon-nilai').disable(); Ext.getCmp('bt.save-kon').disable(); Ext.getCmp('bt.cetak-kon').disable(); } else { Ext.getCmp('bt.kon-nilai').enable(); Ext.getCmp('bt.save-kon').enable(); Ext.getCmp('bt.cetak-kon').enable(); } Ext.getCmp('cb.stkonversi').enable(); } } else { if (idkn) { Ext.getCmp('bt.save-kon').enable(); Ext.getCmp('bt.cetak-kon').enable(); Ext.getCmp('bt.kon-nilai').enable(); Ext.getCmp('cb.stkonversi').enable(); } else { Ext.getCmp('bt.save-kon').enable(); Ext.getCmp('bt.cetak-kon').disable(); Ext.getCmp('bt.kon-nilai').disable(); Ext.getCmp('cb.stkonversi').disable(); } } } }); } function get_checklist() { var jumlahskskonv = 0, jumlahskstempuh = 0, bobotakui = 0,jmlmutuakui = 0,ipkakui = 0, rowData; g_matkul_kurikulum.getStore().each(function(rec){ rowData = rec.data; if (rowData['nmmkasal'] && rowData['sksasal'] && rowData['nilaidiakui'] && rowData['pilihmk']) { jumlahskskonv += parseFloat(rowData['sksasal']); jumlahskstempuh += parseFloat(rowData['jmlsks']); bobotakui += parseFloat(RH.getRecordFieldValue(ds_nilai, 'bobotnilai', 'nilaihuruf', rowData['nilaidiakui'])); jmlmutuakui += bobotakui * parseFloat(rowData['jmlsks']); } }); ipkakui = (jmlmutuakui / jumlahskskonv) ? jmlmutuakui / jumlahskskonv:0; Ext.getCmp('skskonversi').setValue(jumlahskskonv); Ext.getCmp('skstempuh').setValue(jumlahskstempuh); Ext.getCmp('ipkkonversi').setValue(ipkakui.toFixed(2)); if (jumlahskskonv == 0) { Ext.getCmp('bt.save-kon').disable(); } else { Ext.getCmp('bt.save-kon').enable(); } } function get_konversi_det(idkn) { var par=''; var count= 1; var endpar = ';'; g_matkul_kurikulum.getStore().each(function(rec){ // ambil seluruh grid prodi var rowData = rec.data; if (count == g_matkul_kurikulum.getStore().getCount()) { endpar = '' } var pilih = (rowData['pilihmk']) ? 1 : 0; par += idkn + 'x' + rowData['kdprodi'] + 'x' + rowData['kdmk'] + 'x' + rowData['nmmkasal'] + 'x' + rowData['sksasal'] + 'x' + rowData['nilaiasal'] + 'x' + rowData['nilaidiakui'] + 'x' + rowData['kdstsemester'] + 'x' + pilih + 'x' + // pilih endpar; count = count+1; }); return par; } function fnSimpanKonversi(){ if(RH.isEmpty('cb.prodi')){ RH.warning('Program Studi harus diisi'); return; }; if(RH.isEmpty('cb.thmasuk')){ RH.warning('Tahun Masuk harus diisi'); return; }; if(RH.isEmpty('cb.stkonversi')){ RH.warning('Status Konversi harus diisi'); return; }; var waitmsgsimpan = Ext.MessageBox.wait('Menyimpan Konversi...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'konversi_controller/insert_konversi', method: 'POST', params: { tglkn: Ext.getCmp('tglkonversi').getValue(), kdprodi: Ext.getCmp('cb.prodi').getValue(), tahun: Ext.getCmp('cb.thmasuk').getValue(), nim: Ext.getCmp('tf.nim').getValue(), idstkonversi: Ext.getCmp('cb.stkonversi').getValue(), userid: Ext.getCmp('useridinput').getValue(), nopmb: Ext.getCmp('tf.nopmb').getValue(), nmpendaftar: Ext.getCmp('tf.namapendftr').getValue(), kdptasal: Ext.getCmp('tf.idptpts').getValue(), kdprodiasal: Ext.getCmp('tf.kdprodijur').getValue(), kdjenjangstudiasal: Ext.getCmp('tf.kdjenjstudi').getValue(), noijazahasal: Ext.getCmp('noijazah').getValue(), tglijazahasal: Ext.getCmp('tglijazah').getValue(), pengkonversi: Ext.getCmp('konverterhide').getValue(), acc: '', keterangan: Ext.getCmp('keterangan').getValue() }, success: function(response) { var jsonData = Ext.decode(response.responseText); var parmk = get_konversi_det(jsonData.idkn); Ext.Ajax.request({ url: BASE_URL + 'konversi_controller/exec_konversi_det', method: 'POST', params: { parmk : parmk }, success: function() { waitmsgsimpan.hide(); Ext.Msg.alert("Info", "Simpan Data Berhasil"); win_fkonversi.close(); grid.getStore().reload(); reload_matkul_kurikulum(jsonData.idkn); }, failure: function(result){ waitmsgsimpan.hide(); Ext.MessageBox.alert("Info", "Simpan Data Gagal"); } }); }, failure: function(result){ waitmsgsimpan.hide(); Ext.MessageBox.alert("Info", "Simpan Data Gagal"); } }); } function fnUpdateKonversi(){ var parmk = get_konversi_det(record.data['idkn']); var waitmsgupdate = Ext.MessageBox.wait('Update Konversi...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'konversi_controller/update_konversi', method: 'POST', params: { idkn : record.data['idkn'], keterangan : Ext.getCmp('keterangan').getValue() }, success: function() { Ext.Ajax.request({ url: BASE_URL + 'konversi_controller/exec_konversi_det', method: 'POST', params: { parmk : parmk }, success: function() { waitmsgupdate.hide(); Ext.Msg.alert("Info", "Ubah Data Berhasil"); grid.getStore().reload(); reload_matkul_kurikulum(record.data['idkn']); }, failure: function(result){ waitmsgupdate.hide(); Ext.MessageBox.alert("Info", "Ubah Data Gagal"); } }); }, failure: function(result){ waitmsgupdate.hide(); Ext.MessageBox.alert("Info", "Ubah Data Gagal"); } }); } function fnBatalKonversi(){ Ext.Msg.show({ title: 'Konfirmasi', msg: 'Batalkan konversi ini?', buttons: Ext.Msg.YESNO, icon: Ext.MessageBox.QUESTION, fn: function (response) { if ('yes' !== response) { return; } var waitmsgbatal = Ext.MessageBox.wait('Membatalkan Konversi...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'konversi_controller/batal_konversi', method: 'POST', params: { idkn : record.data['idkn'], idstkonversi: Ext.getCmp('cb.stkonversi').getValue() }, success: function() { waitmsgbatal.hide(); Ext.Msg.alert("Info", "Membatalkan Konversi Berhasil"); win_fkonversi.close(); grid.getStore().reload(); }, failure: function(result){ waitmsgbatal.hide(); Ext.MessageBox.alert("Info", "Membatalkan Konversi Gagal"); } }); } }); } function fnInsertKonversiNilai(){ Ext.Msg.show({ title: 'Konfirmasi', msg: 'Lanjutkan Proses Insert Konversi Ke Nilai?', buttons: Ext.Msg.YESNO, icon: Ext.MessageBox.QUESTION, fn: function (response) { if ('yes' !== response) { return; } var waitmsgkonvnilai = Ext.MessageBox.wait('Proses Insert Konversi Ke Nilai...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'konversi_controller/insert_konversi_nilai', method: 'POST', params: { nim: Ext.getCmp('tf.nim').getValue() }, success: function() { waitmsgkonvnilai.hide(); Ext.MessageBox.alert("Info", "Insert Konversi Ke Nilai Berhasil"); grid.getStore().reload(); win_fkonversi.close(); }, failure: function(result){ waitmsgkonvnilai.hide(); Ext.MessageBox.alert("Info", "Insert Konversi Ke Nilai Gagal"); } }); } }); } function fnCheckBayarKonversi(nim){ var ds_byrkonv = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'konversi_controller/get_bayar_konversi', method: 'POST' }), baseParams: { nim:nim }, totalProperty: 'results', autoLoad : true, root: 'data', fields: [ { name: "nokuitansi"} , { name: "tglkuitansi"} , { name: "nmcarabyr"} , { name: "noref" } , { name: "useridinput" } , { name: "jmlbayar" } ], listeners: { load: function(store, records, options) { var jumlahbayar=0; ds_byrkonv.each(function (rec) { jumlahbayar += parseFloat(rec.get('jmlbayar')); }); Ext.getCmp('nf.totalkonv').setValue(jumlahbayar); } } }); var cm_byrkonv = new Ext.grid.ColumnModel([{ header: 'No. Kuitansi', width: 100, dataIndex: 'nokuitansi', sortable: true }, { header: 'Tgl. Kuitansi', width: 70, dataIndex: 'tglkuitansi', sortable: true, //renderer: Ext.util.Format.dateRenderer('m-d-Y g:i A') }, { header: 'Cara Bayar', width: 80, dataIndex: 'nmcarabyr', sortable: true }, { header: 'No. Ref./Bukti Transfer', width: 100, dataIndex: 'noref', sortable: true }, { header: 'Penerima', width: 100, hidden: true, dataIndex: 'useridinput', sortable: true }, { header: 'Jumlah Bayar', width: 100, dataIndex: 'jmlbayar', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'right' }] ); var gp_byrkonv = new Ext.grid.GridPanel({ id: 'gp.byrkonv', ds: ds_byrkonv, cm: cm_byrkonv, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), forceFit: true, height: 160, //width: 720, border: true, tbar: [{ text: 'Lanjut Insert Konversi Ke Nilai', iconCls: 'silk-page-copy', handler: function(){ if(Ext.getCmp('nf.totalkonv').getValue() > 0) { wbyrkonv.close(); fnInsertKonversiNilai(); } else { Ext.MessageBox.alert("Info", "Pembayaran Konversi Belum Lunas"); } } }, '->'], bbar: [ { xtype:'tbfill' }, { xtype: 'form', items: [{ xtype:'numericfield', fieldLabel:'Total', id:'nf.totalkonv', readOnly: true, width:100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', labelAlign: 'right' //value jmlbayar diambil dari record DPPstore yg call grid ini }] }], autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', }); // -- FORM PANEL (DISPLAY) DETAIL DPP var fp_byrkonv = new Ext.Panel({ id: 'fp.byrkonv', layout: 'form', forceFit: true, //width:500, height:400, margin: '0 0 10', frame: true, defaults: { labelWidth: 170, labelAlign: 'right'}, items: [{ xtype: 'fieldset', items: [gp_byrkonv], }] }); var wbyrkonv = new Ext.Window({ title: 'Cek Pembayaran Konversi', modal: true, resizable: false, layout: 'fit', width:500, height:220, items: [fp_byrkonv] }).show(); } }