]> git.joonet.de Git - adminer.git/commitdiff
Print sums in tables overview
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 28 Jan 2010 14:29:10 +0000 (14:29 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 28 Jan 2010 14:29:10 +0000 (14:29 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1299 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/db.inc.php
adminer/lang/cs.inc.php
changes.txt
todo.txt

index befc1e67eb2fd78051ade5f159fe74d48a96d447..78c68d9d00b740f1e7f6143077b77a9493af2df8 100644 (file)
@@ -48,7 +48,8 @@ if (!$table_status) {
 } else {
        echo "<form action='' method='post'>\n";
        echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
-       echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);" title="' . count($table_status) . '"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . '<td>' . lang('Comment') . "</thead>\n";
+       echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . '<td>' . lang('Comment') . "</thead>\n";
+       $sums = array();
        foreach ($table_status as $row) {
                $name = $row["Name"];
                echo '<tr' . odd() . '><td>' . 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 '<td align="right">' . ($row[$key] != "" ? '<a href="' . h(ME . "$link=") . urlencode($name) . '">' . str_replace(" ", "&nbsp;", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '</a>' : '&nbsp;');
+                               $sums[$link] += ($row["Engine"] != "InnoDB" || $link != "edit" ? $row[$key] : 0);
                        }
                        echo "<td>" . nbsp($row["Comment"]);
                } else {
@@ -66,6 +68,12 @@ if (!$table_status) {
                        echo '<td>&nbsp;';
                }
        }
+       echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($table_status));
+       echo "<td>" . $connection->result($connection->query("SELECT @@storage_engine"));
+       echo "<td>" . db_collation(DB, collations());
+       foreach (array("create", "indexes", "edit") as $val) {
+               echo "<td align='right'>" . number_format($sums[$val], 0, '.', lang(','));
+       }
        echo "</table>\n";
        echo "<p><input type='hidden' name='token' value='$token'><input type='submit' value='" . lang('Analyze') . "'> <input type='submit' name='optimize' value='" . lang('Optimize') . "'> <input type='submit' name='check' value='" . lang('Check') . "'> <input type='submit' name='repair' value='" . lang('Repair') . "'> <input type='submit' name='truncate' value='" . lang('Truncate') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables|views/) + ')');\">\n";
        $dbs = get_databases();
index c8797e7c832d8f49d19e7b7313a959a085369374..8f4f5ec28dc383279ba3187ef43a183314ef078e 100644 (file)
@@ -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',
 );
index 9949beeb5a60f31b53c024b45a0dfb232e040846..3fd63a9ec6b97f80029b3bbdbae97abcf70eb2fd 100644 (file)
@@ -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
index c9c1ef58cc8c5b8d15357a137b32e991fb774ede..fb0a384c543118c19689093bd670a52a26c4a700 100644 (file)
--- 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