1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) {
queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once
}
if ($_POST["truncate"]) {
if ($_POST["tables"]) {
$result = truncate_tables($_POST["tables"]);
}
$message = lang('Tables have been truncated.');
} elseif ($_POST["move"]) {
$result = move_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
$message = lang('Tables have been moved.');
} elseif ($_POST["copy"]) {
$result = copy_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
$message = lang('Tables have been copied.');
} elseif ($_POST["drop"]) {
if ($_POST["views"]) {
$result = drop_views($_POST["views"]);
}
if ($result && $_POST["tables"]) {
$result = drop_tables($_POST["tables"]);
}
$message = lang('Tables have been dropped.');
} elseif ($jush != "sql") {
$result = ($jush == "sqlite"
? queries("VACUUM")
: apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"])
);
$message = lang('Tables have been optimized.');
} elseif (!$_POST["tables"]) {
$message = lang('No tables.');
} elseif ($result = queries(($_POST["optimize"] ? "OPTIMIZE" : ($_POST["check"] ? "CHECK" : ($_POST["repair"] ? "REPAIR" : "ANALYZE"))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"])))) {
while ($row = $result->fetch_assoc()) {
$message .= "" . h($row["Table"]) . ": " . h($row["Msg_text"]) . "
";
}
}
queries_redirect(substr(ME, 0, -1), $message, $result);
}
page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"])), $error, true);
if ($adminer->homepage()) {
if ($_GET["ns"] !== "") {
echo "
' . lang('Create table') . "\n"; echo (support("view") ? '' . lang('Create view') . "\n" : ""); if (support("routine")) { echo "
' . lang('Name') . ' | ' . lang('Type') . ' | ' . lang('Return type') . " | |
---|---|---|---|
' . h($row["ROUTINE_NAME"]) . ''; echo ' | ' . h($row["ROUTINE_TYPE"]); echo ' | ' . h($row["DTD_IDENTIFIER"]); echo ' | ' . lang('Alter') . ""; } echo " |
' . (support("procedure") ? '' . lang('Create procedure') . '' : '') . '' . lang('Create function') . "\n" ; } if (support("sequence")) { echo "
" . lang('Name') . " |
---|
" . h($val) . "\n"; } echo " |
" . lang('Create sequence') . "\n"; } if (support("type")) { echo "
" . lang('Name') . " |
---|
" . h($val) . "\n"; } echo " |
" . lang('Create type') . "\n"; } if (support("event")) { 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 ' | ' . lang('Alter') . ''; } echo " |
event_scheduler
: " . h($event_scheduler) . "\n";
}
}
echo '
' . lang('Create event') . "\n"; } if ($tables_list) { echo "\n"; } } }