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
+104
View File
@@ -0,0 +1,104 @@
/*******************************************************************
PHP Class : /Controller/System/AboutController
Description : Informasi Aplikasi
Created By : Siau Pheng ([email protected]).
Created Date : November 23th, 2011.
Last Modified : August 13th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var AboutJS = {
PHP: '',
KODE: '',
index: function(){
$('#win'+this.KODE).find('#divBuildInfo').html('<p>Aplikasi dibuat dengan komponen :<br>- jQuery Version '+$().jquery+' <br>- Bootstrap Version '+$.fn.tooltip.Constructor.VERSION+' <br>- FoniaJS Version '+FoniaJS.version+' <br>- FoniaPHP Version '+FoniaJS.version+'</p>');
$('#butDBCek').click(() => this.db_check());
$('#butDBOpti').click(() => this.db_opti());
$('#butUpdateCek').click(() => this.update_check());
},
db_check: function(){
new Request({
url: this.PHP + '/db_check',
onSuccess: (ajson) => {
this.winCheck = FoniaJS.showWindow('CekDB', 'Cek Database', ajson.html, 500, [{},{i:'butTutup'}], () => this.db_run(ajson.db_count));
}
}).send();
},
db_opti: function(){
new Request({
url: this.PHP + '/db_check',
onSuccess: (ajson) => {
this.winCheck = FoniaJS.showWindow('CekDB', 'Optimalisasi Database', ajson.html, 500, [{},{i:'butTutup'}], () => this.opti_run(ajson.db_count));
}
}).send();
},
update_check: function(){
new Request({
url: this.PHP + '/update_check',
onSuccess: (ajson) => {
var tomb = [{},{i:'butTutup'},{i:'butWUpdate',v:'Proses Update !',c:'success'}];
if (ajson.is_update) tomb.pop();
this.winUpdate = FoniaJS.showWindow('CekApp', 'Cek dan Update Aplikasi', ajson.html, 500, tomb, () => {
$('#winCekApp').find('#butWUpdate').click(() => this.update_run());
});
}
}).send();
},
db_run: function(db_count = 0){
if (db_count === 0) return false;
var items = Array(db_count).fill(0).map((_, index) => index);
var $ul = $('#db-list').empty();
items.reduce((prev, curr) => {
return prev.then(() => {
return $.ajax({
url: this.PHP + '/db_proses',
data: {'Nomor': curr},
dataType: 'json',
type: 'POST',
}).done((response) => {
$ul.append('<li>' + response.html + '</li>');
});
});
}, $.Deferred().resolve().promise());
},
opti_run: function(db_count = 0){
if (db_count === 0) return false;
var items = Array(db_count).fill(0).map((_, index) => index);
var $ul = $('#db-list').empty();
items.reduce((prev, curr) => {
return prev.then(() => {
return $.ajax({
url: this.PHP + '/opti_proses',
data: {'Nomor': curr},
dataType: 'json',
type: 'POST',
}).done((response) => {
$ul.append('<li>' + response.html + '</li>');
});
});
}, $.Deferred().resolve().promise());
},
update_run: function(){
new Request({
url: this.PHP + '/update_proses',
onSuccess: (adata) => {
if (adata.success==true) {
$('#spanStatus').html(adata.message);
FoniaJS.showInfo('Aplikasi telah di Update.<br>Silakan refresh browser Anda!');
} else {
FoniaJS.showInfo('Aplikasi gagal di Update.');
}
}
}).send();
}
};
+55
View File
@@ -0,0 +1,55 @@
/*******************************************************************
PHP Class : /Controller/System/ChpasswdController
Description : Data Ubah Password
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2008.
Last Modified : August 9th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SYSChpasswdJS = {
PHP: '',
KODE: '',
index: function(){
$('#butSave').click(() => this.proses_save());
FoniaJS.setFocus('#LPass');
},
proses_save: function(){
if ($("#LPass").val()=="") {
FoniaJS.showInfo("Silakan masukkan password lama Anda!");
FoniaJS.setFocus("#LPass");
return false;
} else if ($("#BPass1").val()=="") {
FoniaJS.showInfo("Silakan masukkan password baru 1 Anda!");
FoniaJS.setFocus("#BPass1");
return false;
} else if ($("#BPass2").val()=="") {
FoniaJS.showInfo("Silakan masukkan password baru 2 Anda!");
FoniaJS.setFocus("#BPass2");
return false;
} else if ($("#BPass1").val()!=$("#BPass2").val()) {
FoniaJS.showInfo("Password baru 1 dan 2 Anda tidak sama!");
FoniaJS.setFocus("#BPass1");
return false;
}
new Request({
url: this.PHP + '/simpan',
sendParam: ['LPass','BPass1'],
onSuccess: (ajson) => {
if (ajson.status == true) {
FoniaJS.showInfo(ajson.message);
FoniaJS.closeWindow('#win'+this.KODE);
} else {
FoniaJS.showError(ajson.message);
}
}
}).send();
}
};
+59
View File
@@ -0,0 +1,59 @@
/*******************************************************************
PHP Class : /Controller/System/ConfigController
Description : Konfigurasi Informasi Perusahaan
Created By : Siau Pheng ([email protected]).
Created Date : May 25th, 2010.
Last Modified : August 14th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var ConfigJS = {
PHP: '',
KODE: '',
index: function(){
$('#butUbah').click(() => this.proses_edit());
$('#butSimpan').click(() => this.proses_save());
this.data_query('view');
},
proses_edit: function(){
this.data_query('edit');
},
proses_save: function(){
new Request({
url: this.PHP + '/config',
sendParam: ['mode=save','REG_ID','REG_ADDRESS','REG_CITY','REG_POSTCODE','REG_PHONE','REG_EMAIL','REG_OWNER','REG_NPWP'],
onSuccess: (ajson) => {
$('#divMaster').html(ajson.html);
this.update_event();
}
}).send()
},
data_query: function(mode){
new Request({
url: this.PHP + '/config',
sendParam: ['mode='+mode],
onSuccess: (ajson) => {
$('#divMaster').html(ajson.html);
this.update_event();
}
}).send()
},
update_event: function(){
if ($.inArray($('#mode').val(), ['edit']) !== -1) {
$("#butUbah").prop('disabled', true);
$("#butSimpan").prop('disabled', false);
} else {
$("#butUbah").prop('disabled', false);
$("#butSimpan").prop('disabled', true);
}
}
};
+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()
}
};
+187
View File
@@ -0,0 +1,187 @@
/*******************************************************************
PHP Class : /Controller/System/OperatorController
Description : Data Pengguna
Created By : Siau Pheng ([email protected]).
Created Date : August 1st, 2008.
Last Modified : August 27th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var OperatorJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_User').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_User').val('');
this.data_query('detail');
});
$('#butFilter').click(() => this.filter_show());
FoniaJS.setFocus('#Cari_User');
},
filter_show: function(){
new Request({
url: this.PHP + '/detail_filter',
sendParam: ['Filter_Level'],
onSuccess: (ajson) => {
this.winFilter = FoniaJS.showWindow('FLevel', 'Filter Data Pengguna / Level', ajson.html, 400, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winFLevel')
.find('#butWSimpan').click(() => this.filter_simpan()).end()
.find('#Fi_Level').focus();
});
}
}).send();
},
filter_simpan: function(){
$('#Filter_Level').val($('#Fi_Level').val());
FoniaJS.closeWindow(this.winFilter);
this.data_query('detail');
},
detail_show: function(mode, UserID){
new Request({
url: this.PHP + '/detail_user',
sendParam: ['mode='+mode,'UserID='+UserID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Pengguna', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_check());
this.oc_Level();
});
}
}).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]+"] "+acell[2]+"?", () => {
new Request({
url: this.PHP + '/save_user',
sendParam: ['mode=del','UserID='+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_check: function(){
if ($('#Username').val().toUpperCase()==$('#UserLama').val().toUpperCase()) {
this.detail_save();
return;
}
new Request({
url: this.PHP + '/check_user',
sendParam: ['Username'],
onSuccess: (adata) => {
if (adata.ada==true) {
FoniaJS.showInfo("Username telah ada dalam sistem !");
} else {
this.detail_save();
}
}
}).send();
},
detail_save: function(){
new Request({
url: this.PHP + '/save_user',
sendParam: ['mode','UserID','Username','Nama','Posisi','Level','Password','Grup_MenuID','Aktif'],
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();
},
menu_show: function(acell){
new Request({
url: this.PHP + '/detail_menu',
sendParam: ['UserID='+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 thead input[type="checkbox"]:disabled').prop('indeterminate', true).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]:not(:disabled)').prop('checked', true);
},
menu_hapussemua: function(){
$('#tabMenuList input.form-check-input[type=checkbox]:not(:disabled)').prop('checked', false);
},
menu_simpan: function(){
var alist = [];
$('#tabMenuList tbody input.form-check-input[type=checkbox]:not(:disabled):checked').map((i, b) => {
alist.push($(b).val());
});
new Request({
url: this.PHP + '/save_menu',
sendParam: ['UserID','Menu='+alist],
onSuccess: (adata) => {
if (adata.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(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Filter_Level','Cari_User']
}).send()
}
},
oc_Level: function(){
}
};
+73
View File
@@ -0,0 +1,73 @@
/*******************************************************************
PHP Class : /Controller/System/PrinterController
Description : Printer POS
Created By : Siau Pheng ([email protected]).
Created Date : August 4th, 2013.
Last Modified : October 12th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PrinterJS = {
PHP: '',
KODE: '',
index: function(){
$('#butBrow').click(() => this.cab_brow());
$('#butUbah').click(() => this.proses_edit());
$('#butSimpan').click(() => this.proses_save());
this.data_query('form-printer');
},
cab_brow: function(){
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', '<div id="divBrowCab">&nbsp;</div>', 'lg', '', () => this.data_query('brow-cabang'));
},
cab_select: function(acell){
FoniaJS.closeWindow(this.winBCab);
$('#REG_ID').val(acell[0]);
this.data_query('form-printer', 'view');
},
proses_edit: function(){
this.data_query('form-printer', 'edit');
},
proses_save: function(){
this.data_query('form-printer', 'save');
},
data_query: function(tipe, mode){
if (tipe === 'form-printer'){
new Request({
url: this.PHP + '/form_printer',
sendParam: ['mode='+mode,'REG_ID','PRINT_AUTO','PRINT_OPENCD','PRINT_AUTOCUT','PRINT_ROW','TITLE_BEGIN','TITLE_END'],
onSuccess: (ajson) => {
$('#divPrinter').html(ajson.html);
$('#Nama_Cabang').val(ajson.Nama_Cab);
this.update_event();
if (ajson.sukses) FoniaJS.showInfo('Konfigurasi printer sukses disimpan!');
}
}).send();
} else if (tipe=='brow-cabang'){
new Request.JSONF({
url: this.PHP + '/brow_cabang',
}).send();
}
},
update_event: function(){
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
$('#butBrow').prop('disabled', true);
$('#butUbah').prop('disabled', true);
$('#butSimpan').prop('disabled', false);
} else {
$('#butBrow').prop('disabled', false);
$('#butUbah').prop('disabled', false);
$('#butSimpan').prop('disabled', true);
}
}
};
+65
View File
@@ -0,0 +1,65 @@
/*******************************************************************
PHP Class : /Controller/System/ProfileController
Description : Profile Pengguna
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2008.
Last Modified : August 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SYSProfileJS = {
PHP: '',
KODE: '',
index: function(){
$('#butSave').click(() => this.save_profile());
$('#win'+this.KODE).find('#FileGambar').off('change').change(() => {
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
fd.append('Gambar1', files);
$.ajax({
url: this.PHP + '/upload_picture',
type: 'post',
data: fd,
contentType: false,
processData: false,
success: (ares) => {
if (ares.result !== 0){
FoniaJS.showInfo('Sukses upload gambar profile !');
this.get_picture();
} else {
FoniaJS.showError(ares.message);
}
}
});
});
this.get_picture();
},
save_profile: function(){
new Request({
url: this.PHP + '/save_profile',
sendParam: ['Nama','Posisi','Email','HP'],
onSuccess: (ajson) => {
if (ajson.status == true) {
FoniaJS.showInfo('Sukses simpan profile!');
FoniaJS.closeWindow('#win'+this.KODE);
} else {
FoniaJS.showError('Ada masalah dalam simpan profile!');
}
}
}).send();
},
get_picture: function(){
new Request({
url: this.PHP + '/get_picture',
onSuccess: (ajson) => {
$('#imgPhoto').attr('src', ajson.src);
}
}).send();
}
};
+35
View File
@@ -0,0 +1,35 @@
/*******************************************************************
PHP Class : /Controller/System/SuperController
Description : Supervisi Operator
Created By : Siau Pheng ([email protected]).
Created Date : September 11st, 2012.
Last Modified : August 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SuperJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query();
if ($('#divSuper').length > 0 && socket.active) socket.emit('super-check');
},
detail_select: function(acell){
new Request({
url: this.PHP + '/approve',
sendParam: ['AuthID='+acell[0]],
onSuccess: () => this.data_query()
}).send();
},
data_query: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
}).send();
}
};