Update tablewiz.php
This commit is contained in:
parent
3ad89e6e80
commit
f3215e03bb
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!function_exists("tablewiz_create")) {
|
if(!function_exists("tablewiz_create")) {
|
||||||
function tablewiz_create($rows, $bind=array(), $domid="", $domclass="", $thead_html="", $tbody_html=array()) {
|
function tablewiz_create($rows, $bind=array(), $domid="", $domclass="", $thead_html=array(), $tbody_html_list=array()) {
|
||||||
$html = "";
|
$html = "";
|
||||||
|
|
||||||
if(count($rows) == 0) {
|
if(count($rows) == 0) {
|
||||||
|
|
@ -23,7 +23,11 @@ if(!function_exists("tablewiz_create")) {
|
||||||
$html_th_text = array_key_empty($k, $bind) ? $k : $bind[$k];
|
$html_th_text = array_key_empty($k, $bind) ? $k : $bind[$k];
|
||||||
$html_th_elms .= "<th>" . $html_th_text . "</th>";
|
$html_th_elms .= "<th>" . $html_th_text . "</th>";
|
||||||
}
|
}
|
||||||
$html_th_elms .= $thead_html; // append contents in thead
|
|
||||||
|
// append contents in thead
|
||||||
|
foreach($thead_html as $k=>$v) {
|
||||||
|
$html_th_elms .= "<th>" . $v . "</th>";
|
||||||
|
}
|
||||||
|
|
||||||
$html_tr_elms = "";
|
$html_tr_elms = "";
|
||||||
foreach($rows as $idx=>$record) {
|
foreach($rows as $idx=>$record) {
|
||||||
|
|
@ -32,10 +36,15 @@ if(!function_exists("tablewiz_create")) {
|
||||||
$html_tr_elms .= "<td>" . $v . "</td>";
|
$html_tr_elms .= "<td>" . $v . "</td>";
|
||||||
}
|
}
|
||||||
$html_tr_elms .= "</tr>";
|
$html_tr_elms .= "</tr>";
|
||||||
|
|
||||||
// append contents in tbody
|
// append contents in tbody
|
||||||
if(count($tbody_html) > $idx) {
|
if(count($tbody_html_list) > $idx) {
|
||||||
$html_tr_elms .= $tbody_html[$idx];
|
$tbody_html = $tbody_html_list[$idx];
|
||||||
|
if(is_array($tbody_html)) {
|
||||||
|
foreach($tbody_html as $k=>$v) {
|
||||||
|
$html_tr_elms .= "<td>" . $v . "</td>";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user