table child update

This commit is contained in:
2025-12-05 15:40:37 +07:00
parent 8864811189
commit 3ea59c7ac7
3 changed files with 49 additions and 56 deletions
+10 -6
View File
@@ -6,9 +6,9 @@
Desc. : v4 - HTML Table (jQuery & Bootstrap)
Created By : Siau Pheng ([email protected]).
Created Date : January 16th, 2008.
Last Modified : October 19th, 2023.
Last Modified : December 4th, 2025.
(c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
(c) 2008 - 2025, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
@@ -112,8 +112,12 @@ final class Table {
$this->__acontrol['value'] = $tvalue;
}
public function add_row_form($tlabel = "", $tfunc = "", $tfield = "", $tvalue = "") {
$this->__aoption[] = ['type' => "button", 'func' => $tfunc, 'icon' => "fon-tabel-dt", 'label' => $tlabel, 'field' => $tfield, 'value' => $tvalue];
public function add_row_form($ticon = "pencil", $tlabel = "", $tfunc = "", $tfield = "", $tvalue = "") {
if ($tfunc == "") {
$this->__aoption[] = ['type' => "button-dt", 'func' => $tlabel, 'icon' => "pencil", 'label' => $ticon];
} else {//todo: new format with icon, upgrade all later !
$this->__aoption[] = ['type' => "button-dt", 'func' => $tfunc, 'icon' => $ticon, 'label' => $tlabel, 'field' => $tfield, 'value' => $tvalue];
}
}
public function add_row_btn($ticon = "", $tlabel = "", $tfunc = "", $tfield = "", $tvalue = "", $tfield_css = "", $avalue_css = []) {
@@ -184,7 +188,7 @@ final class Table {
if ((($this->__acontrol['field']===false) || ($this->__cdb->Row($this->__acontrol['field'])==$this->__acontrol['value'])) && $this->__bnobutton===false) {
// adding all option
for ($i=0; $i<count($this->__aoption); $i++) {
if ($this->__aoption[$i]['type']=="button") {
if (in_array($this->__aoption[$i]['type'], ["button","button-dt"])) {
if (($this->__aoption[$i]['field']!="") && ($this->__cdb->Row($this->__aoption[$i]['field'])<>(trim("".$this->__aoption[$i]['value'])!="" ? $this->__aoption[$i]['value'] : $_SESSION['__WEB_USER']['UNIX']))) {} else {
$aoption['button'][] = [$this->__aoption[$i]['icon'], (empty($this->__aoption[$i]['field_css'])?'':$this->__aoption[$i]['avalue_css'][$this->__cdb->Row($this->__aoption[$i]['field_css'])]??'')];
}
@@ -265,7 +269,7 @@ final class Table {
if ((($this->__acontrol['field']===false) || ($this->__cdb->Row($this->__acontrol['field'])==$this->__acontrol['value'])) && $this->__bnobutton===false) {
// adding all option
for ($i=0; $i<count($this->__aoption); $i++) {
if ($this->__aoption[$i]['type']=="button") {
if (in_array($this->__aoption[$i]['type'], ["button","button-dt"])) {
if (($this->__aoption[$i]['field']!="") && ($this->__cdb->Row($this->__aoption[$i]['field'])<>(trim("".$this->__aoption[$i]['value'])!="" ? $this->__aoption[$i]['value'] : $_SESSION['__WEB_USER']['UNIX']))) {} else {
$aoption['button'][] = [$this->__aoption[$i]['icon'], (empty($this->__aoption[$i]['field_css'])?'':$this->__aoption[$i]['avalue_css'][$this->__cdb->Row($this->__aoption[$i]['field_css'])]??'')];
}