function drawTableSQL($head, $query, $hasKey = FALSE, $table = '', $showEdit = FALSE, $showDelete = FALSE) { global $_MySQL; //echo $query; drawTable_top($head); $_MySQL->restart(); $_MySQL->query($query); while ($row = $_MySQL->getRow()) { echo html_tr_open(); drawTable_row($row, $hasKey, $table, $showEdit, $showDelete); echo html_tr_close(); } drawTable_bottom(); }
function formtable($data, $span = 0) { $s = html_table_open('formtable'); $s .= html_tr_open('formtablerow'); $i = -1; foreach ($data as $disp => $html) { if ($disp[0] == '_') { $s .= $html; } else { if ($html == 'x') { continue; } if ($span > 0) { $i++; if ($i > $span) { $i = 0; $s .= html_tr_close(); $s .= html_tr_open('formtablerow'); } } else { $s .= html_tr_open('formtablerow'); } $s .= html_td_open('formtablecell') . $disp . html_td_close(); $s .= html_td_open('formtablecell') . $html . html_td_close(); if ($span == 0) { $s .= html_tr_close(); } } } $s .= html_tr_close(); $s .= htmlElm_close('table'); return $s; }