/******************************************************************* PHP Class : /Controller/System/ProfileController Description : Profile Pengguna Created By : Siau Pheng (siaupheng@3fonia.com). 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(); } };