1) {
queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once
}
if (isset($_POST["truncate"])) {
if ($_POST["tables"]) {
foreach ($_POST["tables"] as $table) {
if (!queries("TRUNCATE " . idf_escape($table))) {
$result = false;
break;
}
}
$message = lang('Tables have been truncated.');
}
} elseif (isset($_POST["move"])) {
$rename = array();
foreach ($tables_views as $table) {
$rename[] = idf_escape($table) . " TO " . idf_escape($_POST["target"]) . "." . idf_escape($table);
}
$result = queries("RENAME TABLE " . implode(", ", $rename));
$message = lang('Tables have been moved.');
} elseif ((!isset($_POST["drop"]) || !$_POST["views"] || queries("DROP VIEW " . implode(", ", array_map('idf_escape', $_POST["views"]))))
&& (!$_POST["tables"] || ($result = queries((isset($_POST["optimize"]) ? "OPTIMIZE" : (isset($_POST["check"]) ? "CHECK" : (isset($_POST["repair"]) ? "REPAIR" : (isset($_POST["drop"]) ? "DROP" : "ANALYZE")))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"])))))
) {
if (isset($_POST["drop"])) {
$message = lang('Tables have been dropped.');
} else {
while ($row = $result->fetch_assoc()) {
$message .= h("$row[Table]: $row[Msg_text]") . "
";
}
}
}
query_redirect(queries(), substr(ME, 0, -1), $message, $result, false, !$result);
}
page_header(lang('Database') . ": " . h(DB), $error, false);
echo '
' . lang('Alter database') . "\n"; echo '
' . lang('Database schema') . "\n"; echo "
' . lang('Create view') . "\n"; echo "
" . h($row["ROUTINE_TYPE"]); echo ' | ' . h($row["ROUTINE_NAME"]) . ''; echo ' | ' . lang('Alter') . ""; } echo " |
---|
' . lang('Create procedure') . ' ' . lang('Create function') . "\n"; } if ($dbh->server_info >= 5.1 && ($result = $dbh->query("SHOW EVENTS"))) { echo "
" . lang('Name') . " | " . lang('Schedule') . " | " . lang('Start') . " | " . lang('End') . " | |
---|---|---|---|---|
' . h($row["Name"]) . ""; echo " | " . ($row["Execute at"] ? lang('At given time') . " | " . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . " | $row[Starts]"); echo " | $row[Ends]"; } echo " |