From 4df6accd7b94a9ad56dcaf6b7bd8c1fded802582 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Thu, 28 Jan 2010 14:29:10 +0000 Subject: [PATCH] Print sums in tables overview git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1299 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/db.inc.php | 10 +++++++++- adminer/lang/cs.inc.php | 1 + changes.txt | 1 + todo.txt | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/adminer/db.inc.php b/adminer/db.inc.php index befc1e67..78c68d9d 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -48,7 +48,8 @@ if (!$table_status) { } else { echo "
\n"; echo "\n"; - echo '\n"; + echo '\n"; + $sums = array(); foreach ($table_status as $row) { $name = $row["Name"]; echo '
' . lang('Table') . '' . lang('Engine') . '' . lang('Collation') . '' . lang('Data Length') . '' . lang('Index Length') . '' . lang('Data Free') . '' . lang('Auto Increment') . '' . lang('Rows') . '' . lang('Comment') . "
' . lang('Table') . '' . lang('Engine') . '' . lang('Collation') . '' . lang('Data Length') . '' . lang('Index Length') . '' . lang('Data Free') . '' . lang('Auto Increment') . '' . lang('Rows') . '' . lang('Comment') . "
' . checkbox((isset($row["Rows"]) ? "tables[]" : "views[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');"); @@ -58,6 +59,7 @@ if (!$table_status) { foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") as $key => $link) { $val = number_format($row[$key], 0, '.', lang(',')); echo '' . ($row[$key] != "" ? '' . str_replace(" ", " ", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '' : ' '); + $sums[$link] += ($row["Engine"] != "InnoDB" || $link != "edit" ? $row[$key] : 0); } echo "" . nbsp($row["Comment"]); } else { @@ -66,6 +68,12 @@ if (!$table_status) { echo ' '; } } + echo "
 " . lang('%d in total', count($table_status)); + echo "" . $connection->result($connection->query("SELECT @@storage_engine")); + echo "" . db_collation(DB, collations()); + foreach (array("create", "indexes", "edit") as $val) { + echo "" . number_format($sums[$val], 0, '.', lang(',')); + } echo "
\n"; echo "

\n"; $dbs = get_databases(); diff --git a/adminer/lang/cs.inc.php b/adminer/lang/cs.inc.php index c8797e7c..8f4f5ec2 100644 --- a/adminer/lang/cs.inc.php +++ b/adminer/lang/cs.inc.php @@ -227,4 +227,5 @@ $translations = array( 'Webserver file %s' => 'Soubor %s na webovém serveru', 'File does not exist.' => 'Soubor neexistuje.', 'Permanent login' => 'Trvalé přihlášení', + '%d in total' => '%d celkem', ); diff --git a/changes.txt b/changes.txt index 9949beeb..3fd63a9e 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer 2.3.0-dev: Support for permanent login (customization required) Show status variables +Print sums in tables overview Add Delete button to Edit page (regression from 2.0.0) Simplify SQL syntax error message Show SQL query info if available diff --git a/todo.txt b/todo.txt index c9c1ef58..fb0a384c 100644 --- a/todo.txt +++ b/todo.txt @@ -8,6 +8,7 @@ Offer enum and set items in search - whisperer Variables editation, especially timezone Use event $intervals + microseconds in relative date functions Optionally check IP address +Disable spell checking in SQL textareas - spellcheck="false" ? Column and table names auto-completition in SQL textarea ? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB ? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB