91 lines
3.0 KiB
JavaScript
91 lines
3.0 KiB
JavaScript
/*******************************************************************
|
|
|
|
App. Name : SISTEM INFORMASI PERENCANAAN PEMBANGUNAN DAERAH
|
|
Module : /apps/js/sys/akses_mus.js
|
|
Desc. : JS - Konfigurasi Hak Akses Data e-Musrenbang
|
|
Created By : Siau Pheng ([email protected]).
|
|
Created Date : February 17th, 2020.
|
|
Last Modified : July 19th, 2020.
|
|
|
|
(c) 2020, 3FONIA Software; WWW.3FONIA.COM.
|
|
|
|
*******************************************************************/
|
|
|
|
var TAksesMJS = {
|
|
PHP: '',
|
|
KODE: '',
|
|
|
|
loading: function(){
|
|
$('#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());
|
|
this.data_query('detail');
|
|
FoniaJS.setFocus('#Cari_OPD');
|
|
},
|
|
|
|
update_all: function(){
|
|
new Request({
|
|
url: this.PHP,
|
|
sendParam: ['data=akses-semua','Tahun'],
|
|
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','Tahun','Hak_Usulan','Hak_Prioritas'],
|
|
onSuccess: () => FoniaJS.closeWindow(this.winSemua)
|
|
}).send();
|
|
},
|
|
|
|
detail_show: function(mode, KecID, AksesID){
|
|
new Request({
|
|
url: this.PHP,
|
|
sendParam: ['data=akses-detail','mode='+mode,'Tahun','KecID='+KecID,'AksesID='+AksesID],
|
|
onSuccess: (txt) => {
|
|
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Konfigurasi Hak Akses', txt, 'md', [{},{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','Tahun','AksesID','KecID','Hak_Usulan','Hak_Prioritas'],
|
|
onSuccess: () => FoniaJS.closeWindow(this.winDetail)
|
|
}).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');
|
|
}
|
|
|
|
};
|