diff --git a/adminer/db.inc.php b/adminer/db.inc.php
index a07da025..20944c96 100644
--- a/adminer/db.inc.php
+++ b/adminer/db.inc.php
@@ -38,8 +38,6 @@ if (support("scheme")) {
}
if ($_GET["ns"] !== "") {
echo '' . lang('Database schema') . "\n";
- $sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
-
echo "
| " . lang('%d in total', count($tables_list));
echo " | " . nbsp($connection->result("SELECT @@storage_engine"));
echo " | " . nbsp(db_collation(DB, collations()));
- foreach ($sums as $key => $val) {
+ foreach (array("Data_length", "Index_length", "Data_free") as $key) {
echo " | ";
}
echo "\n";
@@ -157,33 +155,6 @@ if ($_GET["ns"] !== "") {
}
page_footer();
- $table_status = table_status();
- if ($table_status) {
- echo "\n";
- }
+ echo "\n";
exit; // page_footer() already called
}
diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php
index ffa2b137..242f1a89 100644
--- a/adminer/include/connect.inc.php
+++ b/adminer/include/connect.inc.php
@@ -44,17 +44,13 @@ function connect_error() {
}
}
page_footer("db");
- echo "\n";
+ echo "\n";
}
if (isset($_GET["status"])) {
$_GET["variables"] = $_GET["status"];
}
-if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]))) {
+if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]) || $_GET["script"] == "connect")) {
if (DB != "") {
set_session("dbs", null);
}
diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php
index 68ae314f..621ec5bc 100644
--- a/adminer/include/design.inc.php
+++ b/adminer/include/design.inc.php
@@ -86,8 +86,4 @@ function page_footer($missing = "") {
navigation($missing); ?>
0, "Index_length" => 0, "Data_free" => 0);
+ foreach (table_status() as $row) {
+ $id = addcslashes($row["Name"], "\\'/");
+ echo "setHtml('Comment-$id', '" . nbsp($row["Comment"]) . "');\n";
+ if (!is_view($row)) {
+ foreach (array("Engine", "Collation") as $key) {
+ echo "setHtml('$key-$id', '" . nbsp($row[$key]) . "');\n";
+ }
+ foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
+ if ($row[$key] != "") {
+ $val = number_format($row[$key], 0, '.', lang(','));
+ echo "setHtml('$key-$id', '" . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "');\n";
+ if (isset($sums[$key])) {
+ $sums[$key] += ($row["Engine"] != "InnoDB" || $key != "Data_free" ? $row[$key] : 0);
+ }
+ } elseif (array_key_exists($key, $row)) {
+ echo "setHtml('$key-$id');\n";
+ }
+ }
+ }
+ }
+ foreach ($sums as $key => $val) {
+ echo "setHtml('sum-$key', '" . number_format($val, 0, '.', lang(',')) . "');\n";
+ }
+} else { // connect
+ foreach (count_tables(get_databases()) as $db => $val) {
+ echo "setHtml('tables-" . addcslashes($db, "\\'/") . "', '$val');\n";
+ }
+}
+
+exit; // don't print footer
|
---|