upgrade with bootstrap 5.2
This commit is contained in:
+29
-16
@@ -3,31 +3,33 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /App.php
|
||||
Desc. : v3 - HTML5 Page Generator v3 (jQuery & CoreUI)
|
||||
Desc. : v4 - HTML5 Page Generator (jQuery & CoreUI)
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 10th, 2008.
|
||||
Last Modified : May 8th, 2021.
|
||||
Last Modified : October 17th, 2022.
|
||||
|
||||
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
|
||||
(c) 2008 - 2022, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace siaupheng\fonia3;
|
||||
namespace siaupheng\fonia4;
|
||||
|
||||
final class App {
|
||||
public $version = "3.0.0";
|
||||
public $version = "4.0.0";
|
||||
private $apps = array();
|
||||
private $auser = array();
|
||||
private $cache = null;
|
||||
private $menu = null;
|
||||
private $reg = null;
|
||||
protected $__db = null;
|
||||
protected $__form = null;
|
||||
|
||||
public function __construct($db = null){
|
||||
if (is_resource($db)) { $this->__db = $db; }
|
||||
else $this->__db = new \siaupheng\fonia3\DB\MySQL();
|
||||
else { $this->__db = new \siaupheng\fonia4\DB\MySQL(); }
|
||||
$this->__form = new \siaupheng\fonia4\Web\Form($this->__db);
|
||||
|
||||
$this->apps = $_SESSION['__WEB_APP'];
|
||||
$this->apps['TEMPLATE'] = "index.php";
|
||||
@@ -39,9 +41,9 @@ final class App {
|
||||
$this->auser['user_img'] = $this->auser['ID'].".webp";
|
||||
}
|
||||
}
|
||||
$this->reg = new \siaupheng\fonia3\Web\Register($this->__db);
|
||||
$this->cache = new \siaupheng\fonia3\Data\Cache($this->__db);
|
||||
$this->menu = new \siaupheng\fonia3\Web\Menu($this->__db);
|
||||
$this->reg = new \siaupheng\fonia4\Web\Register($this->__db);
|
||||
$this->cache = new \siaupheng\fonia4\Data\Cache($this->__db);
|
||||
$this->menu = new \siaupheng\fonia4\Web\Menu($this->__db);
|
||||
}
|
||||
|
||||
public function TampilApp($aoption = array()) {
|
||||
@@ -97,10 +99,10 @@ final class App {
|
||||
$buffer = str_replace($asrc, $adst, $buffer);
|
||||
|
||||
if (isset($this->auser) && is_array($this->auser)) {
|
||||
$buffer = str_replace("[_USER_ID_]", $this->auser['UserID'], $buffer);
|
||||
$buffer = str_replace("[_USER_USER_]", $this->auser['Username'], $buffer);
|
||||
$buffer = str_replace("[_USER_NAME_]", $this->auser['Nama'], $buffer);
|
||||
$buffer = str_replace("[_USER_POSISI_]", $this->auser['Posisi'], $buffer);
|
||||
$buffer = str_replace("[_USER_ID_]", $this->auser['UserID']??"", $buffer);
|
||||
$buffer = str_replace("[_USER_USER_]", $this->auser['Username']??"", $buffer);
|
||||
$buffer = str_replace("[_USER_NAME_]", $this->auser['Nama']??"", $buffer);
|
||||
$buffer = str_replace("[_USER_POSISI_]", $this->auser['Posisi']??"", $buffer);
|
||||
|
||||
// menu modul
|
||||
$t_modul = "";
|
||||
@@ -122,7 +124,15 @@ final class App {
|
||||
foreach ($this->auser['MENU_MODUL'] as $modul) {
|
||||
$href = $href1.$modul['APP_PATH'].$href2;
|
||||
$href .= '/?auth='.$_SESSION['APP_TOKEN'];
|
||||
$t_modul .= '<a class="dropdown-item slink" href="'.$href.'"><i class="c-icon mr-2 '.$modul['Icon'].'"></i> '.$modul['Judul'].'</a>';
|
||||
$t_modul .= '<a class="dropdown-item slink" href="'.$href.'"><i class="icon me-2 '.$modul['Icon'].'"></i> '.$modul['Judul'].'</a>';
|
||||
}
|
||||
}
|
||||
// menu extra
|
||||
$amodul_ext = $aoption['MENU_MODUL'] ?? [];
|
||||
if (count($amodul_ext) > 0) {
|
||||
$t_modul .= '<div class="dropdown-divider"></div>';
|
||||
foreach ($amodul_ext as $modul) {
|
||||
$t_modul .= '<a class="dropdown-item slink" id="'.$modul['Id'].'"><i class="icon me-2 '.$modul['Icon'].'"></i> '.$modul['Judul'].'</a>';
|
||||
}
|
||||
}
|
||||
$buffer = str_replace("[_MENU_MODUL_]", $t_modul, $buffer);
|
||||
@@ -141,10 +151,13 @@ final class App {
|
||||
if (count($aoption) > 0) {
|
||||
foreach ($aoption as $__key => $val) {
|
||||
if (strpos($__key, "OPTION")!==false) {
|
||||
$opt_var = (new cFORM())->option("Pilihan", $__key, $val['value'], true, $val['option']);
|
||||
$opt_var = $this->__form->option("_", $__key, $val['value'], true, true, $val['option']);
|
||||
$buffer = str_replace("[_".$__key."_]", $opt_var, $buffer);
|
||||
} else if (strpos($__key, "RADIO")!==false) {
|
||||
$opt_var = $this->__form->radio("_", $__key, $val['value'], true, true, $val['radio']);
|
||||
$buffer = str_replace("[_".$__key."_]", $opt_var, $buffer);
|
||||
} else if (strpos($__key, "PICKDATE")!==false) {
|
||||
$txt_var = (new cFORM())->datebox("Tanggal", $__key, $val['value'], true);
|
||||
$txt_var = $this->__form->datebox("_", $__key, $val['value'], true, true);
|
||||
$buffer = str_replace("[_".$__key."_]", $txt_var, $buffer);
|
||||
} else if (strpos($__key, "CUSTOM")!==false) {
|
||||
$buffer = str_replace("[_".$__key."_]", $val['value'], $buffer);
|
||||
|
||||
Reference in New Issue
Block a user