Files
siaupheng aaaf0a9215 Refactor member and product scripts to use concise method definitions
- Updated all function declarations to use ES6 shorthand method syntax in member.js, member_grup.js, point_barang.js, point_skema.js, point_tipe.js, kategori.js, operator.js, produk.js, produk_grup.js, rekpos.js, satuan.js, supplier.js, and varian.js.
2026-11-01 14:57:54 +07:00

66 lines
2.0 KiB
JavaScript

/*******************************************************************
PHP Class : /Controller/System/ProfileController
Description : Profile Pengguna
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2008.
Last Modified : August 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SYSProfileJS = {
PHP: '',
KODE: '',
index() {
$('#butSave').click(() => this.save_profile());
$('#win'+this.KODE).find('#FileGambar').off('change').change(() => {
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
fd.append('Gambar1', files);
$.ajax({
url: this.PHP + '/upload_picture',
type: 'post',
data: fd,
contentType: false,
processData: false,
success: (ares) => {
if (ares.result !== 0){
FoniaJS.showInfo('Sukses upload gambar profile !');
this.get_picture();
} else {
FoniaJS.showError(ares.message);
}
}
});
});
this.get_picture();
},
save_profile() {
new Request({
url: this.PHP + '/save_profile',
sendParam: ['Nama','Posisi','Email','HP'],
onSuccess: (ajson) => {
if (ajson.status == true) {
FoniaJS.showInfo('Sukses simpan profile!');
FoniaJS.closeWindow('#win'+this.KODE);
} else {
FoniaJS.showError('Ada masalah dalam simpan profile!');
}
}
}).send();
},
get_picture() {
new Request({
url: this.PHP + '/get_picture',
onSuccess: (ajson) => {
$('#imgPhoto').attr('src', ajson.src);
}
}).send();
}
};