1 && ($_POST["drop"] || $_POST["truncate"])) { 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["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 ($_POST["tables"] && ($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); echo '

' . ($_GET["ns"] == "" ? '' . lang('Alter database') . "\n" : ""); echo (support("scheme") ? "" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "\n" : ""); if ($_GET["ns"] !== "") { echo '' . lang('Database schema') . "\n"; $sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0); echo "

" . lang('Tables and views') . "

\n"; $tables_list = tables_list(); if (!$tables_list) { echo "

" . lang('No tables.') . "\n"; } else { echo "

\n"; echo "

\n"; if ($_POST["search"] && $_POST["query"] != "") { $_GET["where"][0]["op"] = "LIKE %%"; $_GET["where"][0]["val"] = $_POST["query"]; search_tables(); } echo "\n"; echo '\n"; foreach ($tables_list as $name => $type) { $view = (isset($type) && !eregi("table", $type)); echo '
' . lang('Table') . '' . lang('Engine') . '' . lang('Collation') . '' . lang('Data Length') . '' . lang('Index Length') . '' . lang('Data Free') . '' . lang('Auto Increment') . '' . lang('Rows') . (support("comment") ? '' . lang('Comment') : '') . "
' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');"); echo '' . h($name) . ''; if ($view) { echo '' . lang('View') . ''; echo '?'; } else { echo "  "; foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "auto_increment=1&create", "Rows" => "select") as $key => $link) { echo "?"; } } echo (support("comment") ? " " : ""); } echo "
 " . lang('%d in total', count($tables_list)); echo "" . $connection->result("SELECT @@storage_engine"); echo "" . db_collation(DB, collations()); foreach ($sums as $key => $val) { echo " "; } echo "
\n"; if (!information_schema(DB)) { echo "

" . ($driver == "sql" ? " " : "") . " \n"; $dbs = (support("scheme") ? schemas() : get_databases()); if (count($dbs) != 1 && $driver != "sqlite") { $db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB)); echo "

" . lang('Move to other database') . ($dbs ? ": " . html_select("target", $dbs, $db) : ': ') . " \n"; } } echo "

\n"; } echo '

' . lang('Create table') . "\n"; if (support("view")) { echo '' . lang('Create view') . "\n"; } if (support("routine")) { echo "

" . lang('Routines') . "

\n"; $routines = routines(); if ($routines) { echo "\n"; echo '\n"; odd(''); foreach ($routines as $row) { echo ''; 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 "
\n"; } echo '

' . lang('Create procedure') . ' ' . lang('Create function') . "\n"; } if (support("event")) { echo "

" . lang('Events') . "

\n"; $result = $connection->query("SHOW EVENTS"); if ($result && $result->num_rows) { echo "\n"; echo "\n"; while ($row = $result->fetch_assoc()) { echo ""; 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 "
\n"; } echo '

' . lang('Create event') . "\n"; } page_footer(); $table_status = table_status(); if ($table_status) { echo "\n"; } exit; // page_footer() already called }