/******************************************************************* App. Name : SISTEM INFORMASI PERENCANAAN PEMBANGUNAN DAERAH Module : /apps/js/tab/rpjmd.js Desc. : JS - Konfigurasi Periode RPJMD Created By : Siau Pheng (siaupheng@3fonia.com). Created Date : May 16th, 2012. Last Modified : July 18th, 2020. (c) 2012 - 2020, 3FONIA Software; WWW.3FONIA.COM. *******************************************************************/ var TRPJMDJS = { PHP: '', KODE: '', loading: function(){ this.data_query('detail'); $('#Cari_RPJMD').keydown((e) => { var key = e.keyCode || e.which || 0; if (key==13 && e.target.value!='') this.data_query('detail'); }); $('#butSearch').click(() => this.data_query('detail')); $('#butAll').click(() => { $('#Cari_RPJMD').val(''); this.data_query('detail'); }); FoniaJS.setFocus('#Cari_RPJMD'); }, detail_show: function(mode, RPJMDID){ new Request({ url: this.PHP, sendParam: ['data=rpjmd-detail','mode='+mode,'RPJMDID='+RPJMDID], onSuccess: (txt) => { this.winDetail = FoniaJS.showWindow('Detail', 'Detail RPJMD', txt, 'md', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => { $('#winDetail').find('#butWSimpan').click(() => this.detail_save()); }); } }).send(); }, detail_tambah: function(){ this.detail_show('add', 0); }, detail_ubah: function(acell){ this.detail_show('edit', acell[0]); }, detail_hapus: function(acell){ FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus "'+acell[1]+'" ?', () => { new Request.JSON({ url: this.PHP, sendParam: ['data=save','mode=del','RPJMDID='+acell[0]], onSuccess: (adata) => { if (adata.status==true){ this.data_query('detail'); FoniaJS.showInfo('Proses hapus data sukses!'); }else{ FoniaJS.showInfo('Ada masalah dalam proses hapus data!'); } } }).send(); }, 'danger'); }, detail_save: function(){ new Request.JSONF({ url: this.PHP, sendParam: ['data=save','mode','RPJMDID','Ket','Tahun1','Tahun2','Tahun3','Tahun4','Tahun5','Tahun6'], onSuccess: (adata) => { if (adata.status==true){ this.data_query('detail'); FoniaJS.showInfo('Proses simpan data sukses!'); }else{ FoniaJS.showInfo('Ada masalah dalam proses simpan data!'); } FoniaJS.closeWindow(this.winDetail); } }).send(); }, data_query: function(tipe, mode){ if (tipe=="detail"){ new Request.JSONF({ url: this.PHP, sendParam: ['data=detail','Cari_RPJMD'] }).send(); } } };