first commit
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/about.js
|
||||
Desc. : JS - Informasi Aplikasi
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : November 23th, 2011.
|
||||
Last Modified : May 1st, 2022.
|
||||
|
||||
(c) 2011 - 2022, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var AboutJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: 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.phpversion+'</p>');
|
||||
},
|
||||
|
||||
proses_checkdb: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=check_db'],
|
||||
onSuccess: function(txt){
|
||||
this.winCheck = FoniaJS.showWindow('CekDB', 'Cek, Perbaiki dan Optimalisasi Database', txt, 500, [{},{i:'butTutup'},{i:'butWProses',v:'Proses DB !',c:'success'}], function(){
|
||||
$('#winCekDB').find('#butWProses').click(function(){this.checkdb_run();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_update: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=check_update'],
|
||||
onSuccess: function(txt){
|
||||
this.winUpdate = FoniaJS.showWindow('CekApp', 'Cek dan Update Aplikasi', txt, 500, [{},{i:'butTutup'},{i:'butWUpdate',v:'Proses Update !',c:'success'}], function(){
|
||||
$('#winCekApp').find('#butWUpdate').click(function(){this.update_run();}.bind(this));
|
||||
var tomb = $('#winCekApp').find('#butWUpdate');
|
||||
if ($('#file_online').val()==1){
|
||||
tomb.prop('disabled', false);
|
||||
} else {
|
||||
tomb.html('Telah Update!').prop('disabled', true);
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
checkdb_run: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=proses_db','DB_Cek','DB_Repair','DB_Opti'],
|
||||
onSuccess: function(txt){
|
||||
if ($('#DB_Hasil')) $('#DB_Hasil').removeClass('d-none').html(txt);
|
||||
FoniaJS.showInfo('Proses Database selesai', 2000);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
update_run: function(){
|
||||
if ($('#file_online')){
|
||||
if ($('#file_online').val()==1){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=proses_update','file_web','file_sql','file_build'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.sukses==true) {
|
||||
FoniaJS.showInfo('Aplikasi telah di Update.<br>Silakan Log Out dari Aplikasi<br>Lalu refresh browser Anda!');
|
||||
} else {
|
||||
FoniaJS.showInfo('Aplikasi gagal di Update.');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/chpasswd.js
|
||||
Desc. : JS - Perubahan Password Operator
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 7th, 2008.
|
||||
Last Modified : April 25th, 2020.
|
||||
|
||||
(c) 2008 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var SYSChpasswdJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butSave').click(function(){this.proses_save();}.bind(this));
|
||||
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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=chpasswd','LPass','BPass1','BPass2'],
|
||||
onSuccess: function(ajson){
|
||||
if (ajson.status == true) {
|
||||
FoniaJS.showInfo(ajson.msg);
|
||||
FoniaJS.closeWindow('#win'+this.KODE);
|
||||
} else {
|
||||
FoniaJS.showError(ajson.msg);
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/config.js
|
||||
Desc. : JS - Konfigurasi Aplikasi
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 25th, 2010.
|
||||
Last Modified : September 30th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var ConfigJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
this.data_query('view');
|
||||
},
|
||||
|
||||
proses_edit: function(){
|
||||
this.data_query('edit');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','mode=save','REG_ID','REG_ADDRESS','REG_CITY','REG_POSTCODE','REG_PHONE','REG_FAX','REG_WEBSITE','REG_EMAIL','REG_OWNER','REG_NPWP'],
|
||||
onSuccess: function(txt){
|
||||
$('#divMaster').html(txt);
|
||||
this.update_event();
|
||||
}.bind(this)
|
||||
}).send()
|
||||
},
|
||||
|
||||
data_query: function(mode){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','mode='+mode,'REG_ID'],
|
||||
onSuccess: function(txt){
|
||||
$('#divMaster').html(txt);
|
||||
this.update_event();
|
||||
}.bind(this)
|
||||
}).send()
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$("#butUbah").prop('disabled', true);
|
||||
$("#butSimpan").prop('disabled', false);
|
||||
} else {
|
||||
$("#butUbah").prop('disabled', false);
|
||||
$("#butSimpan").prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,146 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/menu_grup.js
|
||||
Desc. : JS - Manajemen Data Grup Login Menu
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 8th, 2013.
|
||||
Last Modified : January 1st, 2026.
|
||||
|
||||
(c) 2013 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var MenuGrupJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Grup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Grup').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=grup-detail','mode='+mode,'Grup_MenuID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Grup Menu', txt, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=del','Grup_MenuID='+acell[0]],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
this.data_query('detail');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode','Grup_MenuID','Nama_Grup','Ket','Aktif'],
|
||||
onSuccess: function(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);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_show: function(acell){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=menu','Grup_MenuID='+acell[0]],
|
||||
onSuccess: function(txt){
|
||||
this.winMenu = FoniaJS.showWindow('Menu', 'Hak Akses Modul', txt, 'lg', [{i:'butWSelAll',v:'Pilih Semua',c:'info'},{i:'butWClrAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winMenu')
|
||||
.find('#butWSelAll').click(function(){this.menu_ceksemua();}.bind(this)).end()
|
||||
.find('#butWClrAll').click(function(){this.menu_hapussemua();}.bind(this)).end()
|
||||
.find('#butWSimpan').click(function(){this.menu_simpan();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_cek: function(el){
|
||||
var t_modul = el.value, b_check = el.checked;
|
||||
$('#tabMenuList tbody input[type="checkbox"]').map(function(i, b){
|
||||
var t_menu = $(b);
|
||||
if (t_menu.hasClass(t_modul)) t_menu.prop('checked', b_check);
|
||||
});
|
||||
el.prop('checked', !b_check);
|
||||
},
|
||||
|
||||
menu_ceksemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]').prop('checked', true);
|
||||
},
|
||||
|
||||
menu_hapussemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]').prop('checked', false);
|
||||
},
|
||||
|
||||
menu_simpan: function(){
|
||||
var alist = $('#R_MENU').val().split(',');
|
||||
$('#tabMenuList tbody input[type="checkbox"]:checked').map(function(i, b){
|
||||
alist.push($(b).val());
|
||||
});
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save-menu','Grup_MenuID','Menu='+alist.join()],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
|
||||
}
|
||||
FoniaJS.closeWindow(this.winMenu);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Grup']
|
||||
}).send()
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,189 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/operator.js
|
||||
Desc. : JS - Manajemen Data Pengguna
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : March 12th, 2008.
|
||||
Last Modified : January 1st, 2026.
|
||||
|
||||
(c) 2008 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var OperatorJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_User').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_User').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butFilter').click(function(){this.filter_show();}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_User');
|
||||
},
|
||||
|
||||
filter_show: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_filter','Filter_Level'],
|
||||
onSuccess: function(txt){
|
||||
this.winFilter = FoniaJS.showWindow('FLevel', 'Filter Data Pengguna / Level', txt, 400, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winFLevel').find('#butWSimpan').click(function(){this.filter_simpan();}.bind(this));
|
||||
$('#winFLevel').find('#Fi_Level').focus();
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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,
|
||||
sendParam: ['data=user-detail','mode='+mode,'UserID='+UserID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Pengguna', txt, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_check();}.bind(this));
|
||||
this.oc_Level();
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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]+"?", function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=del','UserID='+acell[0]],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
this.data_query('detail');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_check: function(){
|
||||
if ($('#Username').val().toUpperCase()==$('#UserLama').val().toUpperCase()) {
|
||||
this.detail_save();
|
||||
return;
|
||||
}
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=user-check','Username'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.ada==true) {
|
||||
FoniaJS.showInfo("Username telah ada dalam sistem !");
|
||||
} else {
|
||||
this.detail_save();
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode','UserID','Username','Nama','Posisi','Level','Password','Grup_MenuID','Aktif'],
|
||||
onSuccess: function(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);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_show: function(acell){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=menu','UserID='+acell[0]],
|
||||
onSuccess: function(txt){
|
||||
this.winMenu = FoniaJS.showWindow('Menu', 'Hak Akses Modul', txt, 'lg', [{i:'butWSelAll',v:'Pilih Semua',c:'info'},{i:'butWClrAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winMenu')
|
||||
.find('#butWSelAll').click(function(){this.menu_ceksemua();}.bind(this)).end()
|
||||
.find('#butWClrAll').click(function(){this.menu_hapussemua();}.bind(this)).end()
|
||||
.find('#butWSimpan').click(function(){this.menu_simpan();}.bind(this)).end()
|
||||
.find('#tabMenuList thead input[type="checkbox"]:disabled').prop('indeterminate', true);
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_cek: function(el){
|
||||
var t_modul = el.value, b_check = el.checked;
|
||||
$('#tabMenuList tbody input[type="checkbox"]').map(function(i, b){
|
||||
var t_menu = $(b);
|
||||
if (t_menu.hasClass(t_modul)) t_menu.prop('checked', b_check);
|
||||
});
|
||||
el.prop('checked', !b_check);
|
||||
},
|
||||
|
||||
menu_ceksemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]:not(:disabled)').prop('checked', true);
|
||||
},
|
||||
|
||||
menu_hapussemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]:not(:disabled)').prop('checked', false);
|
||||
},
|
||||
|
||||
menu_simpan: function(){
|
||||
var alist = $('#R_MENU').val().split(',');
|
||||
$('#tabMenuList tbody input[type="checkbox"]:not(:disabled):checked').map(function(i, b){
|
||||
alist.push($(b).val());
|
||||
});
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save-menu','UserID','Menu='+alist.join()],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
|
||||
}
|
||||
FoniaJS.closeWindow(this.winMenu);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Filter_Level','Cari_User']
|
||||
}).send()
|
||||
}
|
||||
},
|
||||
|
||||
oc_Level: function(){
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/printer.js
|
||||
Desc. : JS - Konfigurasi Printer POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 4th, 2013.
|
||||
Last Modified : December 7th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var PrinterJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butBrow').click(function(){this.cab_brow();}.bind(this));
|
||||
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
this.data_query('form-printer');
|
||||
},
|
||||
|
||||
cab_brow: function(){
|
||||
var _isi = new String('<div id="divBrowCab"> </div>');
|
||||
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, 'lg', '', function(){
|
||||
this.data_query('brow-cabang');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=form-printer','mode='+mode,'REG_ID','PRINT_AUTO','PRINT_OPENCD','PRINT_AUTOCUT','PRINT_ROW','TITLE_END'],
|
||||
onSuccess: function(a){
|
||||
$('#divPrinter').html(a.html);
|
||||
$('#Nama_Cabang').val(a.Nama_Cabang);
|
||||
this.update_event();
|
||||
if (a.sukses) FoniaJS.showInfo('Konfigurasi printer sukses disimpan!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=='brow-cabang'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-cabang']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$('#butUbah').prop('disabled', true);
|
||||
$('#butSimpan').prop('disabled', false);
|
||||
} else {
|
||||
$('#butUbah').prop('disabled', false);
|
||||
$('#butSimpan').prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/super.js
|
||||
Desc. : JS - Informasi Supervisi Operator
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 11st, 2012.
|
||||
Last Modified : March 19th, 2023.
|
||||
|
||||
(c) 2012 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var SuperJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
AJ: null,
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
if ($('#divSuper').length == 1){
|
||||
SuperJS.AJ = setInterval(function(){
|
||||
SuperJS.data_query('detail');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
detail_select: function(acell){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','USERID='+acell[0],'KODE='+acell[1],'REQ_SID='+acell[2],'REQ='+acell[7]],
|
||||
onSuccess: function(){
|
||||
this.data_query('detail');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail'],
|
||||
onSuccess: function(){
|
||||
if ($('#divSuper').length == 0) clearInterval(SuperJS.AJ);
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user