function p_skl() { //===================GRID MHS A,C,N,G=================== var ds_grid = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'c_skl/lookup_mhs_aktif', method: 'POST' }), params: { start: 0, limit: 50 }, root: 'data', totalProperty: 'results', autoLoad: false, fields: [{ name: "nim", mapping: "nim" }, { name: "nmmhs", mapping: "nmmhs" }, { name: "kdjnskelamin", mapping: "kdjnskelamin" }, { name: "tgllahir", mapping: "tgllahir" }, { name: "nmstawalmhs", mapping: "nmstawalmhs" }, { name: "thnmasuk", mapping: "thnmasuk" }, { name: "nmstaktivitasmhs", mapping: "nmstaktivitasmhs" }] }); var sm_nya = new Ext.grid.RowSelectionModel({ singleSelect: true, listeners: {} }); var cari_data = [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({ store: ds_grid, displayInfo: true, displayMsg: 'Data Mahasiswa Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var grid_nya = new Ext.grid.GridPanel({ store: ds_grid, frame: true, height:200, autoWidth: true, bodyStyle: 'padding:3px 3px 3px 3px', //plugins: cari_data, id: 'grid_det_product', forceFit: true, tbar: [{ text: 'Cari Berdasarkan' }, { xtype: 'combo', store: ['NPM', 'Nama Mahasiswa', '(L/P)', 'Tgl. Lahir', 'Status Awal Masuk', 'Angkatan', 'Status Aktivitas'], //ds_fieldpmb, name: 'idfield', id: 'idfield', triggerAction: 'all', editable: false, valueField: 'kolom', displayField: 'kolom', forceSelection: true, submitValue: true, hiddenName: 'h_kolom', listeners: {}, typeAhead: true, mode: 'remote', emptyText: 'Pilih...', selectOnFocus: true, width: 250 }, { xtype: 'textfield', name: 'keywordnya', id: 'keywordnya', width: 250 //, // fieldLabel:'Dodol' }, { xtype: 'button', text: ' Cari ', iconCls: 'silk-find', id: 'btn_data', width: 3, handler: function() { ds_grid.setBaseParam('idnya', Ext.getCmp('idfield').getValue()); ds_grid.setBaseParam('keyword', Ext.getCmp('keywordnya').getValue()); ds_grid.load(); } },'->', { xtype: 'button', text: ' Lulus ', iconCls: 'silk-accept', id: 'btn_lulus', width: 3, handler: function() { simpanlulus(); } }], sm: sm_nya, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, columns: [new Ext.grid.RowNumberer(), { header: RH.h3('NPM'), width: 150, dataIndex: 'nim', sortable: true },{ header: RH.h3('Nama Mahasiswa'), width: 150, dataIndex: 'nmmhs', sortable: true },{ header: RH.h3('(L/P)'), width: 50, dataIndex: 'kdjnskelamin', sortable: true },{ header: RH.h3('Tgl.Lahir'), width: 100, dataIndex: 'tgllahir', sortable: true },{ header: RH.h3('Status Awal Masuk'), width: 150, dataIndex: 'nmstawalmhs', sortable: true },{ header: RH.h3('Angkatan'), width: 150, dataIndex: 'thnmasuk', sortable: true },{ header: RH.h3('Status Aktivitas'), width: 100, dataIndex: 'nmstaktivitasmhs', sortable: true },{ xtype: 'checkcolumn', header: '', dataIndex: 'pilih', id: 'pilih', width: 60, readonly: false, editor:{ xtype: 'checkbox', id:'cbpilih', name:'cbpilih', listeners: { change: function() { } } } }], bbar: paging, listeners: { rowclick: function rowClick(grid, rowIdx) { } } }); //===================GRID MHS LULUS=================== var ds_grid1 = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'c_skl/lookup_mhs_lulus', method: 'POST' }), params: { start: 0, limit: 50 }, root: 'data', totalProperty: 'results', autoLoad: false, fields: [{ name: "nim", mapping: "nim" }, { name: "nmmhs", mapping: "nmmhs" }, { name: "kdjnskelamin", mapping: "kdjnskelamin" }, { name: "tgllahir", mapping: "tgllahir" }, { name: "thnmasuk", mapping: "thnmasuk" }, { name: "nmklsmhs", mapping: "nmklsmhs" }, { name: "noskl", mapping: "noskl" }, { name: "tglskl", mapping: "tglskl" }, { name: "tglpengesahanskl", mapping: "tglpengesahanskl" }, { name: "nmpimpinan", mapping: "nmpimpinan" }] }); var sm_nya1 = new Ext.grid.RowSelectionModel({ singleSelect: true, listeners: {} }); var cari_data1 = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var paging1 = new Ext.PagingToolbar({ store: ds_grid1, displayInfo: true, displayMsg: 'Data Menu Dari {0} - {1} of {2}', emptyMsg: 'No data to display' }); var editor1 = new Ext.ux.grid.RowEditor({ saveText: 'Update', clicksToEdit: 2 }); editor1.on({ scope: this, afteredit: function(roweditor, changes, record, rowIndex) { /* alert(record.get('noskl') + " " + record.get('tglskl') + " " + record.get('tglpengesahanskl') + " " + record.get('nmpimpinan') ); */ Ext.Ajax.request({ url: BASE_URL + 'c_skl/update_lulus', params: { nim: record.get('nim'), noskl: record.get('noskl'), tglskl: record.get('tglskl'), tglsah: record.get('tglpengesahanskl'), pimpin: record.get('nmpimpinan') }, success: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); ds_grid1.load(); }, failure: function() { Ext.MessageBox.alert("Informasi", "SImpan Data Gagal"); } }); } }); var grid_nya1 = new Ext.grid.GridPanel({ store: ds_grid1, frame: true, height:200, autoWidth: true, bodyStyle: 'padding:3px 3px 3px 3px', plugins: editor1, id: 'grid_det_product1', forceFit: true, tbar: [{ text: 'Cari Berdasarkan' }, { xtype: 'combo', store: ['NPM', 'Nama Mahasiswa', '(L/P)', 'Tgl. Lahir', 'Angkatan', 'Jenis Kelas', 'No. SKL', 'Tgl. SKL', 'Tgl. Pengesahan', 'Rektor/Pimpinan'], //ds_fieldpmb, name: 'idfield1', id: 'idfield1', triggerAction: 'all', editable: false, valueField: 'kolom', displayField: 'kolom', forceSelection: true, submitValue: true, hiddenName: 'h_kolom', listeners: {}, typeAhead: true, mode: 'remote', emptyText: 'Pilih...', selectOnFocus: true, width: 250 }, { xtype: 'textfield', name: 'keywordnya1', id: 'keywordnya1', width: 250 //, // fieldLabel:'Dodol' }, { xtype: 'button', text: ' Cari ', iconCls: 'silk-find', id: 'btn_data1', width: 3, handler: function() { ds_grid1.setBaseParam('idnya', Ext.getCmp('idfield1').getValue()); ds_grid1.setBaseParam('keyword', Ext.getCmp('keywordnya1').getValue()); ds_grid1.load(); } }], sm: sm_nya1, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, columns: [new Ext.grid.RowNumberer(), { header: RH.h3('NPM'), width: 100, dataIndex: 'nim', sortable: true },{ header: RH.h3('Nama Mahasiswa'), width: 120, dataIndex: 'nmmhs', sortable: true },{ header: RH.h3('(L/P)'), width: 50, dataIndex: 'kdjnskelamin', sortable: true },{ header: RH.h3('Tgl.Lahir'), width: 100, dataIndex: 'tgllahir', sortable: true },{ header: RH.h3('Angkatan'), width: 100, dataIndex: 'thnmasuk', sortable: true },{ header: RH.h3('Jenis Kelas'), width: 100, dataIndex: 'nmklsmhs', sortable: true },{ header: RH.h3('No.SKL'), width: 100, dataIndex: 'noskl', sortable: true, editor: { xtype: 'textfield', } },{ xtype: 'datecolumn', header: RH.h3('Tgl.SKL'), width: 100, dataIndex: 'tglskl', sortable: true, format: 'm/d/Y', editor: { xtype: 'datefield', minValue: '01/01/2006', } },{ xtype: 'datecolumn', header: RH.h3('Tgl.Pengesahan'), width: 100, dataIndex: 'tglpengesahanskl', sortable: true, format: 'm/d/Y', editor: { xtype: 'datefield', minValue: '01/01/2006' } },{ header: RH.h3('Rektor/Pimpinan'), width: 100, dataIndex: 'nmpimpinan', sortable: true, editor: { xtype: 'combo', store: ds_pimpinan, //ds_fieldpmb, name: 'cbpimpinan', id: 'cbpimpinan', triggerAction: 'all', editable: false, valueField: 'nmpimpinan', displayField: 'nmpimpinan', forceSelection: true, submitValue: true, hiddenName: 'h_pimpinan', listeners: {}, typeAhead: true, mode: 'remote', emptyText: 'Pilih...', selectOnFocus: true, width: 250 } },{ xtype: 'actioncolumn', width: 50, header: RH.h3('Batal'), align:'center', items: [{ icon : 'resources/img/icons/fam/delete.gif', tooltip: 'Batal', handler: function(grid, rowIndex) { Ext.MessageBox.show({ title: "Konfirmasi", msg: "Anda Yakin Untuk Membatalkan?", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { var rec = ds_grid1.getAt(rowIndex); var nim = rec.get('nim'); var kdstsemester = Ext.getCmp('thnakademik').getValue(); batallulus(nim,kdstsemester); } } }); } }],hidden:false },{ xtype: 'actioncolumn', width: 50, header: RH.h3('Print'), align:'center', items: [{ icon : 'resources/img/icons/fam/print.gif', tooltip: 'Cetak', handler: function(grid, rowIndex) { var rec = ds_grid1.getAt(rowIndex); var parsing = rec.get('nim') + 'istra'; var win = window.open(); win.location.reload(); //win.location = BASE_URL + 'print/print_topdf/pcetakskwitansi/' + parsing; win.location = BASE_URL + 'surat/surat_lulus/get_surat_lulus/' + parsing; } }] }], bbar: paging1, listeners: { rowclick: function rowClick(grid, rowIdx) { } } }); //=================================================================== var form_bp_general = new Ext.Panel({ id: 'form_bp_general', bodyStyle: 'padding: 5px', autoScroll: true, title: 'Surat Keterangan Lulus', items: [{ xtype: 'fieldset', title: 'Filter', layout:'column', items: [{ columnWidth: .33, layout: 'form', labelAlign:'right', border: false, items: [{ xtype: 'combo', fieldLabel: 'Program Studi', store: ds_prodi, name: 'kdprodi', id: 'kdprodi', triggerAction: 'all', editable: false, valueField: 'kdprodi', displayField: 'nmprodi', forceSelection: true, submitValue: true, hiddenName: 'h_kdprodi', listeners: { select: function() { searchSkl(); } }, typeAhead: true, mode: 'local', emptyText: 'Pilih...', selectOnFocus: true, width: 250 }] }, { columnWidth: .50, layout: 'form', labelAlign:'right', border: false, items: [{ xtype: 'combo', labelStyle: 'width:170px;', fieldLabel: 'Tahun Akademik - Semester', store: ds_thnakademik2, name: 'thnakademik', id: 'thnakademik', triggerAction: 'all', editable: false, valueField: 'kdstsemester', displayField: 'nmthnakademik', forceSelection: true, submitValue: true, hiddenName: 'h_thnkademik', listeners: { select: function() { searchSkl(); } }, typeAhead: true, mode: 'local', emptyText: 'Pilih...', selectOnFocus: true, width: 150 }] }] }, { xtype: 'fieldset', title: 'Daftar Mahasiswa (AKTIF, CUTI, NON-AKTIF, SEDANG DOUBLE DEGREE)', items: [grid_nya] }, { xtype: 'fieldset', title: 'Daftar Mahasiswa (LULUS)', items: [grid_nya1] }] }); SET_PAGE_CONTENT(form_bp_general); function get_mhs() { var par=''; var a= 1; var c = ';'; var kdstsemester = Ext.getCmp('thnakademik').getValue(); grid_nya.getStore().each(function(rec){ // ambil seluruh grid prodi var rowData = rec.data; if (a == grid_nya.getStore().getCount()) { c = '' } var j = (rowData['pilih']) ? 1 : 0; par += rowData['nim'] + 'x' + kdstsemester + 'x' + j + 'x' + c; a= a+1; }); return par; } function simpanlulus(){ var mhs = get_mhs(); Ext.Ajax.request({ url: BASE_URL + 'c_skl/simpan_lulus', params: { selectmhs: mhs, // }, success: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); ds_grid.load(); ds_grid1.load(); }, failure: function() { Ext.MessageBox.alert("Informasi", "SImpan Data Gagal"); } }); } function batallulus(nimnya,kdstsemesternya){ Ext.Ajax.request({ url: BASE_URL + 'c_skl/batal_lulus', params: { nim: nimnya, kdstsemester: kdstsemesternya }, success: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); ds_grid.load(); ds_grid1.load(); }, failure: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); } function searchSkl() { var kdprodi = Ext.getCmp('kdprodi').getValue(); var kdstsemester = Ext.getCmp('thnakademik').getValue(); if (kdprodi && kdstsemester) { ds_grid.setBaseParam('kdprodi', Ext.getCmp('kdprodi').getValue()); ds_grid.setBaseParam('thnakademik', Ext.getCmp('thnakademik').getValue()); ds_grid.load(); ds_grid1.setBaseParam('kdprodi', Ext.getCmp('kdprodi').getValue()); ds_grid1.setBaseParam('thnakademik', Ext.getCmp('thnakademik').getValue()); ds_grid1.load(); } } }