echo "</thead>\n";
$views = "";
foreach (table_status() as $row) {
- $checked = (strlen($TABLE) && $row["Name"] != $TABLE);
+ $checked = !strlen($TABLE) || $row["Name"] == $TABLE;
$print = "<tr><td>" . checkbox("tables[]", $row["Name"], $checked, $row["Name"], "form_uncheck('check-tables');");
if (!$row["Engine"]) {
$views .= "$print\n";
* @return string
*/
function checkbox($name, $value, $checked, $label = "", $onclick = "") {
- $return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . ">";
- return (strlen($label) ? "<label>$return" . h($label) . "</label>" : $return);
+ static $id = 0;
+ $id++;
+ $return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . " id='checkbox-$id'>";
+ return (strlen($label) ? "<label for='checkbox-$id'>$return" . h($label) . "</label>" : $return);
}
/** Generate list of HTML options
Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.php
Highlight SQL textarea - may use external CodePress
Mass editation of individual rows
-IE6 - <label for>
Offer enum and set items in search - whisperer
Use event $intervals + microseconds in relative date functions
? Column and table names auto-completition in SQL textarea