update 2023-08-04 fixed cache, form and fonia3.js
This commit is contained in:
+3
-4
@@ -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 : May 15th, 2023.
|
Last Modified : July 6th, 2023.
|
||||||
|
|
||||||
(c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
(c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ var FoniaJS = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('.option-tags').each(function() {//oke
|
$('.option-tags').each(function() {//oke
|
||||||
var _opts = {tags: false, theme: 'bootstrap-5'};
|
var _opts = {tags: false, dropdownAutoWidth: true, width: 'auto', theme: 'bootstrap-5'};
|
||||||
var _dmodal = $(this).closest('div.modal');
|
var _dmodal = $(this).closest('div.modal');
|
||||||
if ($(_dmodal).hasClass('modal')) _opts.dropdownParent = _dmodal;
|
if ($(_dmodal).hasClass('modal')) _opts.dropdownParent = _dmodal;
|
||||||
var _sel2 = $(this).select2(_opts);
|
var _sel2 = $(this).select2(_opts);
|
||||||
@@ -858,8 +858,7 @@ Request.JSONF = function(options){//oke
|
|||||||
_lmenu.push(val);
|
_lmenu.push(val);
|
||||||
});
|
});
|
||||||
if (10 > ini.content.length){
|
if (10 > ini.content.length){
|
||||||
opsi.lengthMenu.push([10]);
|
opsi.lengthMenu.push([10],[10]);
|
||||||
opsi.lengthMenu.push([10]);
|
|
||||||
}else{
|
}else{
|
||||||
_lmenu.push(-1), opsi.lengthMenu.push(_lmenu), _lmenu.pop();
|
_lmenu.push(-1), opsi.lengthMenu.push(_lmenu), _lmenu.pop();
|
||||||
_lmenu.push(ini.content.length), opsi.lengthMenu.push(_lmenu);
|
_lmenu.push(ini.content.length), opsi.lengthMenu.push(_lmenu);
|
||||||
|
|||||||
+4
-2
@@ -6,9 +6,9 @@
|
|||||||
Desc. : v3 - Class cache aplikasi
|
Desc. : v3 - Class cache aplikasi
|
||||||
Created By : Siau Pheng ([email protected]).
|
Created By : Siau Pheng ([email protected]).
|
||||||
Created Date : March 16th, 2008.
|
Created Date : March 16th, 2008.
|
||||||
Last Modified : May 8th, 2021.
|
Last Modified : August 3rd, 2023.
|
||||||
|
|
||||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
(c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
||||||
|
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
@@ -79,6 +79,7 @@ final class Cache {
|
|||||||
}
|
}
|
||||||
// add locale file
|
// add locale file
|
||||||
$ljs = (isset($_SESSION['__WEB_USER']['LOCALE'])?$_SESSION['__WEB_USER']['LOCALE']:$_SESSION['__WEB_APP']['DEF_LOCALE']).".js";
|
$ljs = (isset($_SESSION['__WEB_USER']['LOCALE'])?$_SESSION['__WEB_USER']['LOCALE']:$_SESSION['__WEB_APP']['DEF_LOCALE']).".js";
|
||||||
|
if (is_dir($this->__localedir)) {
|
||||||
if ($handle = opendir($this->__localedir)) {
|
if ($handle = opendir($this->__localedir)) {
|
||||||
while (false !== ($file = readdir($handle))) {
|
while (false !== ($file = readdir($handle))) {
|
||||||
$file = $this->__localedir . $file;
|
$file = $this->__localedir . $file;
|
||||||
@@ -86,6 +87,7 @@ final class Cache {
|
|||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$afile[] = $this->__jsapp . $mode . ".js";
|
$afile[] = $this->__jsapp . $mode . ".js";
|
||||||
} else if ($type == "app") {
|
} else if ($type == "app") {
|
||||||
$afile[] = $this->__jsapp ."sys/profile.js";
|
$afile[] = $this->__jsapp ."sys/profile.js";
|
||||||
|
|||||||
+16
-5
@@ -6,7 +6,7 @@
|
|||||||
Desc. : v3 - Form Generator (jQuery & Bootstrap)
|
Desc. : v3 - Form Generator (jQuery & Bootstrap)
|
||||||
Created By : Siau Pheng ([email protected]).
|
Created By : Siau Pheng ([email protected]).
|
||||||
Created Date : February 27th, 2008.
|
Created Date : February 27th, 2008.
|
||||||
Last Modified : March 24th, 2023.
|
Last Modified : July 5th, 2023.
|
||||||
|
|
||||||
(c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
(c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
||||||
|
|
||||||
@@ -29,25 +29,36 @@ final class Form {
|
|||||||
$this->__button = new Button();
|
$this->__button = new Button();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function option($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null, $bmulti=false) {
|
public function option($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $aarr=array(), $thelp="", $tchange=null, $bmulti=false, $bgroup=false) {
|
||||||
$_enab = ($benable==true) ? "" : ' disabled=true';
|
$_enab = ($benable==true) ? "" : ' disabled=true';
|
||||||
$_req = ($breq==true) ? " required=true" : "";
|
$_req = ($breq==true) ? " required=true" : "";
|
||||||
$_change = ($tchange==null) ? '' : ' onchange="'.$tchange.'"';
|
$_change = ($tchange==null) ? '' : ' onchange="'.$tchange.'"';
|
||||||
$_multi = ($bmulti==true) ? ' multiple' : '';
|
$_multi = ($bmulti==true) ? ' multiple' : '';
|
||||||
$tout = '<select class="form-select option-tags" id="'.$tfield.'" name="'.$tfield.'"'.$_enab.$_change.$_req.$_multi.' >';
|
$tout = '<select class="form-select option-tags" id="'.$tfield.'" name="'.$tfield.'"'.$_enab.$_change.$_req.$_multi.' >';
|
||||||
if (count($aarr)>0) {
|
if (count($aarr)>0) {
|
||||||
|
$n_group = 0;
|
||||||
foreach ($aarr as $key => $val) {
|
foreach ($aarr as $key => $val) {
|
||||||
$_val2 = $val; $olabel = "";
|
$_val2 = $val; $olabel = "";
|
||||||
if (is_array($val)) {
|
if (is_array($val)) {
|
||||||
$_val2 = $val[0];
|
$_val2 = $val[0];
|
||||||
|
if ($bgroup) {
|
||||||
|
if (1==$val[1]) {
|
||||||
|
if (0<$n_group++) $tout .= '</optgroup>';
|
||||||
|
$tout .= '<optgroup label="'.$_val2.'">';
|
||||||
|
//$n_group++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$olabel = (isset($val[1])) ? ' olabel="'.$val[1].'"' : "";
|
$olabel = (isset($val[1])) ? ' olabel="'.$val[1].'"' : "";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if ($bgroup && $val[1]==1) continue;
|
||||||
$tout .= '<option value="'.$key.'"'.$olabel;
|
$tout .= '<option value="'.$key.'"'.$olabel;
|
||||||
$aval = array($tvalue);
|
$aval = array($tvalue);
|
||||||
if ($bmulti==true) $aval = explode(",", ($tvalue ?? "0"));
|
if ($bmulti==true) $aval = explode(",", ($tvalue ?? "0"));
|
||||||
$tout .= (in_array($key, $aval)) ? ' selected="selected"' : "";
|
$tout .= (in_array($key, $aval)) ? ' selected="selected"' : "";
|
||||||
$tout .= '>'.$_val2.'</option>';
|
$tout .= '>'.$_val2.'</option>';
|
||||||
}
|
}
|
||||||
|
if ($bgroup && $n_group>0) $tout .= '</optgroup>';
|
||||||
}
|
}
|
||||||
$tout .= '</select>';
|
$tout .= '</select>';
|
||||||
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
|
||||||
@@ -58,12 +69,12 @@ final class Form {
|
|||||||
$afield = ($afield==null) ? array("ID", "Nama", "Label") : $afield;
|
$afield = ($afield==null) ? array("ID", "Nama", "Label") : $afield;
|
||||||
$_twhere = ($twhere==null) ? "" : " WHERE ".$twhere;
|
$_twhere = ($twhere==null) ? "" : " WHERE ".$twhere;
|
||||||
$_twhere .= ($twhere===null || stripos($twhere,"ORDER BY")===false) ? " ORDER BY ".$afield[1] : "";
|
$_twhere .= ($twhere===null || stripos($twhere,"ORDER BY")===false) ? " ORDER BY ".$afield[1] : "";
|
||||||
$ahasil = array();
|
$ahasil = [];
|
||||||
if (is_array($addarray)) $ahasil[$addarray[0]] = (!isset($afield[2])) ? $addarray[1] : array($addarray[1], $addarray[2]);
|
if (is_array($addarray)) $ahasil[$addarray[0]] = (!isset($afield[2])) ? $addarray[1] : [$addarray[1], $addarray[2]];
|
||||||
if ($ttable<>null) {
|
if ($ttable<>null) {
|
||||||
$this->__db->Query("SELECT ".implode(",", $afield)." FROM ".$ttable.$_twhere);
|
$this->__db->Query("SELECT ".implode(",", $afield)." FROM ".$ttable.$_twhere);
|
||||||
while ($this->__db->Next()) {
|
while ($this->__db->Next()) {
|
||||||
$ahasil[$this->__db->Row($afield[0])] = (!isset($afield[2])) ? $this->__db->Row($afield[1]) : array($this->__db->Row($afield[1]), $this->__db->Row($afield[2]));
|
$ahasil[$this->__db->Row($afield[0])] = (!isset($afield[2])) ? $this->__db->Row($afield[1]) : [$this->__db->Row($afield[1]), $this->__db->Row($afield[2])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tout = $this->option($tlabel, $tfield, $tvalue, $benable, $breq, $ahasil, $thelp, $tchange, $bmulti);
|
$tout = $this->option($tlabel, $tfield, $tvalue, $benable, $breq, $ahasil, $thelp, $tchange, $bmulti);
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ final class Update {
|
|||||||
public function check_update() {
|
public function check_update() {
|
||||||
$_ainfo['build_cur'] = $_SESSION['__WEB_APP']['APP_BUILD'];
|
$_ainfo['build_cur'] = $_SESSION['__WEB_APP']['APP_BUILD'];
|
||||||
$_ainfo['svr_status'] = "Server Online";
|
$_ainfo['svr_status'] = "Server Online";
|
||||||
$_read = array("","","");
|
$_read = ["","",""];
|
||||||
|
|
||||||
$_url = "https://update.3fonia.com/".$_SESSION['__WEB_APP']['REG_ID']."/update.csv";
|
$_url = "https://update.3fonia.com/".$_SESSION['__WEB_APP']['REG_ID']."/update.csv";
|
||||||
$_fp = @fopen ($_url, 'r') or $_ainfo['svr_status'] = "Server Offline";
|
$_fp = @fopen ($_url, 'r') or $_ainfo['svr_status'] = "Server Offline";
|
||||||
|
|||||||
Reference in New Issue
Block a user