update 2023-08-04 fixed cache, form and fonia3.js

This commit is contained in:
2023-08-04 17:29:07 +07:00
parent 8e7d327a4f
commit 06e524f9b3
4 changed files with 30 additions and 18 deletions
+3 -4
View File
@@ -4,7 +4,7 @@
Desc. : JS - Fonia Custom Class v3
Created By : Siau Pheng ([email protected]).
Created Date : June 19th, 2009.
Last Modified : May 15th, 2023.
Last Modified : July 6th, 2023.
(c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
@@ -385,7 +385,7 @@ var FoniaJS = {
}
});
$('.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');
if ($(_dmodal).hasClass('modal')) _opts.dropdownParent = _dmodal;
var _sel2 = $(this).select2(_opts);
@@ -858,8 +858,7 @@ Request.JSONF = function(options){//oke
_lmenu.push(val);
});
if (10 > ini.content.length){
opsi.lengthMenu.push([10]);
opsi.lengthMenu.push([10]);
opsi.lengthMenu.push([10],[10]);
}else{
_lmenu.push(-1), opsi.lengthMenu.push(_lmenu), _lmenu.pop();
_lmenu.push(ini.content.length), opsi.lengthMenu.push(_lmenu);
+9 -7
View File
@@ -6,9 +6,9 @@
Desc. : v3 - Class cache aplikasi
Created By : Siau Pheng (siaupheng@3fonia.com).
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,12 +79,14 @@ final class Cache {
}
// add locale file
$ljs = (isset($_SESSION['__WEB_USER']['LOCALE'])?$_SESSION['__WEB_USER']['LOCALE']:$_SESSION['__WEB_APP']['DEF_LOCALE']).".js";
if ($handle = opendir($this->__localedir)) {
while (false !== ($file = readdir($handle))) {
$file = $this->__localedir . $file;
if (substr($file, -5) == $ljs) $afile[] = $this->__localedir .basename(str_replace("\\", "/", $file));
if (is_dir($this->__localedir)) {
if ($handle = opendir($this->__localedir)) {
while (false !== ($file = readdir($handle))) {
$file = $this->__localedir . $file;
if (substr($file, -5) == $ljs) $afile[] = $this->__localedir .basename(str_replace("\\", "/", $file));
}
closedir($handle);
}
closedir($handle);
}
$afile[] = $this->__jsapp . $mode . ".js";
} else if ($type == "app") {
+17 -6
View File
@@ -6,7 +6,7 @@
Desc. : v3 - Form Generator (jQuery & Bootstrap)
Created By : Siau Pheng (siaupheng@3fonia.com).
Created Date : February 27th, 2008.
Last Modified : March 24th, 2023.
Last Modified : July 5th, 2023.
(c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
@@ -29,25 +29,36 @@ final class Form {
$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';
$_req = ($breq==true) ? " required=true" : "";
$_change = ($tchange==null) ? '' : ' onchange="'.$tchange.'"';
$_multi = ($bmulti==true) ? ' multiple' : '';
$tout = '<select class="form-select option-tags" id="'.$tfield.'" name="'.$tfield.'"'.$_enab.$_change.$_req.$_multi.' >';
if (count($aarr)>0) {
$n_group = 0;
foreach ($aarr as $key => $val) {
$_val2 = $val; $olabel = "";
if (is_array($val)) {
$_val2 = $val[0];
$olabel = (isset($val[1])) ? ' olabel="'.$val[1].'"' : "";
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].'"' : "";
}
}
if ($bgroup && $val[1]==1) continue;
$tout .= '<option value="'.$key.'"'.$olabel;
$aval = array($tvalue);
if ($bmulti==true) $aval = explode(",", ($tvalue ?? "0"));
$tout .= (in_array($key, $aval)) ? ' selected="selected"' : "";
$tout .= '>'.$_val2.'</option>';
}
if ($bgroup && $n_group>0) $tout .= '</optgroup>';
}
$tout .= '</select>';
$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;
$_twhere = ($twhere==null) ? "" : " WHERE ".$twhere;
$_twhere .= ($twhere===null || stripos($twhere,"ORDER BY")===false) ? " ORDER BY ".$afield[1] : "";
$ahasil = array();
if (is_array($addarray)) $ahasil[$addarray[0]] = (!isset($afield[2])) ? $addarray[1] : array($addarray[1], $addarray[2]);
$ahasil = [];
if (is_array($addarray)) $ahasil[$addarray[0]] = (!isset($afield[2])) ? $addarray[1] : [$addarray[1], $addarray[2]];
if ($ttable<>null) {
$this->__db->Query("SELECT ".implode(",", $afield)." FROM ".$ttable.$_twhere);
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);
+1 -1
View File
@@ -30,7 +30,7 @@ final class Update {
public function check_update() {
$_ainfo['build_cur'] = $_SESSION['__WEB_APP']['APP_BUILD'];
$_ainfo['svr_status'] = "Server Online";
$_read = array("","","");
$_read = ["","",""];
$_url = "https://update.3fonia.com/".$_SESSION['__WEB_APP']['REG_ID']."/update.csv";
$_fp = @fopen ($_url, 'r') or $_ainfo['svr_status'] = "Server Offline";