/*******************************************************************
PHP Class : /Controller/System/AboutController
Description : Informasi Aplikasi
Created By : Siau Pheng (siaupheng@3fonia.com).
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('
- jQuery Version '+$().jquery+'
- Bootstrap Version '+$.fn.tooltip.Constructor.VERSION+'
- FoniaJS Version '+FoniaJS.version+'
');
$('#butDBCek').click(() => this.db_check());
$('#butDBOpti').click(() => this.db_opti());
$('#butUpdateCek').click(() => this.update_check());
new Request({
url: this.PHP + '/composer',
onSuccess: (ajson) => {
$('#win'+this.KODE).find('#divComposerInfo').html(ajson.html);
}
}).send();
},
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('' + response.html + '');
});
});
}, $.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('' + response.html + '');
});
});
}, $.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.
Silakan refresh browser Anda!');
} else {
FoniaJS.showInfo('Aplikasi gagal di Update.');
}
}
}).send();
}
};