/******************************************************************* App. Name : SISTEM INFORMASI PERENCANAAN PEMBANGUNAN DAERAH Module : /apps/js/tab/opd_pagu.js Desc. : JS - Tabel Master Pagu OPD Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : December 7th, 2010. Last Modified : July 31st, 2020. (c) 2010 - 2020, 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var TOPDPaguJS = { PHP: '', KODE: '', loading: function(){ this.data_query('detail'); $('#Cari_OPD').keydown(function(e){ var key = e.keyCode || e.which || 0; if (key==13 && e.target.value!='') this.data_query('detail'); }.bind(this)); $('#butSearch').click(function(e){ this.data_query('detail'); }.bind(this)); $('#butAll').click(function(){ $('#Cari_OPD').val(''); this.data_query('detail'); }.bind(this)); FoniaJS.setFocus('#Cari_OPD'); }, detail_show: function(OPID, OPDID){ new Request({ url: this.PHP, sendParam: ['data=opdpagu-detail','Tahun','OPDPAGUID='+OPID,'OPDID='+OPDID], onSuccess: function(txt){ this.winDetail = FoniaJS.showWindow('Detail', 'Detail Pagu OPD', txt, 600, '_,WK,WS', function(){ $('#winDetail').find('#butWSave').click(function(){this.detail_save();}.bind(this)); }.bind(this)); }.bind(this) }).send(); }, detail_ubah: function(acell){ this.detail_show(acell[0], acell[1]); }, detail_hapus: function(acell){ FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus "'+acell[3]+'" ?', function(){ new Request.JSONF({ url: this.PHP, sendParam: ['data=detail','mode=del','OPDPAGUID='+acell[0]], onSuccess: function(){ FoniaJS.showInfo('Proses hapus data sukses!'); }.bind(this) }).send(); }.bind(this), 'danger'); }, detail_save: function(){ new Request.JSONF({ url: this.PHP, sendParam: ['data=detail','mode=save','Tahun','OPDPAGUID','OPDID','Pagu'], onSuccess: function(){ FoniaJS.closeWindow(this.winDetail); FoniaJS.showInfo('Proses simpan data sukses!'); }.bind(this) }).send(); }, data_query: function(tipe, mode){ if (tipe=="detail"){ new Request.JSONF({ url: this.PHP, sendParam: ['data=detail','Tahun','Cari_OPD'] }).send() } }, oc_Tahun: function(){ this.data_query('detail'); } };