/******************************************************************* PHP Class : /Controller/Ppob/TopupController Description : Transaksi Topup Saldo PPOB Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : October 6th, 2017. Last Modified : September 16th, 2026. (c) 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var TopupJS = { PHP: '', KODE: '', index: function(){ this.data_query('tabel-detail'); $('#butTambah').click(() => this.tx_tambah()); $('#Cari_Topup').keydown((e) => { var key = e.keyCode || e.which || 0; if (key==13 && e.target.value!='') this.data_query('tabel-detail'); }); $('#butSearch').click(() => this.data_query('tabel-detail')); $('#butAll').click(() => { $('#Cari_Topup').val(''); this.data_query('tabel-detail'); }); FoniaJS.setFocus('#Cari_Topup'); }, tx_info: function(acell){ this.winInfo = FoniaJS.showWindow('', 'Informasi Topup Saldo', '
'+acell[6]+'
', 'md'); }, tx_tambah: function(){ new Request({ url: this.PHP + '/form_topup', onSuccess: (a) => { this.winDetail = FoniaJS.showWindow('Detail', 'Detail Topup Saldo', a.html, 'md', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => { $('#winDetail') .find('#butWSimpan').click(() => this.tx_simpan()).end() .find('#Jumlah').click(() => $('#Jumlah').select()); }); } }).send(); }, tx_simpan: function(){ if (parseInt($('#Jumlah').val())==0) { FoniaJS.showError('Silakan isi Jumlah lebih dari NOL !'); $('#Jumlah').focus(); return; } new Request.JSONF({ url: this.PHP + '/table_detail', sendParam: ['mode_detail=insert','Tgl_Depo','Jumlah','Bank'], onSuccess: () => FoniaJS.closeWindow(this.winDetail) }).send(); }, data_query: function(tipe){ if (tipe=="tabel-detail"){ new Request.JSONF({ url: this.PHP + '/table_detail', sendParam: ['Cari_Topup'] }).send(); } } };