Files
cmasa/app/Scripts/system/about.js
T
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

105 lines
3.8 KiB
JavaScript

/*******************************************************************
PHP Class : /Controller/System/AboutController
Description : Informasi Aplikasi
Created By : Siau Pheng ([email protected]).
Created Date : November 23th, 2011.
Last Modified : August 13th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var AboutJS = {
PHP: '',
KODE: '',
index() {
$('#win'+this.KODE).find('#divBuildInfo').html('<p>Aplikasi dibuat dengan komponen :<br>- jQuery Version '+$().jquery+' <br>- Bootstrap Version '+$.fn.tooltip.Constructor.VERSION+' <br>- FoniaJS Version '+FoniaJS.version+' <br>- FoniaPHP Version '+FoniaJS.version+'</p>');
$('#butDBCek').click(() => this.db_check());
$('#butDBOpti').click(() => this.db_opti());
$('#butUpdateCek').click(() => this.update_check());
},
db_check() {
new Request({
url: this.PHP + '/db_check',
onSuccess: (ajson) => {
this.winCheck = FoniaJS.showWindow('CekDB', 'Cek Database', ajson.html, 500, [{},{i:'butTutup'}], () => this.db_run(ajson.db_count));
}
}).send();
},
db_opti() {
new Request({
url: this.PHP + '/db_check',
onSuccess: (ajson) => {
this.winCheck = FoniaJS.showWindow('CekDB', 'Optimalisasi Database', ajson.html, 500, [{},{i:'butTutup'}], () => this.opti_run(ajson.db_count));
}
}).send();
},
update_check() {
new Request({
url: this.PHP + '/update_check',
onSuccess: (ajson) => {
var tomb = [{},{i:'butTutup'},{i:'butWUpdate',v:'Proses Update !',c:'success'}];
if (ajson.is_update) tomb.pop();
this.winUpdate = FoniaJS.showWindow('CekApp', 'Cek dan Update Aplikasi', ajson.html, 500, tomb, () => {
$('#winCekApp').find('#butWUpdate').click(() => this.update_run());
});
}
}).send();
},
db_run(db_count = 0) {
if (db_count === 0) return false;
var items = Array(db_count).fill(0).map((_, index) => index);
var $ul = $('#db-list').empty();
items.reduce((prev, curr) => {
return prev.then(() => {
return $.ajax({
url: this.PHP + '/db_proses',
data: {'Nomor': curr},
dataType: 'json',
type: 'POST',
}).done((response) => {
$ul.append('<li>' + response.html + '</li>');
});
});
}, $.Deferred().resolve().promise());
},
opti_run(db_count = 0) {
if (db_count === 0) return false;
var items = Array(db_count).fill(0).map((_, index) => index);
var $ul = $('#db-list').empty();
items.reduce((prev, curr) => {
return prev.then(() => {
return $.ajax({
url: this.PHP + '/opti_proses',
data: {'Nomor': curr},
dataType: 'json',
type: 'POST',
}).done((response) => {
$ul.append('<li>' + response.html + '</li>');
});
});
}, $.Deferred().resolve().promise());
},
update_run() {
new Request({
url: this.PHP + '/update_proses',
onSuccess: (adata) => {
if (adata.success==true) {
$('#spanStatus').html(adata.message);
FoniaJS.showInfo('Aplikasi telah di Update.<br>Silakan refresh browser Anda!');
} else {
FoniaJS.showInfo('Aplikasi gagal di Update.');
}
}
}).send();
}
};