diff --git a/design.inc.php b/design.inc.php index 6fcd1ada..b73784fc 100644 --- a/design.inc.php +++ b/design.inc.php @@ -9,7 +9,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { -<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.8.1-dev"; ?> +<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.9.0-dev"; ?> @@ -99,8 +99,8 @@ function page_footer($missing = false) { } else { echo "

\n"; while ($row = $result->fetch_assoc()) { - echo '' . lang('select') . ' '; - echo '' . htmlspecialchars($row["Name"]) . "
\n"; + echo '' . lang('select') . ' '; + echo '' . htmlspecialchars($row["Name"]) . "
\n"; } echo "

\n"; } diff --git a/functions.inc.php b/functions.inc.php index 18de4993..de714cd8 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -216,7 +216,7 @@ function queries($query = null) { global $mysql; static $queries = array(); if (!isset($query)) { - return implode("\n", $queries); + return implode(";\n", $queries); } $queries[] = $query; return $mysql->query($query); diff --git a/index.php b/index.php index 7f9117ad..5810eabb 100644 --- a/index.php +++ b/index.php @@ -118,10 +118,49 @@ if (isset($_GET["download"])) { } elseif (isset($_GET["select"])) { include "./select.inc.php"; } else { - unset($_SESSION["tokens"][$_GET["server"]][$_SERVER["REQUEST_URI"]]); + if ($_POST["tables"] && !$error) { + $result = true; + $message = ""; + if (isset($_POST["truncate"])) { + foreach ($_POST["tables"] as $table) { + if (!queries("TRUNCATE " . idf_escape($table))) { + $result = false; + break; + } + } + $message = lang('Tables have been truncated.'); + } else { + $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 ($result) { + while ($row = $result->fetch_assoc()) { + $message .= htmlspecialchars("$row[Table]: $row[Msg_text]") . "
"; + } + } + } + query_redirect(queries(), substr($SELF, 0, -1), $message, $result, false, !$result); + } + page_header(lang('Database') . ": " . htmlspecialchars($_GET["db"]), $error, false); echo '

' . lang('Alter database') . "

\n"; echo '

' . lang('Database schema') . "

\n"; + + echo "

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

\n"; + $result = $mysql->query("SHOW TABLE STATUS"); + if (!$result->num_rows) { + echo "

" . lang('No tables.') . "

\n"; + } else { + echo "
\n"; + echo "\n"; + echo '\n"; + while ($row = $result->fetch_assoc()) { + echo '" . (isset($row["Rows"]) ? '\n"; + } + echo "
' . lang('Table') . '' . lang('Data Length') . "" . lang('Index Length') . "" . lang('Data Free') . "" . lang('Collation') . "" . lang('Auto Increment') . "Rows
' . htmlspecialchars($row["Name"]) . "$row[Data_length]$row[Index_length]$row[Data_free]$row[Collation]$row[Auto_increment]" . $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($row["Name"]))) : '' . lang('View')) . "
\n"; + echo "

\n"; + echo "
\n"; + } + $result->free(); + if ($mysql->server_info >= 5) { echo '

' . lang('Create view') . "

\n"; echo "

" . lang('Routines') . "

\n"; @@ -140,6 +179,7 @@ if (isset($_GET["download"])) { $result->free(); echo '

' . lang('Create procedure') . ' ' . lang('Create function') . "

\n"; } + if ($mysql->server_info >= 5.1) { echo "

" . lang('Events') . "

\n"; $result = $mysql->query("SHOW EVENTS"); diff --git a/lang/cs.inc.php b/lang/cs.inc.php index 0c8332d4..98869b14 100644 --- a/lang/cs.inc.php +++ b/lang/cs.inc.php @@ -136,7 +136,6 @@ $translations = array( 'Event' => 'Událost', 'MySQL version: %s through PHP extension %s' => 'Verze MySQL: %s přes PHP extenzi %s', '%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'), - 'around %d row(s)' => array('přibližně %d řádek', 'přibližně %d řádky', 'přibližně %d řádků'), 'ON UPDATE CURRENT_TIMESTAMP' => 'Při změně aktuální čas', 'Remove' => 'Odebrat', 'Are you sure?' => 'Opravdu?', @@ -187,4 +186,15 @@ $translations = array( 'End' => 'Konec', 'Status' => 'Stav', 'On completion preserve' => 'Po dokončení zachovat', + 'Tables and views' => 'Tabulky a pohledy', + 'Data Length' => 'Velikost dat', + 'Index Length' => 'Velikost indexů', + 'Data Free' => 'Volné místo', + 'Collation' => 'Porovnávání', + 'Analyze' => 'Analyzovat', + 'Optimize' => 'Optimalizovat', + 'Check' => 'Zkontrolovat', + 'Repair' => 'Opravit', + 'Truncate' => 'Promazat', + 'Tables have been truncated.' => 'Tabulky byly promazány.', ); diff --git a/lang/en.inc.php b/lang/en.inc.php index 853d50f2..4de590ae 100644 --- a/lang/en.inc.php +++ b/lang/en.inc.php @@ -5,6 +5,5 @@ $translations = array( 'Routine has been called, %d row(s) affected.' => array('Routine has been called, %d row affected.', 'Routine has been called, %d rows affected.'), '%d process(es) has been killed.' => array('%d process has been killed.', '%d processes have been killed.'), '%d row(s)' => array('%d row', '%d rows'), - 'around %d row(s)' => array('around %d row', 'around %d rows'), '%d item(s) have been deleted.' => array('%d item has been deleted.', '%d items have been deleted.'), );