Files
cmasa/app/Scripts/system/config.js
T
2026-10-29 13:34:31 +07:00

60 lines
1.7 KiB
JavaScript

/*******************************************************************
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);
}
}
};