61 lines
1.8 KiB
JavaScript
61 lines
1.8 KiB
JavaScript
/*******************************************************************
|
|
|
|
PHP Class : /Controller/Table/Gel/GajiController
|
|
Description : Master Standar Gaji
|
|
Created By : Siau Pheng ([email protected]).
|
|
Created Date : September 17th, 2014.
|
|
Last Modified : September 4th, 2026.
|
|
|
|
(c) 3FONIA Software; WWW.3FONIA.COM.
|
|
|
|
*******************************************************************/
|
|
|
|
var GajiJS = {
|
|
PHP: '',
|
|
KODE: '',
|
|
|
|
index: function(){
|
|
$('#butUbah').click(() => this.proses_edit());
|
|
$('#butSimpan').click(() => this.proses_save());
|
|
this.data_query('view');
|
|
},
|
|
|
|
proses_edit: function(){
|
|
this.data_query('update');
|
|
},
|
|
|
|
proses_save: function(){
|
|
new Request({
|
|
url: this.PHP + '/form_gaji',
|
|
sendParam: ['mode_detail=save','REG_ID','LEMBUR','BONUS1','BONUS2'],
|
|
onSuccess: (ajson) => {
|
|
$('#divMaster').html(ajson.html);
|
|
this.update_event();
|
|
FoniaJS.showInfo('Data Standar Gaji Karyawan sukses disimpan!');
|
|
}
|
|
}).send()
|
|
},
|
|
|
|
data_query: function(mode){
|
|
new Request({
|
|
url: this.PHP + '/form_gaji',
|
|
sendParam: ['mode_detail='+mode,'REG_ID'],
|
|
onSuccess: (ajson) => {
|
|
$('#divMaster').html(ajson.html);
|
|
this.update_event();
|
|
}
|
|
}).send()
|
|
},
|
|
|
|
update_event: function(){
|
|
if ($.inArray($('#mode_detail').val(), ['update']) >= 0) {
|
|
$("#butUbah").prop('disabled', true);
|
|
$("#butSimpan").prop('disabled', false);
|
|
} else {
|
|
$("#butUbah").prop('disabled', false);
|
|
$("#butSimpan").prop('disabled', true);
|
|
}
|
|
}
|
|
|
|
};
|