function f_penerimaanpembayaranpmb(nimnya, titleyy) { var titley = 'Penerimaan Pembayaran PMB'; var nopmby; var ds_carabyr = store_carabyr(); var ds_stmskmhs_pmb = store_stmskmhs_pmb(); var ds_setbiayapmb = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/setbiayapmbaktif', method: 'POST' }), totalProperty: 'results', root: 'data', autoLoad: false, fields: [{ name: 'idsetbiayapmb', mapping: 'idsetbiayapmb' }, { name: 'nmsetbiayapmb', mapping: 'nmsetbiayapmb' }] }); var ds_nya = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/gridjadwalusm', method: 'POST' }), root: 'data', totalProperty: 'results', autoLoad:true, fields: [{ name: "nmthnakademik", mapping: "nmthnakademik" }, { name: "nmjnssemester", mapping: "nmjnssemester" }, { name: "nmstmskmhs", mapping: "nmstmskmhs" }, { name: "nmjnsusm", mapping: "nmjnsusm" }, { name: "tglusm", mapping: "tglusm" }, { name: "jamusmdari", mapping: "jamusmdari" }, { name: "jamusmsampai", mapping: "jamusmsampai" }], listeners: { load: function(store, records, options) { // Ext.getCmp('jmlsks2').setValue(store.getAt(0)); // alert(store.getAt(0).data['kdmk']); } } }); var ds_nya2 = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/gridjadwalpmb', method: 'POST' }), root: 'data', totalProperty: 'results', autoLoad:true, fields: [{ name: "nmthnakademik", mapping: "nmthnakademik" }, { name: "nmjnssemester", mapping: "nmjnssemester" }, { name: "daritgl", mapping: "daritgl" }, { name: "sampaitgl", mapping: "sampaitgl" }, { name: "jmlpendaftar", mapping: "jmlpendaftar" }], listeners: { load: function(store, records, options) { // Ext.getCmp('jmlsks2').setValue(store.getAt(0)); // alert(store.getAt(0).data['kdmk']); } } }); //===================================================== var sm_nya = new Ext.grid.CheckboxSelectionModel({ listeners: { selectionchange: function(sm) {} } }); var sm_nya2 = new Ext.grid.CheckboxSelectionModel({ listeners: { selectionchange: function(sm) {} } }); var vw = new Ext.grid.GridView({ emptyText: '< No Data To Display >' }); var cm = new Ext.grid.ColumnModel({ // specify any defaults for each column defaults: { sortable: true // columns are not sortable by default }, columns: [ //sm_nya, new Ext.grid.RowNumberer(), { header: '
Tahun
Akademik
', width: 65, dataIndex: 'nmthnakademik', sortable: true }, { header: '
Semester
', width: 100, dataIndex: 'nmjnssemester', sortable: true }, { header: '
Status
Masuk
', width: 100, dataIndex: 'nmstmskmhs', sortable: true }, { header: '
Jenis
USM
', width: 100, dataIndex: 'nmjnsusm', sortable: true }, { header: '
Tanggal
USM
', width: 70, dataIndex: 'tglusm', sortable: true }, { header: '
Dari
Jam
', width: 70, dataIndex: 'jamusmdari', sortable: true }, { header: '
Sampai
Jam
', width: 70, dataIndex: 'jamusmsampai', sortable: true }] }); var cm2 = new Ext.grid.ColumnModel({ // specify any defaults for each column defaults: { sortable: true // columns are not sortable by default }, columns: [ //sm_nya, new Ext.grid.RowNumberer(), { header: '
Tahun
Akademik
', width: 65, dataIndex: 'nmthnakademik', sortable: true }, { header: '
Semester
', width: 100, dataIndex: 'nmjnssemester', sortable: true }, { header: '
Dari Tanggal
', width: 100, dataIndex: 'daritgl', sortable: true }, { header: '
Sampai Tanggal
', width: 100, dataIndex: 'sampaitgl', sortable: true }, { header: '
Jumlah
Pendaftar
', width: 70, dataIndex: 'jmlpendaftar', sortable: true }] }); var grid_nya2 = new Ext.grid.EditorGridPanel({ store: ds_nya, vw: vw, title: "Jadwal USM", sm: sm_nya, cm: cm, autoScroll: true, columnLines: true, clicksToEdit: 1, loadMask: true, frame: true, height: 200, id: 'grid_det_nya', //tbar: [], listeners: { rowclick: function rowClick(grid, rowIdx) { } } }); var grid_nya = new Ext.grid.EditorGridPanel({ store: ds_nya2, vw: vw, title: "Jadwal PMB", sm: sm_nya2, cm: cm2, autoScroll: true, columnLines: true, clicksToEdit: 1, loadMask: true, frame: true, height: 200, id: 'grid_det_nya2', //tbar: [], listeners: { rowclick: function rowClick(grid, rowIdx) { } } }); var form_bp_general = new Ext.form.FormPanel({ id: 'form_bp_general', forceFit: true, tbar: [{ text: 'Baru', iconCls: 'silk-add', handler: function() { Ext.getCmp('simpan').enable(); Ext.getCmp('update').disable(); Ext.getCmp('cetak').enable(); Ext.getCmp('batal').enable(); form_bp_general.getForm().reset(); Ext.getCmp('tglkuitansi').setValue(SYS_DATE); getaktifpmb(); } }, { text: 'Simpan', id:'simpan', name:'simpan', iconCls: 'silk-save', handler: function() { var terima = Ext.getCmp('uangditerima').getValue(); var nominal = Ext.getCmp('nominal').getValue(); if (formatmoney(terima - nominal) < 0){ Ext.MessageBox.alert("Informasi", "Isi Jumlah Uang Diterima Dengan Benar"); } else { //generateall(); simpan("form_bp_general"); } } }, { text: 'Update', id:'update', name:'update', iconCls: 'silk-save', handler: function() { Ext.MessageBox.show({ title: "Konfirmasi", msg: "Anda Yakin Untuk Mengupdate Pembayaran Ini?", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { update(); } } }); } }, { text: 'Cetak', iconCls: 'silk-printer', id:'cetak', name:'cetak', handler: function() { printy(nopmby); } }, { text: 'Batal', id:'batal', name:'batal', iconCls: 'silk-cancel', handler: function() { Ext.MessageBox.show({ title: "Konfirmasi", msg: "Anda Yakin Untuk Membatalkan Kuitansi ini?", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/batal', method: 'POST', params: { nokuitansi:Ext.getCmp('nokuitansi').getValue() }, success: function(response) { Ext.MessageBox.alert("Informasi", "Kuitansi Dibatalkan.."); form_bp_general.getForm().reset(); Ext.getCmp('tglkuitansi').setValue(SYS_DATE); Ext.getCmp('cetak').disable(); Ext.getCmp('batal').disable(); } }); } } }); } }, { text: 'Cari', iconCls: 'silk-find', handler: function() { find_x("Data Pembayaran PMB", 9); } }], reader: new Ext.data.JsonReader({ root: 'data', totalProperty: 'results', id: 'id', fields: [{ name: "nim", mapping: "nim" }, { name: "nmmhs", mapping: "nmmhs" }, { name: "nmfakultas", mapping: "nmfakultas" }, { name: "kdprodi", mapping: "kdprodi" }, { name: "nmprodi", mapping: "nmprodi" }, { name: "tahunmsk", mapping: "tahunmsk" }, //1 { name: "persen", mapping: "persen" }, { name: "stbayar", mapping: "stbayar" }, { name: "foto", mapping: "foto" }, { name: "idjnssemester", mapping: "idjnssemester" //kdstsemester }, { name: "kdstsemester", mapping: "kdstsemester" }, { name: "kdthnakademik", mapping: "kdthnakademik" }, { name: "nmstaktivitasmhs", mapping: "nmstaktivitasmhs" }] }), // items: [{ columnWidth: 1, xtype: 'panel', border: false, items: [{ layout: 'form', frame: true, border: false, items: [{ xtype: 'fieldset', title: 'Pembayaran', defaults: { labelAlign: 'right' }, items: [{ xtype: 'fieldset', title: 'Kwitansi', // height:100, layout: 'form', frame: true, items: [{ layout: 'column', border: false, items: [{ columnWidth: .50, layout: 'form', border: false, items: [{ xtype: 'textfield', fieldLabel: 'No Kuitansi', readOnly: true, id: 'nokuitansi', name: 'nokuitansi', labelStyle: 'width:120px;', anchor: '95%', value: "Auto Generate" },{ xtype: 'container', fieldLabel: 'Tgl. Kuitansi', labelStyle: 'width:120px;', layout: 'hbox', defaults: { hideLabel: 'true' }, items: [{ xtype: 'datefield', id: 'tglkuitansi', //format: "d/m/Y", name: 'tglkuitansi', listeners: { 'afterrender': function() { Ext.getCmp('tglkuitansi').setValue(SYS_DATE); } } }, { xtype: 'textfield', id: 'timekuitansi', name: 'timekuitansi', width: 130 }] }] }, { columnWidth: .50, layout: 'form', border: false, items: [{ xtype: 'combo', labelStyle: 'width:160px;', fieldLabel: 'Cara Bayar', id: 'carabayar', name: 'carabayar', valueField: 'idcarabyr', displayField: 'nmcarabyr', store: ds_carabyr, triggerAction: 'all', editable: false, submitValue: true, hiddenName: 'h_cara_bayar', allowBlank: false, typeAhead: true, mode: 'local', emptyText: 'Pilih...', selectOnFocus: true, width:170, listeners: { select: function() { var a = ""; var a = Ext.getCmp('carabayar').getValue(); if (a == "3" ){ Ext.getCmp('noref').setValue(""); Ext.getCmp('noref').setReadOnly(false); Ext.getCmp('uangditerima').setValue(Ext.getCmp('nominal').getValue()); Ext.getCmp('uangditerima').setReadOnly(true); Ext.getCmp('noref').focus(); } if (a == "2" ){ Ext.getCmp('noref').setValue(""); Ext.getCmp('noref').setReadOnly(false); Ext.getCmp('uangditerima').setValue(Ext.getCmp('nominal').getValue()); Ext.getCmp('uangditerima').setReadOnly(true); Ext.getCmp('noref').focus(); } if (a == "1" ){ Ext.getCmp('noref').setValue("-"); Ext.getCmp('noref').setReadOnly(true); Ext.getCmp('uangditerima').setValue(""); Ext.getCmp('uangditerima').setReadOnly(false); Ext.getCmp('uangditerima').focus(); } } } }, { xtype: 'textfield', labelStyle: 'width:160px;', fieldLabel: 'No. Ref/Bukti Transfer', id: 'noref', name: 'noref', width: 170, maskRe: /[0-9.]/, allowBlank: false }] }] }] }, { xtype: 'fieldset', title: 'Pendaftar / Calon Mahasiswa', items: [{ layout: 'column', border: false, items: [{ columnWidth: 1, layout: 'form', border: false, items: [{ xtype: 'textfield', fieldLabel: '', id: 'idjadwalpmb', name: 'idjadwalpmb', labelStyle: 'width:120px;', hidden: true, readOnly: true, anchor: '5%' },{ xtype: 'textfield', fieldLabel: '', id: 'smtjadwalpmb', name: 'smtjadwalpmb', labelStyle: 'width:120px;', hidden: true, readOnly: true, anchor: '5%' },{ xtype: 'textfield', fieldLabel: 'Jadwal PMB', id: 'nmjadwalpmb', name: 'nmjadwalpmb', labelStyle: 'width:120px;', allowBlank: false, readOnly: true, anchor: '95%' }, { xtype: 'combo', fieldLabel: 'Status Pendaftar', store: ds_stmskmhs_pmb, triggerAction: 'all', editable: false, valueField: 'idstmskmhs', displayField: 'nmstmskmhs', forceSelection: true, submitValue: true, hiddenName: 'h_idstmskmhs', allowBlank: false, typeAhead: true, hidden: true, mode: 'local', emptyText: 'Pilih...', selectOnFocus: true, id: 'statuspendaftar', name: 'statuspendaftar', labelStyle: 'width:120px;', anchor: '30%' }, { xtype: 'textfield', fieldLabel: 'Nama Pendaftar', id: 'namapendaftar', name: 'namapendaftar', labelStyle: 'width:120px;', allowBlank: false, anchor: '95%' }, { xtype: 'textfield', fieldLabel: 'No Telp./HP', id: 'notelp', name: 'notelp', allowBlank: false, labelStyle: 'width:120px;', anchor: '95%', maskRe: /[0-9.]/ }] }] }] }, { xtype: 'fieldset', title: 'Pembayaran', // height:100, items: [{ xtype: 'combo', fieldLabel: 'Untuk Pembayaran', width: 380, store: ds_setbiayapmb, id: 'untukpembayaran', name: 'untukpembayaran', editable: false, triggerAction: 'all', valueField: 'idsetbiayapmb', displayField: 'nmsetbiayapmb', forceSelection: true, submitValue: true, hiddenName: 'h_ubayar', allowBlank: false, labelStyle: 'width:120px;', anchor: '95%', emptyText: 'Pilih...', listeners:{ select: function() { Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/bayar', method: 'POST', params: { // idsetbiayapmb: Ext.getCmp("untukpembayaran").getValue() // }, success: function(response) { var r = Ext.decode(response.responseText); Ext.getCmp("nominal").setValue(r); } }); } }, typeAhead: true, mode: 'local', selectOnFocus: true, }, { xtype: 'numericfield', style: 'text-align: right;', labelStyle: 'width:120px;', fieldLabel: 'Nominal', id: 'nominal', name: 'nominal', maskRe: /[0-9.]/, anchor: '30%', decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', validator:function(){ var a = Ext.getCmp('nominal').getValue(); Ext.getCmp('uangditerima').setValue(a); Ext.getCmp('terbilang').setValue(terbilang(a)); }, allowBlank: false }, { xtype: 'textfield', labelStyle: 'width:120px;', fieldLabel: 'Terbilang', id: 'terbilang', name: 'terbilang', readOnly: true, anchor: '95%' }, { xtype: 'numericfield', style: 'text-align: right;', labelStyle: 'width:570px;', fieldLabel: 'Uang yang Diterima', id: 'uangditerima', maskRe: /[0-9.]/, name: 'uangditerima', anchor: '32%', decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', validator: function(){ var terima = Ext.getCmp('uangditerima').getValue(); var nominal = Ext.getCmp('nominal').getValue(); Ext.getCmp('kembalian').setValue(terima - nominal); }, allowBlank: false }, { xtype: 'numericfield', style: 'text-align: right;', labelStyle: 'width:570px;', fieldLabel: 'Kembalian', id: 'kembalian', name: 'kembalian', readOnly: true, anchor: '32%', decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.' }] }, { xtype: 'fieldset', title: 'Login PMB', items: [{ xtype: 'textfield', fieldLabel: 'Biodata pendaftar/calon Mahasiswa dapat dilengkapi dengan login PMB menggunakan', labelStyle: 'width:500px;', hidden: true }, { xtype: 'textfield', fieldLabel: 'No. PMB', readOnly: true, id: 'nopmb', name: 'nopmb', labelStyle: 'width:120px;', value: "Auto Generate", anchor: '40%' }, { xtype: 'textfield', fieldLabel: 'Password', readOnly: true, id: 'password', name: 'password', labelStyle: 'width:120px;', value: "Auto Generate", anchor: '40%' }/* , { xtype: 'textfield', hidden: true, readOnly: true, id: 'cekuitansi', name: 'cekuitansi', } */ ] }] }] }] }], listeners: { afterrender: awal } }); function awal() { Ext.getCmp('simpan').disable(); Ext.getCmp('update').disable(); Ext.getCmp('cetak').disable(); Ext.getCmp('batal').disable(); setInterval(function() { var d = new Date(); var t = d.toLocaleTimeString(); if (Ext.getCmp('timekuitansi')) Ext.getCmp('timekuitansi').setValue(t); }, 1000); getaktifpmb(); } function formatx(){ } var akhir = new Ext.Panel({ layout: 'border', defaults: { collapsible: true, split: true, bodyStyle: 'padding:15px' }, items: [{ collapsible: false, bodyStyle: 'padding:0px', region: 'center', cmargins: '5 0 0 0', id: 'images-view', frame: true, width: 640, title: titley, autoScroll: true, items: [form_bp_general] }, { bodyStyle: 'padding:0px', collapsible: true, region: 'east', minSize: 75, maxSize: 250, cmargins: '5 0 0 0', title: 'Informasi', frame: true, width: 350, height: 495, //autoHeight: true, id: 'images-view2', items: [grid_nya,grid_nya2] //p2] }] }); get_content(akhir); function simpan(namaForm) { nopmby = Ext.getCmp('nopmb').getValue(); var form_nya = Ext.getCmp(namaForm); /* form_nya.getForm().submit({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/save', method: 'POST', params:{ user:USERNAME , nominaly:Ext.getCmp('nominal').getValue(), jmlbyr:Ext.getCmp('uangditerima').getValue() }, success: function() { //printy(nopmby); Ext.MessageBox.alert("Informasi", "Simpan Data Berhasil"); Ext.getCmp('simpan').disable(); ds_nya2.reload(); //form_bp_general.getForm().reset(); //Ext.getCmp('tglkuitansi').setValue(SYS_DATE); }, failure: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); */ Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/save', method: 'POST', params:{ tglkuitansi:Ext.getCmp('tglkuitansi').getValue(), timekuitansi:Ext.getCmp('timekuitansi').getValue(), carabayar:Ext.getCmp('carabayar').getValue(), noref:Ext.getCmp('noref').getValue(), idjadwalpmb:Ext.getCmp('idjadwalpmb').getValue(), statuspendaftar:Ext.getCmp('statuspendaftar').getValue(), namapendaftar:Ext.getCmp('namapendaftar').getValue(), notelp:Ext.getCmp('notelp').getValue(), untukpembayaran:Ext.getCmp('untukpembayaran').getValue(), jmlbyr:Ext.getCmp('uangditerima').getValue(), user:USERID , nominaly:Ext.getCmp('nominal').getValue() }, success: function(response) { var arrjson = Ext.decode(response.responseText); if (arrjson.success==true){ Ext.MessageBox.alert("Informasi", arrjson.message); Ext.getCmp("nokuitansi").setValue(arrjson.kuitansi); Ext.getCmp("nopmb").setValue(arrjson.pmb); Ext.getCmp("password").setValue(arrjson.password); Ext.getCmp('simpan').disable(); } else if (arrjson.success==false){ Ext.MessageBox.alert("Informasi", arrjson.message); } ds_nya2.reload(); }, failure: function() { Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); } /* function generateall(){ Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/otokuitansi', method: 'POST', success: function(response) { //var r = Ext.decode(response.responseText); //Ext.getCmp("nopmb").setValue(r.nopmb); Ext.getCmp("nokuitansi").setValue(response.responseText); } }); Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/otopmb', method: 'POST', success: function(response) { //var r = Ext.decode(response.responseText); //Ext.getCmp("nopmb").setValue(r.nopmb); Ext.getCmp("nopmb").setValue(response.responseText); } }); Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/generatePassword', method: 'POST', success: function(response) { Ext.getCmp("password").setValue(response.responseText); } }); } */ function getaktifpmb(){ Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/pmbaktif', method: 'POST', success: function(response) { var arrjson = Ext.decode(response.responseText); Ext.getCmp("idjadwalpmb").setValue(arrjson.id); Ext.getCmp("nmjadwalpmb").setValue(arrjson.nama); Ext.getCmp("smtjadwalpmb").setValue(arrjson.kdstsemester); ds_setbiayapmb.setBaseParam('kdstsemester', Ext.getCmp('smtjadwalpmb').getValue()); ds_setbiayapmb.load(); } }); } function printy(nopmby){ nopmby = Ext.getCmp('nokuitansi').getValue(); var parsing = nopmby + 'istra'; var win = window.open(); win.location.reload(); win.location = BASE_URL + 'print/print_topdf/pcetakskwitansi/' + parsing; } function update() { Ext.Ajax.request({ url: BASE_URL + 'pendaftaran/c_penerimaanpembayaran/update', method: 'POST', params:{ nokuitansi:Ext.getCmp('nokuitansi').getValue(), nopmb:Ext.getCmp('nopmb').getValue(), carabayar:Ext.getCmp('carabayar').getValue(), noref:Ext.getCmp('noref').getValue(), untukpembayaran:Ext.getCmp('untukpembayaran').getValue(), jmlbyr:Ext.getCmp('uangditerima').getValue(), nominaly:Ext.getCmp('nominal').getValue() }, success: function(response) { Ext.MessageBox.alert("Informasi", "Data Pembayaran Berhasil Di Update"); form_bp_general.getForm().reset(); Ext.getCmp('tglkuitansi').setValue(SYS_DATE); Ext.getCmp('cetak').disable(); Ext.getCmp('batal').disable(); }, failure: function() { Ext.MessageBox.alert("Informasi", "Data Pembayaran Gagal Di Update"); } }); } }