* @brief TableWiz helper */ if(!is_fn("tablewiz_cut_str")) { function tablewiz_cut_str($str, $strlimit=0) { $plaintext = strip_tags($str); // if use html, do not cut text if($strlimit > 0 && $str != $plaintext) { $str = substr($str, 0, $strlimit); } return $str; } } if(!is_fn("tablewiz_create")) { function tablewiz_create($rows, $bind=array(), $domid="", $domclass="", $strlimit=0, $thead_html=array(), $tbody_html_list=array()) { $html = ""; if(count($rows) == 0) { return $html; } $dom_element_name = make_random_id(10); $domid = empty($domid) ? "tablewiz_id_" . $dom_element_name : $domid; $domclass = empty($domclass) ? "tablewiz_class_" . $dom_element_name : $domclass; $html_th_elms = ""; foreach($rows[0] as $k=>$v) { $html_th_text = array_key_empty($k, $bind) ? $k : $bind[$k]; $html_th_elms .= "