first commit
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Table/Gel/KaryawanController
|
||||
Description : Master Karyawan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 7th, 2015.
|
||||
Last Modified : September 4th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var KaryawanJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Karya').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
});
|
||||
$('#butSearch').click(() => this.data_query('detail'));
|
||||
$('#butAll').click(() => {
|
||||
$('#Cari_Karya').val('');
|
||||
this.data_query('detail');
|
||||
});
|
||||
FoniaJS.setFocus('#Cari_Karya');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP + '/form_karya',
|
||||
sendParam: ['mode_detail='+mode,'KaryaID='+ID],
|
||||
onSuccess: (ajson) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Data Karyawan', 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('insert', 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_show('update', acell[0]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=delete','KaryaID='+acell[0],'Cari_Karya'],
|
||||
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail','KaryaID','Nama_Karya','Gaji_Harian','Tgl_Masuk','Tgl_Keluar','Aktif','Cari_Karya'],
|
||||
onSuccess: () => {
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['Cari_Karya']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user