update 2023-04-10

This commit is contained in:
2023-04-10 11:25:34 +07:00
parent 9e890303ba
commit b64325d3c6
12 changed files with 1703 additions and 592 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ final class App {
// perubahan variabel dari data konfigurasi
$asrc = array("[_CREATOR_NAME_]", "[_CREATOR_WEBSITE_]", "[_CREATOR_YEAR_]", "[_APP_NAME_VER_]", "[_APP_NAMES_VER_]", "[_APP_NAME_]", "[_APP_NAMES_]", "[_APP_NAMES_UP_]", "[_APP_VER_]", "[_APP_UPDATED_]", "[_REG_ID_]", "[_REG_NAME_]", "[_REG_NAME_UP_]", "[_REG_ADDRESS_]", "[_REG_CITY_]", "[_REG_CITY_UP_]", "[_REG_PHONE_]", "[_REG_FAX_]", "[_REG_EMAIL_]", "[_REG_POSTCODE_]", "[_REG_WEBSITE_]", "[_REG_YEAR_]", "[_USER_LASTLOG_]", "[_USER_IMG_]", "[_WEB_PATH_]", "[_NAVI_SIDEBAR_]", "[_NAVI_HEADER_]");
$adst = array($this->apps['CREATOR_NAME'], $this->apps['CREATOR_WEBSITE'], $this->apps['CREATOR_YEAR'], $this->apps['APP_NAME']." v".$this->apps['APP_VER'], $this->apps['APP_NAMES']." v".$this->apps['APP_VER'], $this->apps['APP_NAME'], $this->apps['APP_NAMES'], strtoupper($this->apps['APP_NAMES']), $this->apps['APP_VER'], $this->apps['APP_UPDATED'], $this->reg->reg_id(), $this->apps['REG_NAME'], strtoupper($this->apps['REG_NAME']), $this->apps['REG_ADDRESS'], $this->apps['REG_CITY'], strtoupper($this->apps['REG_CITY']), $this->apps['REG_PHONE'], $this->apps['REG_FAX'], $this->apps['REG_EMAIL'], $this->apps['REG_POSTCODE'], $this->apps['REG_WEBSITE'], $this->apps['REG_YEAR'], $this->auser['user_info'] ?? "[none]", "profiles/".$this->auser['user_img'], $this->apps['WEB_PATH'], $tnaviside, $tnavihead);
$adst = array($this->apps['CREATOR_NAME'], $this->apps['CREATOR_WEBSITE'], $this->apps['CREATOR_YEAR'], $this->apps['APP_NAME']." v".$this->apps['APP_VER'], $this->apps['APP_NAMES']." v".$this->apps['APP_VER'], $this->apps['APP_NAME'], $this->apps['APP_NAMES'], strtoupper($this->apps['APP_NAMES']??""), $this->apps['APP_VER'], $this->apps['APP_UPDATED'], $this->reg->reg_id(), $this->apps['REG_NAME'], strtoupper($this->apps['REG_NAME']??""), $this->apps['REG_ADDRESS'], $this->apps['REG_CITY'], strtoupper($this->apps['REG_CITY']??""), $this->apps['REG_PHONE'], $this->apps['REG_FAX'], $this->apps['REG_EMAIL'], $this->apps['REG_POSTCODE'], $this->apps['REG_WEBSITE'], $this->apps['REG_YEAR'], $this->auser['user_info'] ?? "[none]", "profiles/".$this->auser['user_img'], $this->apps['WEB_PATH'], $tnaviside, $tnavihead);
$buffer = str_replace($asrc, $adst, $buffer);
if (isset($this->auser) && is_array($this->auser)) {
+1 -1
View File
@@ -81,7 +81,7 @@ final class MySQL {
function SafeSQL($str) {
if (!$this->cnn) $this->Connect();
return mysqli_real_escape_string($this->cnn, $str);
return mysqli_real_escape_string($this->cnn, strval($str));
}
function &Query($stqry = "", $dbname = "") {
+19 -12
View File
@@ -3,12 +3,12 @@
/*******************************************************************
Module : /Function/Misc.php
Desc. : v4 - Fungsi Custom Lain Lain
Desc. : v3 - Fungsi Custom Lain Lain
Created By : Siau Pheng ([email protected]).
Created Date : January 27th, 2008.
Last Modified : May 6th, 2021.
Last Modified : March 30th, 2023.
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM.
(c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
@@ -134,8 +134,9 @@ if (!function_exists('abjad')) {
if (!function_exists('checkbox')) {
function checkbox($nilai = 0) {
$bhasil = ((is_string($nilai) && ($nilai=="N" || $nilai=="0")) or (is_numeric($nilai) && $nilai==0) or (is_bool($nilai) && $nilai==false)) ? true : false;
return '<input class="form-check-input" type="checkbox" '.(($bhasil)?"":"checked").' readonly />';
$thasil = ((is_string($nilai) && ($nilai=="N" || $nilai=="0")) or (is_numeric($nilai) && $nilai==0) or (is_bool($nilai) && $nilai==false)) ? "circle text-secondary" : "check-circle text-info";
return '<i class="fs-6 cui-'.$thasil.'"></i>';
//return '<input class="form-check-input" type="checkbox" '.(($bhasil)?"":"checked").' readonly />';
}
}
@@ -204,12 +205,6 @@ if (!function_exists('tgl_range_hari')) {
}
}
if (!function_exists('bulan_array')) {
function bulan_array() {
return array("1"=>"Januari","2"=>"Februari","3"=>"Maret","4"=>"April","5"=>"Mei","6"=>"Juni","7"=>"Juli","8"=>"Agustus","9"=>"September","10"=>"Oktober","11"=>"November","12"=>"Desember");
}
}
if (!function_exists('tgl_akhbln')) {
function tgl_akhbln($tgl) {
$atgl = explode("-", $tgl);
@@ -258,6 +253,18 @@ if (!function_exists('tgl_triwulan')) {
}
}
if (!function_exists('bulan_array')) {
function bulan_array() {
return array("1"=>"Januari","2"=>"Februari","3"=>"Maret","4"=>"April","5"=>"Mei","6"=>"Juni","7"=>"Juli","8"=>"Agustus","9"=>"September","10"=>"Oktober","11"=>"November","12"=>"Desember");
}
}
if (!function_exists('triwulan_array')) {
function triwulan_array() {
return ["1"=>"Triwulan 1","2"=>"Triwulan 2","3"=>"Triwulan 3","4"=>"Triwulan 4"];
}
}
/*************************** FORMAT TAMPILAN & ERROR *****************************/
if (!function_exists('subjudul')) {
@@ -281,7 +288,7 @@ if (!function_exists('br2nl')) {
if (!function_exists('isi_nol')) {
function isi_nol($nilai = "0", $panjang = 1) {
$nilai = strval($nilai);
return str_repeat("0", $panjang-strlen($nilai)).$nilai;
return ($panjang>strlen($nilai) ? str_repeat("0", $panjang-strlen($nilai)):'').$nilai;
}
}
+17 -7
View File
@@ -3,12 +3,12 @@
/*******************************************************************
Module : /Web/Form.php
Desc. : v4 - Form Generator (jQuery & Bootstrap)
Desc. : v3 - Form Generator (jQuery & Bootstrap)
Created By : Siau Pheng ([email protected]).
Created Date : February 27th, 2008.
Last Modified : April 17th, 2022.
Last Modified : March 24th, 2023.
(c) 2008 - 2022, 3FONIA Software; WWW.3FONIA.COM.
(c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
@@ -44,7 +44,7 @@ final class Form {
}
$tout .= '<option value="'.$key.'"'.$olabel;
$aval = array($tvalue);
if ($bmulti==true) $aval = explode(",", $tvalue);
if ($bmulti==true) $aval = explode(",", ($tvalue ?? "0"));
$tout .= (in_array($key, $aval)) ? ' selected="selected"' : "";
$tout .= '>'.$_val2.'</option>';
}
@@ -131,7 +131,7 @@ final class Form {
$bhasil = ((is_string($tvalue) && in_array($tvalue,array("N","T","0"))) or (is_numeric($tvalue) && $tvalue==0) or (is_bool($tvalue) && $tvalue===false) or empty($tvalue)) ? true : false;
$_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : "";
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.$tchange.'"';
$_change = ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.($tchange==null?'':$tchange).'"';
$tout = '<div class="form-check form-check-inline mr-1"><input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req;
$tout .= ($bhasil==false) ? ' checked="checked"' : '';
$tout .= '></div>';
@@ -203,7 +203,17 @@ final class Form {
return $tout;
}
public function textauto($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="") {
public function textauto($tlabel="", $tfield, $avalue=['value'=>0,'text'=>""], $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="") {
$_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : "";
$_max = ($nmaxsize==null) ? "" : ' maxlength="'.$nmaxsize.'"';
$_holdtxt = ($holdtxt==null) ? "" : ' placeholder="'.$holdtxt.'"';
$tout = '<input type="search" class="form-control" id="'.$tfield.'" name="'.$tfield.'" value="'.$avalue['text'].'"'.$_enab.$_max.$_holdtxt.$_req.' autocomplete="off" />';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout;
}
/*public function textauto($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="") {
$tvalue = ($tvalue==null) ? array('value'=>0, 'text'=>"") : $tvalue;
$_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : "";
@@ -212,7 +222,7 @@ final class Form {
$tout = '<select class="form-control" id="'.$tfield.'" name="'.$tfield.'" default-value="'.$tvalue['value'].'" default-text="'.$tvalue['text'].'"'.$_enab.$_max.$_holdtxt.$_req.' /></select>';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout;
}
}*/
public function datebox($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tkeyup=null, $tblur=null) {
if ($tvalue<>null) $tvalue = tgl_sql2str($tvalue);
+2 -2
View File
@@ -102,14 +102,14 @@ final class Menu {
$ticon = ($amodul[$i]['Icon']) ? '<i class="me-2 '.$amodul[$i]['Icon'].'"></i>' : "";
if (isset($amodul[$i+1]) && ($amodul[$i+1]['Level']>$amodul[$i]['Level'])) {//have submenu
if ($amodul[$i]['Level']==$mulai_level) {
$thasil .= '<li class="nav-item pe-3 dropdown"><a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu" data-bs-popper="none">';
$thasil .= '<li class="nav-item pe-4 dropdown"><a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu" data-bs-popper="none">';
} else {
$thasil .= '<li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle slink" data-bs-toggle="dropdown" aria-expanded="false" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu" data-bs-popper="none">';
}
} else if (trim($amodul[$i]['Menu'])=="-" && $amodul[$i]['Level']>$mulai_level) {//divider
$thasil .= '<li class="dropdown-divider"></li>';
} else if ($amodul[$i]['Level']==$mulai_level) {//level = 1 + no submenu
$thasil .= '<li class="nav-item pe-3"><a class="nav-link mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a></li>';
$thasil .= '<li class="nav-item pe-4"><a class="nav-link mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a></li>';
} else {// level > 1 + no submenu
$thasil .= '<li><a class="dropdown-item mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a></li>';
}
+1 -1
View File
@@ -25,7 +25,7 @@ final class Register {
}
static public function reg_id() {
$id = $_SESSION['__WEB_APP']['REG_ID'];
$id = $_SESSION['__WEB_APP']['REG_ID'] ?? "";
return (substr($id,0,3).".".substr($id,3,3).".".substr($id,6));
}