From 90044c22ac859c7e070a1a1092677f9b7deedcf9 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Mon, 10 Jul 2023 20:15:28 +0800 Subject: [PATCH] update --- ui_sidebar.php | 2 +- ui_table.php | 48 +++++++++++++++++------------------------------- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/ui_sidebar.php b/ui_sidebar.php index 413a806..35455be 100644 --- a/ui_sidebar.php +++ b/ui_sidebar.php @@ -59,7 +59,7 @@ } echo ' - +
'; } diff --git a/ui_table.php b/ui_table.php index 6a2039e..98b998a 100644 --- a/ui_table.php +++ b/ui_table.php @@ -20,26 +20,9 @@ class UITable { protected $title_cols=null; - private $heading=null; - private $heading_style="default"; - private $body=null; + private $thead_style=null; private $table_style="striped"; - public function set_heading($h) - { - $this->heading=$h; - } - - public function set_heading_style($hs) - { - $this->heading_style=$hs; - } - - public function set_body_text($bt) - { - $this->body=$bt; - } - public function set_title_col_text($f) { foreach($f as $tt) @@ -51,6 +34,11 @@ $this->title_cols=$f; } + public function set_title_thead_style($s) + { + $this->thead_style=$s; + } + public function set_table_style($ts) { $this->table_style=$ts; @@ -58,14 +46,6 @@ public function start() { - echo '
'; - - if($this->heading!=null) - echo '
'.$this->heading.'
'; - - if($this->body!=null) - echo '

'.$this->body.'

'; - if($this->table_style) echo ''; else @@ -73,6 +53,9 @@ if($this->title_cols!=null) { + if($this->thead_style!=null) + echo ''; + echo ''; foreach($this->title_cols as $field) { @@ -92,6 +75,9 @@ echo ''; } echo ''; + + if($this->thead_style!=null) + echo ''; } } @@ -101,6 +87,7 @@ public function start_col (){echo '';} + public function skip_col (){echo '';} public function echo_multi_col($text_list) @@ -121,8 +108,7 @@ public function end() { - echo '
';} public function end_col (){echo '';} public function echo_col ($text){echo ''.$text.'
-
'; + echo ''; } };//class UITable @@ -146,13 +132,13 @@ if($field_list==null) { - $field_list=get_field_list($sql,$sql_table_name); + $field_list=sql_get_field_list($sql,$sql_table_name); parent::set_title_col($field_list); $this->sql_fields=$field_list; - $this->sql_result=select_table_to_array($sql,$sql_table_name,null,$where,$start,$count); + $this->sql_result=sql_select_table_to_array($sql,$sql_table_name,null,$where,$start,$count); } else { @@ -160,7 +146,7 @@ $this->sql_fields=$field_list; - $this->sql_result=select_table_to_array($sql,$sql_table_name,$field_list,$where,$start,$count); + $this->sql_result=sql_select_table_to_array($sql,$sql_table_name,$field_list,$where,$start,$count); } }