update 2023-08-04 fixed cache, form and fonia3.js
This commit is contained in:
+9
-7
@@ -6,9 +6,9 @@
|
||||
Desc. : v3 - Class cache aplikasi
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
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
@@ -6,7 +6,7 @@
|
||||
Desc. : v3 - Form Generator (jQuery & Bootstrap)
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
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
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user