remove old compatible fonia3
add 404 page request fixed minor on table
This commit is contained in:
+14
-81
@@ -4,7 +4,7 @@
|
||||
Desc. : JS - Fonia Custom Class v3
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : June 19th, 2009.
|
||||
Last Modified : October 30th, 2023.
|
||||
Last Modified : December 30th, 2023.
|
||||
|
||||
(c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
@@ -24,39 +24,7 @@ var FoniaJS = {
|
||||
phpversion: "",
|
||||
locales: [],
|
||||
deflocal: "",
|
||||
_amenu: [//compatible, remove then !
|
||||
["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"],
|
||||
],
|
||||
_debug: (jQuery.inArray(location.hostname, ["localhost","127.0.0.1"]) !== -1) ? true : false;
|
||||
|
||||
setConfig: function(key, skey) {//oke
|
||||
var _hasil, _adata = null;
|
||||
@@ -83,7 +51,6 @@ var FoniaJS = {
|
||||
callMenu: function(p, q) {//oke
|
||||
var apar = ["p=" + p];
|
||||
if (q != null) apar.push("q=" + q);
|
||||
//this.closeAllWindows();
|
||||
new Request.JSON({
|
||||
url: this.WEB_PATH + "auth.php",
|
||||
sendParam: apar,
|
||||
@@ -111,7 +78,6 @@ var FoniaJS = {
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else {
|
||||
//$("#pageToolbarTop").html(this.genToolButton(apop.button));
|
||||
$("#pageToolbarBot").html(this.genToolButton(apop.button));
|
||||
new Request({
|
||||
url: this.WEB_PATH + "apps/php/" + apop.php,
|
||||
@@ -284,26 +250,8 @@ var FoniaJS = {
|
||||
});
|
||||
smenu += '</div>';
|
||||
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 {
|
||||
$.each(amenu, function(i, subm) {
|
||||
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>';
|
||||
} else {
|
||||
if (this._debug) console.log('menu not object'+menu);
|
||||
}
|
||||
return smenu;
|
||||
},
|
||||
@@ -324,24 +272,8 @@ var FoniaJS = {
|
||||
});
|
||||
smenu += '</div></div>';
|
||||
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"> </div>';
|
||||
} else {
|
||||
$.each(amenu, function(i, subm) {
|
||||
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>";
|
||||
} else {
|
||||
if (this._debug) console.log('menu not object'+menu);
|
||||
}
|
||||
return smenu;
|
||||
},
|
||||
@@ -659,7 +591,8 @@ var Request = function(options){
|
||||
};
|
||||
this.send = function(){
|
||||
if (!vars.url) {
|
||||
alert(vars.sendParam + ", cek url php!");//todo: debug
|
||||
//if (this._debug)
|
||||
console.log(vars.sendParam + ", cek url php!");
|
||||
return false;
|
||||
}
|
||||
vars.data = FoniaJS.RequestParam(vars.sendParam);
|
||||
@@ -689,7 +622,8 @@ Request.JSON = function(options){//oke
|
||||
};
|
||||
this.send = function(){
|
||||
if (!vars.url) {
|
||||
alert(vars.sendParam + ", cek url php!");//todo: debug
|
||||
//if (this._debug)
|
||||
console.log(vars.sendParam + ", cek url php!");
|
||||
return false;
|
||||
}
|
||||
vars.data = FoniaJS.RequestParam(vars.sendParam);
|
||||
@@ -720,7 +654,8 @@ Request.JSONF = function(options){//oke
|
||||
};
|
||||
this.send = function(){
|
||||
if (!vars.url) {
|
||||
alert(vars.sendParam + ", cek url php!");//todo: debug
|
||||
//if (this._debug)
|
||||
console.log(vars.sendParam + ", cek url php!");
|
||||
return false;
|
||||
}
|
||||
vars.data = FoniaJS.RequestParam(vars.sendParam);
|
||||
@@ -733,7 +668,6 @@ Request.JSONF = function(options){//oke
|
||||
for (var no = 0; no < data.length; no++) {
|
||||
var ini = data[no];
|
||||
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 == "option" && $(ini.id)) make_option(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>');
|
||||
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){
|
||||
var post_data = {};
|
||||
$(vars.data).map(function(key, item){
|
||||
@@ -913,12 +847,11 @@ Request.JSONF = function(options){//oke
|
||||
jsono.data[key].push(_tbtn1+_tbtn2);
|
||||
}
|
||||
});
|
||||
|
||||
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.navi.func_navi == '') opsi.paging = false;
|
||||
|
||||
|
||||
+6
-1
@@ -32,9 +32,9 @@ final class App {
|
||||
$this->__form = new \siaupheng\fonia3\Web\Form($this->__db);
|
||||
|
||||
$this->apps = $_SESSION['__WEB_APP'];
|
||||
$this->apps['TEMPLATE'] = "index.php";
|
||||
if (isset($_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_img'] = "profile.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";
|
||||
}
|
||||
|
||||
// gunakan template khusus sesuai request
|
||||
if (($aoption['PAGE_404']['value'] ?? 0) == 1) {
|
||||
$this->apps['TEMPLATE'] = "404.php";
|
||||
}
|
||||
|
||||
// loading template file
|
||||
$buffer = "";
|
||||
if (file_exists($this->apps['REAL_PATH']."assets/templates/".$this->apps['TEMPLATE'])) {
|
||||
|
||||
@@ -295,7 +295,6 @@ final class Table {
|
||||
}
|
||||
$adata['data'][] = $abaris;
|
||||
}
|
||||
|
||||
} else {
|
||||
$adata = $this->json_table($nama_tabel, $baris_tabel);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user