Files
cmasa/app/Scripts/ppob/topup.js
T
siaupheng aaaf0a9215 Refactor member and product scripts to use concise method definitions
- Updated all function declarations to use ES6 shorthand method syntax in member.js, member_grup.js, point_barang.js, point_skema.js, point_tipe.js, kategori.js, operator.js, produk.js, produk_grup.js, rekpos.js, satuan.js, supplier.js, and varian.js.
2026-11-01 14:57:54 +07:00

72 lines
2.3 KiB
JavaScript

/*******************************************************************
PHP Class : /Controller/Ppob/TopupController
Description : Transaksi Topup Saldo PPOB
Created By : Siau Pheng ([email protected]).
Created Date : October 6th, 2017.
Last Modified : September 16th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var TopupJS = {
PHP: '',
KODE: '',
index() {
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(acell) {
this.winInfo = FoniaJS.showWindow('', 'Informasi Topup Saldo', '<div class="form-control fs-4">'+acell[6]+'</div>', 'md');
},
tx_tambah() {
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() {
if (parseInt($('#Jumlah').val())==0) {
FoniaJS.showError('Silakan isi Jumlah lebih dari NOL !');
$('#Jumlah').focus();
return;
}
new Request_JSF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=insert','Tgl_Depo','Jumlah','Bank'],
onSuccess: () => FoniaJS.closeWindow(this.winDetail)
}).send();
},
data_query(tipe) {
if (tipe=="tabel-detail"){
new Request_JSF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Topup']
}).send();
}
}
};