function cetak_kartu_ujian() { ds_thnakademik2 = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'c_mastah/grid_thnakademik2', method: 'POST', 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'; } }); } } }), totalProperty: 'results', root: 'data', autoLoad: false, fields: [{ name: 'kdstsemester', mapping: 'kdstsemester' },{ name: 'kdthnakademik', mapping: 'kdthnakademik' },{ name: 'nmthnakademik', mapping: 'nmthnakademik' }] }); var ds_jujian = store_jujian(); var smt1; var smt2; var smt3; var smt4; var smt5; var form_bp_general = new Ext.form.FormPanel({ id: 'form_bp_general_id', region: 'center', autoScroll: true, buttonAlign: 'left', title: "Cetak Kartu Ujian", bodyStyle: 'padding: 5px', border: false, //disabled: true, waitMsg: 'Waiting...', maskDisabled: false, monitorValid: true, items: [{ xtype: 'fieldset', title: 'Filter', layout:'column', items: [{ columnWidth: .23, layout: 'form', labelAlign:'right', border: false, items: [ { xtype: 'combo', fieldLabel:'Tahun Akademik - Semester', id: 'thnakademik', name: 'thnakademik', width:150, store: ds_thnakademik2, triggerAction: 'all', editable: false, disabled: true, valueField: 'kdstsemester', displayField: 'nmthnakademik', forceSelection: true, submitValue: true, emptyText: 'Pilih...', hiddenName: 'h_thakademik', typeAhead: true, mode: 'local', selectOnFocus: true, listeners: { select: function(){ enable_btn_spp(); } } }, ] },{ columnWidth: .20, layout: 'form', labelAlign:'right', border: false, items: [ { xtype: 'textfield', id: 'id_kdprodi', width:100, hidden: true, }, { xtype: 'textfield', id: 'id_jnskelas', width:100, hidden: true, }, { xtype: 'textfield', id: 'id_thnmasuk', width:100, hidden: true, }, ] },{ columnWidth: .25, layout: 'form', labelAlign:'right', border: false, items: [ { xtype: 'combo', fieldLabel:'Jenis Ujian', id: 'id_jujian', name: 'id_jujian', width:120, store: ds_jujian, triggerAction: 'all', editable: false, valueField: 'idjnsujian', displayField: 'nmjnsujian', forceSelection: true, submitValue: true, emptyText: 'Pilih...', hiddenName: 'h_jujian', typeAhead: true, hidden: false, mode: 'local', emptyText: 'Belum Dipilih...', selectOnFocus: true, listeners: { select: function(){ enable_btn_spp(); } } }, ] }, { columnWidth: .10, layout: 'form', labelAlign:'right', border: false, items: [ { xtype: 'button', text: 'Periksa DPP dan DPK', iconCls: 'silk-money', disabled: true, id: 'btn_spp', width: 3, handler: function() { cek_spp(); } } ], },{ columnWidth: .21, layout: 'form', labelAlign:'right', border: false, items: [ { xtype: 'button', text: 'Cetak', iconCls: 'silk-printer', disabled: true, id: 'btn_cetak', width: 3, handler: function() { printKartuUjian(); } }, ] }, { xtype: 'textfield', hidden: true, id: 'idsmtmsk', }, { xtype: 'textfield', hidden: true, id: 'idsmtskrg', }] }, { xtype: 'fieldset', title: 'Informasi', id: 'id_informasi', hidden: true, width: 300, //layout:'column', items: [{ xtype: 'numericfield', fieldLabel: 'Biaya Kuliah', id: 'info_biaya', width: 150, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', }, { xtype: 'numericfield', fieldLabel: 'Jumlah Bayar', id: 'info_jmlbayar', width: 150, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', }, { xtype: 'textfield', fieldLabel: 'Persen Bayar', style: 'text-align: right', id: 'info_persenbayar', width: 150, readOnly:true }, { xtype: 'numericfield', fieldLabel: 'Sisa Tunggakan', id: 'info_sisabayar', width: 150, useThousandSeparator: true, thousandSeparator: '.', }, { xtype: 'label', id: 'info_label1', style: 'font-size:100%; color:red;', margins: '0 0 0 10', }, { xtype: 'label', id: 'info_label2', style: 'font-size:100%; color:blue;', margins: '0 0 0 10', }] }, { xtype: 'label', id: 'info_mhs', style: 'font-size:200%; color:red;', margins: '0 0 0 10', }, { xtype: 'label', id: 'label_jmlbayar', style: 'font-size:200%; color:red;', margins: '0 0 0 10', }, { xtype: 'label', id: 'info_mhs2', style: 'font-size:200%; color:blue;', margins: '0 0 0 10', }], listeners: { afterrender: get_attribute } }); get_content(form_bp_general); //FUNCTION - FUNCTION function get_attribute() { ds_thnakademik2.load({ scope : this, callback: function(records, operation, success) { Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_cetak_kartu_ujian/form_mhs', method: 'POST', params: { nim: USERID, }, 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.getCmp("id_kdprodi").setValue(r.kdprodi); Ext.getCmp("thnakademik").setValue(r.kdstsemester); Ext.getCmp("id_jnskelas").setValue(r.idjnskls); Ext.getCmp("id_thnmasuk").setValue(r.tahunmsk); Ext.getCmp("thnakademik").enable(); } }); } }); } function enable_btn_spp(){ var thn_akademik = Ext.getCmp('thnakademik').getValue(); var jns_ujian = Ext.getCmp('id_jujian').getValue(); if(thn_akademik && jns_ujian){ Ext.getCmp('btn_spp').enable(); } Ext.getCmp('btn_cetak').disable(); } function printKartuUjian(){ var kdstsemester = RH.getCompValue('thnakademik'); var kdprodi = RH.getCompValue('id_kdprodi'); var idjnsujian = RH.getCompValue('id_jujian'); var userid = USERID RH.ShowReport(BASE_URL + 'print/cetak_kartu_ujian/get_kartu_ujian/'+userid+'/'+kdprodi+'/'+kdstsemester+'/'+idjnsujian); } function cek_spp() { var waitmsg_loadspp = Ext.MessageBox.wait('Tunggu, sedang proses...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_cetak_kartu_ujian/cek_spp', method: 'POST', params: { nim:USERID, kdprodi:RH.getCompValue('id_kdprodi'), idjnskls:RH.getCompValue('id_jnskelas'), thnmasuk:RH.getCompValue('id_thnmasuk'), kdstsemester:RH.getCompValue('thnakademik'), }, success: function(response) { waitmsg_loadspp.hide(); var r = Ext.decode(response.responseText); if(r.status == false){ Ext.Ajax.request({ url: BASE_URL + 'user/ext_logout', method: 'POST', success: function(xhr) { localStorage.removeItem('access_token'); window.location = BASE_URL + 'user/login'; } }); } if (r) { Ext.getCmp("id_informasi").show(); Ext.getCmp("info_biaya").setValue(r.biaya); Ext.getCmp("info_jmlbayar").setValue(r.jmlbayar); Ext.getCmp("info_persenbayar").setValue(parseInt(r.persenbayar) + ' %'); Ext.getCmp("info_sisabayar").setValue(r.sisa); if (RH.getCompValue('id_jujian')=='1') { //UTS if(parseInt(r.persenbayar) < r.mindpputs){ Ext.getCmp("info_label1").setText("Maaf, Anda Belum Bisa Cetak Kartu Ujian, " + "Pembayaran DPP untuk Ujian " + Ext.getCmp("id_jujian").getRawValue() + " Minimal " + r.mindpputs + " %"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } else { if (RH.getCompValue('id_thnmasuk') <= 2016) { // validasi dpk berlaku tahun angkatan 2013 //if (RH.getCompValue('id_thnmasuk') >= 2016) { var waitmsg_loaddpk = Ext.MessageBox.wait('Tunggu, sedang proses...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_cetak_kartu_ujian/get_data_cekdpk', method: 'POST', params: { nim:USERID, thnmasuk:RH.getCompValue('id_thnmasuk'), kdprodi:RH.getCompValue('id_kdprodi'), kdstsemester:RH.getCompValue('thnakademik'), }, 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'; } }); } waitmsg_loaddpk.hide(); var read = Ext.decode(response.responseText); if(read.stlunas == 'Lunas'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else if(read.stlunas == 'Belum Lunas'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf, DPK Belum Lunas, untuk lebih jelasnya silahkan cek Tagihan DPK anda ke bagian loket SPP"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } }); }else{ var waitmsg_loaddpk = Ext.MessageBox.wait('Tunggu, sedang proses...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_cetak_kartu_ujian/get_data_cekdpk', method: 'POST', params: { nim:USERID, thnmasuk:RH.getCompValue('id_thnmasuk'), kdprodi:RH.getCompValue('id_kdprodi'), kdstsemester:RH.getCompValue('thnakademik'), }, 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'; } }); } waitmsg_loaddpk.hide(); var read = Ext.decode(response.responseText); if(read.stlunas == 'Lunas'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else if(read.bayar > '1000000'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else{ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf DPK Belum Lunas, untuk lebih jelasnya silahkan cek Tagihan DPK anda ke bagian loket SPP"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } }); } } } else if (RH.getCompValue('id_jujian')=='2') { //UAS if(parseInt(r.persenbayar) < r.mindppuas){; Ext.getCmp("info_label1").setText("Maaf, Anda Belum Bisa Cetak Kartu Ujian, " + "Pembayaran DPP untuk Ujian " + Ext.getCmp("id_jujian").getRawValue() + " Minimal " + r.mindppuas + " %"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } else { if (RH.getCompValue('id_thnmasuk') <= 2016) { // validasi dpk berlaku tahun angkatan 2013 //if (RH.getCompValue('id_thnmasuk') >= 2016) { var waitmsg_loaddpk = Ext.MessageBox.wait('Tunggu, sedang proses...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_cetak_kartu_ujian/get_data_cekdpk', method: 'POST', params: { nim:USERID, thnmasuk:RH.getCompValue('id_thnmasuk'), kdprodi:RH.getCompValue('id_kdprodi'), kdstsemester:RH.getCompValue('thnakademik'), }, 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'; } }); } waitmsg_loaddpk.hide(); var read = Ext.decode(response.responseText); if(read.stlunas == 'Lunas'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else if(read.stlunas == 'Belum Lunas'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf DPK Belum Lunas, untuk lebih jelasnya silahkan cek Tagihan DPK anda ke bagian loket SPP"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } }); }else{ var waitmsg_loaddpk = Ext.MessageBox.wait('Tunggu, sedang proses...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'e_akademic/c_cetak_kartu_ujian/get_data_cekdpk', method: 'POST', params: { nim:USERID, thnmasuk:RH.getCompValue('id_thnmasuk'), kdprodi:RH.getCompValue('id_kdprodi'), kdstsemester:RH.getCompValue('thnakademik'), }, 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'; } }); } waitmsg_loaddpk.hide(); var read = Ext.decode(response.responseText); if(read.stlunas == 'Lunas'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else if(read.stlunas == 'Belum Lunas'){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf DPK Belum Lunas, untuk lebih jelasnya silahkan cek Tagihan DPK anda ke bagian loket SPP"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } }); } } } } } }); } /*function smtskrg(){ var thnmsk = Ext.getCmp('idsmtmsk').getValue(); Ext.Ajax.request({ url: BASE_URL + 'rptkeu_controller/get_smstskrg', method: 'POST', params :{ tahunangkatan: thnmsk }, scope: this, async:false, success: function(result){ var jsonData = Ext.decode(result.responseText); //bisa utk Ext3 dan Ext4 var dataArray = jsonData.data; var data = dataArray[0]; RH.setCompValue('idsmtskrg', data.semester); if(data.semester == 1){ if(smt1 == 500000){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else{ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf, DPK harus Lunas minimal Rp.500.000 per semester"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } else if(data.semester == 2){ if(smt2 == 500000){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else{ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf, DPK harus Lunas minimal Rp.500.000 per semester"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } else if(data.semester == 3){ if(smt3 == 500000){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else{ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf, DPK harus Lunas minimal Rp.500.000 per semester"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } else if(data.semester == 4){ if(smt4 == 500000 || smt5 == 500000){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else{ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf, DPK harus Lunas minimal Rp.500.000 per semester"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } /* else if(data.semester == 5){ if(smt5 == 500000){ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").hide(); Ext.getCmp("info_label2").show(); Ext.getCmp("info_label2").setText("Silahkan Cetak Kartu Ujian Anda"); Ext.getCmp("btn_cetak").enable(); }else{ Ext.getCmp("id_informasi").show(); Ext.getCmp("info_label1").setText("Maaf, DPK harus Lunas minimal 500.000/semester"); Ext.getCmp("btn_cetak").disable(); Ext.getCmp("info_label2").hide(); Ext.getCmp("info_label1").show(); } } // } }); }*/ }