first commit

This commit is contained in:
2026-10-29 13:34:31 +07:00
commit 45e4595c57
255 changed files with 35457 additions and 0 deletions
+129
View File
@@ -0,0 +1,129 @@
/*******************************************************************
PHP Class : /Controller/System/MenugrupController
Description : Grup Login Menu
Created By : Siau Pheng ([email protected]).
Created Date : August 8th, 2013.
Last Modified : August 19th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MenuGrupJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query();
$('#Cari_Grup').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query();
});
$('#butSearch').click((e) => this.data_query());
$('#butAll').click(() => {
$('#Cari_Grup').val('');
this.data_query();
});
FoniaJS.setFocus('#Cari_Grup');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/detail_grup',
sendParam: ['mode='+mode,'Grup_MenuID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Grup Menu', ajson.html, 'lg', [{},{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]+"?", function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode=del','Grup_MenuID='+acell[0],'Cari_Grup'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}.bind(this), 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','Grup_MenuID','Nama_Grup','Ket','Aktif','Cari_Grup'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
menu_show: function(acell){
new Request({
url: this.PHP + '/detail_menu',
sendParam: ['Grup_MenuID='+acell[0]],
onSuccess: (ajson) => {
this.winMenu = FoniaJS.showWindow('Menu', 'Hak Akses Modul', ajson.html, 'lg', [{i:'butWSelAll',v:'Pilih Semua',c:'info'},{i:'butWClrAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winMenu')
.find('#butWSelAll').click(() => this.menu_ceksemua()).end()
.find('#butWClrAll').click(() => this.menu_hapussemua()).end()
.find('#butWSimpan').click(() => this.menu_simpan()).end()
.find('#tabMenuList input.form-check-input[class*=cek-modul][type=checkbox]').each((i, el) => {
const elm = $(el);
elm.on('change', () => {
$('#tabMenuList tbody input.form-check-input[class*='+elm.attr('omodul')+'][type=checkbox]').map((i, b) => {
$(b).prop('checked', elm.is(':checked'));
});
});
});
});
}
}).send();
},
menu_ceksemua: function(){
$('#tabMenuList input.form-check-input[type=checkbox]').prop('checked', true);
},
menu_hapussemua: function(){
$('#tabMenuList input.form-check-input[type=checkbox]').prop('checked', false);
},
menu_simpan: function(){
var alist = [];
$('#tabMenuList tbody input.form-check-input[type=checkbox]:checked').map((i, b) => {
alist.push($(b).val());
});
new Request({
url: this.PHP + '/save_menu',
sendParam: ['Grup_MenuID','Menu='+alist],
onSuccess: (ajson) => {
if (ajson.status==true){
FoniaJS.showInfo('Proses simpan data sukses!');
}else{
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
}
FoniaJS.closeWindow(this.winMenu);
}
}).send();
},
data_query: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Grup'],
}).send()
}
};