first commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Member/BaruController
|
||||
Description : Pembuatan Member Baru
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : February 8th, 2012.
|
||||
Last Modified : September 27th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var MemberBaruJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(){
|
||||
$('#butTambah').click(() => this.proses_add());
|
||||
$('#butSimpan').click(() => this.proses_save());
|
||||
this.data_query('view');
|
||||
},
|
||||
|
||||
proses_add: function(){
|
||||
this.data_query('add');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/proses_simpan',
|
||||
sendParam: ['MemberID','Grup_MemberID','Kode_Member','Nama_Member','Alamat_Member','Kota_Member','Telp_Member','KTP_Member','Tgl_Lahir','Tgl_Daftar'],
|
||||
onSuccess: (ajson) => {
|
||||
if (ajson.status == true) {
|
||||
this.data_query('view');
|
||||
FoniaJS.showInfo('Sukses simpan Member Baru!');
|
||||
} else {
|
||||
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
|
||||
}
|
||||
}
|
||||
}).send()
|
||||
},
|
||||
|
||||
data_query: function(mode){
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: ['mode='+mode],
|
||||
onSuccess: (ajson) => {
|
||||
$('#divMaster').html(ajson.html);
|
||||
if ($.inArray($('#mode').val(), ['add']) !== -1) {
|
||||
$("#butTambah").prop('disabled', true);
|
||||
$("#butSimpan").prop('disabled', false);
|
||||
FoniaJS.setFocus('#Kode_Member');
|
||||
} else {
|
||||
$("#butTambah").prop('disabled', false);
|
||||
$("#butSimpan").prop('disabled', true);
|
||||
}
|
||||
}
|
||||
}).send()
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user