remove old compatible fonia3

add 404 page request
fixed minor on table
This commit is contained in:
2023-12-31 10:49:03 +07:00
parent 7b7868ba10
commit 14c7d51d4d
3 changed files with 20 additions and 83 deletions
+12 -79
View File
@@ -4,7 +4,7 @@
Desc. : JS - Fonia Custom Class v3 Desc. : JS - Fonia Custom Class v3
Created By : Siau Pheng ([email protected]). Created By : Siau Pheng ([email protected]).
Created Date : June 19th, 2009. Created Date : June 19th, 2009.
Last Modified : October 30th, 2023. Last Modified : December 30th, 2023.
(c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM. (c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
@@ -24,39 +24,7 @@ var FoniaJS = {
phpversion: "", phpversion: "",
locales: [], locales: [],
deflocal: "", deflocal: "",
_amenu: [//compatible, remove then ! _debug: (jQuery.inArray(location.hostname, ["localhost","127.0.0.1"]) !== -1) ? true : false;
["A", "butAdd", "Tambah", "primary"],
["B", "butPDF", "PDF", "info"],
["C", "butCancel", "Batal", "danger"],
["D", "butDel", "Hapus", "warning"],
["E", "butEdit", "Ubah", "primary"],
["F", "butFind", "Cari", "info"],
["I", "butInfo", "Info", "info"],
["K", "butLock", "Kunci", "info"],
["L", "butExcel", "Excel", "info"],
["M", "butSend", "Kirim", "info"],
["O", "butDownload", "Download", "info"],
["P", "butPrint", "Cetak", "info"],
["R", "butRefresh", "Update", "info"],
["S", "butSave", "Simpan", "success"],
["T", "butFilter", "Filter", "info"],
["V", "butPreview", "Tampil", "info"],
["X", "butProcess", "Proses", "warning"],
["PP", "butPPrint", "Cetak", "info"],
["PN", "butPNormal", "Normal", "info"],
["PS", "butPSmall", "Zoom -", "info"],
["PB", "butPBig", "Zoom +", "info"],
["WO", "butWOK", "OK", "primary"],
["WC", "butWCancel", "Batal", "danger"],
["WS", "butWSave", "Simpan", "success"],
["WK", "butWClose", "Tutup", "danger"],
["WZ", "butWSelAll", "Cek Semua", "info"],
["WX", "butWClrAll", "Hapus Semua", "info"],
["WH", "butWShwAll", "Tampil Semua", "info"],
["ST", "butSTerima", "Terima", "success"],
["SO", "butSTolak", "Tolak", "danger"],
["SB", "butSBelum", "Belum", "secondary"],
],
setConfig: function(key, skey) {//oke setConfig: function(key, skey) {//oke
var _hasil, _adata = null; var _hasil, _adata = null;
@@ -83,7 +51,6 @@ var FoniaJS = {
callMenu: function(p, q) {//oke callMenu: function(p, q) {//oke
var apar = ["p=" + p]; var apar = ["p=" + p];
if (q != null) apar.push("q=" + q); if (q != null) apar.push("q=" + q);
//this.closeAllWindows();
new Request.JSON({ new Request.JSON({
url: this.WEB_PATH + "auth.php", url: this.WEB_PATH + "auth.php",
sendParam: apar, sendParam: apar,
@@ -111,7 +78,6 @@ var FoniaJS = {
}.bind(this) }.bind(this)
}).send(); }).send();
} else { } else {
//$("#pageToolbarTop").html(this.genToolButton(apop.button));
$("#pageToolbarBot").html(this.genToolButton(apop.button)); $("#pageToolbarBot").html(this.genToolButton(apop.button));
new Request({ new Request({
url: this.WEB_PATH + "apps/php/" + apop.php, url: this.WEB_PATH + "apps/php/" + apop.php,
@@ -284,26 +250,8 @@ var FoniaJS = {
}); });
smenu += '</div>'; smenu += '</div>';
return smenu; return smenu;
}
//compatible, remove then !
var tom = menu.split(",");
var amenu = this._amenu;
if (tom.length > 0) {
var ma = 'me-2'; smenu = '<div>';
$.each(tom, function(i, vtom) {
if (vtom == "_") {
smenu += '</div><div>';
ma = 'ms-2';
} else { } else {
$.each(amenu, function(i, subm) { if (this._debug) console.log('menu not object'+menu);
if (vtom == subm[0]) {
var _xt = (-1!==$.inArray(vtom, ['C','WC','WK','WC2','WK2'])) ? ' data-bs-dismiss="modal"' : '';
smenu += '<button type="button" class="btn btn-'+subm[3]+' '+ma+'" id="'+subm[1]+'"'+_xt+'>' + subm[2] + '</button>';
}
});
}
});
smenu += '</div>';
} }
return smenu; return smenu;
}, },
@@ -324,24 +272,8 @@ var FoniaJS = {
}); });
smenu += '</div></div>'; smenu += '</div></div>';
return smenu; return smenu;
}
//compatible, remove then !
var tom = menu.split(",");
var amenu = this._amenu;
if (tom.length > 0) {
smenu = '<div class="row mb-2">';
$.each(tom, function(i, vtom) {
if (vtom == "_") {
smenu += '<div class="d-none d-lg-block col-6 col-md-2 col-xl-2 mb-3">&nbsp;</div>';
} else { } else {
$.each(amenu, function(i, subm) { if (this._debug) console.log('menu not object'+menu);
if (vtom == subm[0]) {
smenu += '<div class="col-6 col-md-3 col-xl-2 mb-3"><button type="button" class="btn btn-block btn-outline-'+subm[3]+'" id="'+subm[1]+'">' + subm[2] + '</button></div>';
}
});
}
});
smenu += "</div>";
} }
return smenu; return smenu;
}, },
@@ -659,7 +591,8 @@ var Request = function(options){
}; };
this.send = function(){ this.send = function(){
if (!vars.url) { if (!vars.url) {
alert(vars.sendParam + ", cek url php!");//todo: debug //if (this._debug)
console.log(vars.sendParam + ", cek url php!");
return false; return false;
} }
vars.data = FoniaJS.RequestParam(vars.sendParam); vars.data = FoniaJS.RequestParam(vars.sendParam);
@@ -689,7 +622,8 @@ Request.JSON = function(options){//oke
}; };
this.send = function(){ this.send = function(){
if (!vars.url) { if (!vars.url) {
alert(vars.sendParam + ", cek url php!");//todo: debug //if (this._debug)
console.log(vars.sendParam + ", cek url php!");
return false; return false;
} }
vars.data = FoniaJS.RequestParam(vars.sendParam); vars.data = FoniaJS.RequestParam(vars.sendParam);
@@ -720,7 +654,8 @@ Request.JSONF = function(options){//oke
}; };
this.send = function(){ this.send = function(){
if (!vars.url) { if (!vars.url) {
alert(vars.sendParam + ", cek url php!");//todo: debug //if (this._debug)
console.log(vars.sendParam + ", cek url php!");
return false; return false;
} }
vars.data = FoniaJS.RequestParam(vars.sendParam); vars.data = FoniaJS.RequestParam(vars.sendParam);
@@ -733,7 +668,6 @@ Request.JSONF = function(options){//oke
for (var no = 0; no < data.length; no++) { for (var no = 0; no < data.length; no++) {
var ini = data[no]; var ini = data[no];
if (ini.type == "table" && $(ini.id)) make_table(ini); if (ini.type == "table" && $(ini.id)) make_table(ini);
//if (ini.type == "table_db" && $(ini.id)) make_table_db(ini);
if (ini.type == "form" && $(ini.id)) make_form(ini); if (ini.type == "form" && $(ini.id)) make_form(ini);
if (ini.type == "option" && $(ini.id)) make_option(ini); if (ini.type == "option" && $(ini.id)) make_option(ini);
if (ini.type == "html" && $(ini.id)) make_html(ini); if (ini.type == "html" && $(ini.id)) make_html(ini);
@@ -859,7 +793,7 @@ Request.JSONF = function(options){//oke
$(divData).append(strTab + strHead + strBody + strFoot + '</table>'); $(divData).append(strTab + strHead + strBody + strFoot + '</table>');
var opsi = { responsive: true, columnDefs: [{responsivePriority:1,targets:0},{responsivePriority:2,targets:1}], lengthMenu: [], dom: '<"row"<"col-sm-12"tr>><"row"<"col-sm-12 col-lg-auto"<"toolbar">><"col-sm-3 col-lg-auto ms-lg-auto"l><"col-sm-9 col-lg-auto"p>>', autoWidth: false, processing: true, searching: false, columns: aSortCol, order: [[iCol, (ini.config.sort_dir=='A'?'asc':'desc')]], pageLength: ini.config.row_count, stateSave: true, stateSaveCallback: function(sett,data){localStorage.setItem(ini.id,JSON.stringify(data));}, stateLoadCallback: function(sett){try{var data=JSON.parse(localStorage.getItem(ini.id))??{};data.length=ini.config.row_count;return data;}catch(e){console.log(e)}} }; var opsi = { responsive: true, columnDefs: [{responsivePriority:1,targets:0},{responsivePriority:2,targets:1}], lengthMenu: [], dom: '<"row"<"col-sm-12"tr>><"row"<"col-sm-12 col-lg-auto"<"toolbar">><"col-sm-3 col-lg-auto ms-lg-auto"l><"col-sm-9 col-lg-auto"p>>', autoWidth: false, processing: true, searching: false, columns: aSortCol, order: [[iCol, (ini.config.sort_dir=='A'?'asc':'desc')]], pageLength: ini.config.row_count, stateSave: true, stateSaveCallback: function(sett,data){localStorage.setItem(ini.id,JSON.stringify(data));}, stateLoadCallback: function(sett){try{var data=JSON.parse(localStorage.getItem(ini.id))??{};data.length=ini.config.row_count;return data;}catch(e){console.log(e)}} };
/*****/ /** start live db **/
if (ini.config.live){ if (ini.config.live){
var post_data = {}; var post_data = {};
$(vars.data).map(function(key, item){ $(vars.data).map(function(key, item){
@@ -913,12 +847,11 @@ Request.JSONF = function(options){//oke
jsono.data[key].push(_tbtn1+_tbtn2); jsono.data[key].push(_tbtn1+_tbtn2);
} }
}); });
return JSON.stringify(jsono); return JSON.stringify(jsono);
} }
}; };
} }
/******/ /** end live db **/
if (ini.option.length > 0) opsi.columnDefs.push({responsivePriority:3,targets:-1}, {orderable:false,targets:-1}); if (ini.option.length > 0) opsi.columnDefs.push({responsivePriority:3,targets:-1}, {orderable:false,targets:-1});
if (ini.navi.func_navi == '') opsi.paging = false; if (ini.navi.func_navi == '') opsi.paging = false;
+6 -1
View File
@@ -32,9 +32,9 @@ final class App {
$this->__form = new \siaupheng\fonia3\Web\Form($this->__db); $this->__form = new \siaupheng\fonia3\Web\Form($this->__db);
$this->apps = $_SESSION['__WEB_APP']; $this->apps = $_SESSION['__WEB_APP'];
$this->apps['TEMPLATE'] = "index.php";
if (isset($_SESSION['__WEB_USER'])) { if (isset($_SESSION['__WEB_USER'])) {
$this->auser = $_SESSION['__WEB_USER']; $this->auser = $_SESSION['__WEB_USER'];
$this->apps['TEMPLATE'] = "index.php";
$this->auser['user_info'] = tgl_sql2str($this->auser['Last_Date'], true) ." // ". $this->auser['Last_IP'].'<input type="hidden" id="Desktop_User_ID" value="'.intval($this->auser['UserID']).'"><input type="hidden" id="Desktop_User_Level" value="'.intval($this->auser['Level']).'"><input type="hidden" id="Desktop_User_UID" value="'.$this->auser['Username'].'">'; $this->auser['user_info'] = tgl_sql2str($this->auser['Last_Date'], true) ." // ". $this->auser['Last_IP'].'<input type="hidden" id="Desktop_User_ID" value="'.intval($this->auser['UserID']).'"><input type="hidden" id="Desktop_User_Level" value="'.intval($this->auser['Level']).'"><input type="hidden" id="Desktop_User_UID" value="'.$this->auser['Username'].'">';
$this->auser['user_img'] = "profile.png"; $this->auser['user_img'] = "profile.png";
if (file_exists($this->apps['REAL_PATH']."assets/images/profiles/".$this->auser['UserID'].".png")) { if (file_exists($this->apps['REAL_PATH']."assets/images/profiles/".$this->auser['UserID'].".png")) {
@@ -56,6 +56,11 @@ final class App {
$this->apps['TEMPLATE'] = "404.php"; $this->apps['TEMPLATE'] = "404.php";
} }
// gunakan template khusus sesuai request
if (($aoption['PAGE_404']['value'] ?? 0) == 1) {
$this->apps['TEMPLATE'] = "404.php";
}
// loading template file // loading template file
$buffer = ""; $buffer = "";
if (file_exists($this->apps['REAL_PATH']."assets/templates/".$this->apps['TEMPLATE'])) { if (file_exists($this->apps['REAL_PATH']."assets/templates/".$this->apps['TEMPLATE'])) {
-1
View File
@@ -295,7 +295,6 @@ final class Table {
} }
$adata['data'][] = $abaris; $adata['data'][] = $abaris;
} }
} else { } else {
$adata = $this->json_table($nama_tabel, $baris_tabel); $adata = $this->json_table($nama_tabel, $baris_tabel);
} }