/******************************************************************* PHP Class : /Controller/Table/Gel/GrupController Description : Master Grup Rekening Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : May 19th, 2010. Last Modified : September 4th, 2026. (c) 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var RekGrupJS = { PHP: '', KODE: '', index() { this.data_query('detail'); $('#Cari_Rek').keydown((e) => { var key = e.keyCode || e.which || 0; if (key==13 && e.target.value!='') this.data_query('detail'); }); $('#butSearch').click((e) => this.data_query('detail')); $('#butAll').click(() => { $('#Cari_Rek').val(''); this.data_query('detail'); }); FoniaJS.setFocus('#Cari_Rek'); }, detail_show(mode, ID) { new Request({ url: this.PHP + '/form_grup', sendParam: ['mode_detail='+mode,'Grup_RekID='+ID], onSuccess: (ajson) => { this.winDetail = FoniaJS.showWindow('Detail', 'Detail Grup Rekening', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => { $('#winDetail').find('#butWSimpan').click(() => this.detail_save()); }); } }).send(); }, detail_tambah() { this.detail_show('insert', 0); }, detail_ubah(acell) { this.detail_show('update', acell[0]); }, detail_hapus(acell) { FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus "'+acell[1]+'" ?', () => { new Request_JSF({ url: this.PHP + '/table_detail', sendParam: ['mode_detail=delete','Grup_RekID='+acell[0],'Cari_Rek'], onSuccess: () => { FoniaJS.showInfo('Proses hapus data sukses!'); } }).send(); }, 'danger'); }, detail_save() { new Request_JSF({ url: this.PHP + '/table_detail', sendParam: ['mode_detail','Grup_RekID','Nama_Grup','Aktif','Cari_Rek'], onSuccess: () => { FoniaJS.showInfo('Proses simpan data sukses!'); FoniaJS.closeWindow(this.winDetail); } }).send(); }, data_query(tipe, mode) { if (tipe=="detail"){ new Request_JSF({ url: this.PHP + '/table_detail', sendParam: ['Cari_Rek'] }).send(); } } };