Files
master/apps/js/sys/akses_ren.js
T
2026-07-16 14:07:54 +07:00

91 lines
3.0 KiB
JavaScript

/*******************************************************************
App. Name : SISTEM INFORMASI PERENCANAAN PEMBANGUNAN DAERAH
Module : /apps/js/sys/akses_sip.js
Desc. : JS - Konfigurasi Hak Akses Data e-Planning
Created By : Siau Pheng ([email protected]).
Created Date : February 17th, 2020.
Last Modified : February, 2022.
(c) 2020 - 2022, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var TAksesRJS = {
PHP: '',
KODE: '',
loading: function(){
this.data_query('detail');
$('#Cari_OPD').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_OPD').val('');
this.data_query('detail');
});
$('#butUpAll').click(() => this.update_all());
FoniaJS.setFocus('#Cari_OPD');
},
update_all: function(){
new Request({
url: this.PHP,
sendParam: ['data=akses-semua','RPJMDID'],
onSuccess: (txt) => {
this.winSemua = FoniaJS.showWindow('Semua', 'Ubah Semua Hak Akses Sekaligus', txt, 'md', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winSemua').find('#butWSimpan').click(() => this.update_proc());
});
}
}).send();
},
update_proc: function(){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','mode=save-all','RPJMDID','Hak_Renstra','Hak_RPJMD'],
onSuccess: () => FoniaJS.closeWindow(this.winSemua)
}).send();
},
detail_show: function(mode, OPDID, AksesID){
new Request({
url: this.PHP,
sendParam: ['data=akses-detail','mode='+mode,'RPJMDID','OPDID='+OPDID,'AksesID='+AksesID],
onSuccess: (txt) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Konfigurasi Hak Akses', txt, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_ubah: function(acell){
this.detail_show('edit', acell[0], acell[1]);
},
detail_save: function(){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','mode=save','RPJMDID','AksesID','OPDID','Hak_Renstra','Hak_RPJMD'],
onSuccess: () => FoniaJS.closeWindow(this.winDetail)
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP,
sendParam: ['data=detail','RPJMDID','Cari_OPD']
}).send()
}
},
oc_RPJMD: function(){
this.data_query('detail');
}
};