]> git.joonet.de Git - adminer.git/commitdiff
Show tables overview in Editor
authorJakub Vrana <jakub@vrana.cz>
Thu, 7 Oct 2010 14:17:34 +0000 (16:17 +0200)
committerJakub Vrana <jakub@vrana.cz>
Thu, 7 Oct 2010 14:17:34 +0000 (16:17 +0200)
adminer/db.inc.php
adminer/include/functions.inc.php
editor/db.inc.php

index bc67f4a4ad7579ea33df2002cc5db8acdb6d3370..504f475bc85aec4becdc27e02a14cc91fd5db63a 100644 (file)
@@ -48,8 +48,6 @@ if ($_GET["ns"] !== "") {
                echo "<form action='' method='post'>\n";
                echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n";
                if ($_POST["search"] && $_POST["query"] != "") {
-                       $_GET["where"][0]["op"] = "LIKE %%";
-                       $_GET["where"][0]["val"] = $_POST["query"];
                        search_tables();
                }
                echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
index e994e66f77f5c72613ea4c61b3a07fa49358ed37..1813196287b12d4326a724f81c1cda8a7d1401b2 100644 (file)
@@ -632,6 +632,8 @@ function process_input($field) {
 */
 function search_tables() {
        global $adminer, $connection;
+       $_GET["where"][0]["op"] = "LIKE %%";
+       $_GET["where"][0]["val"] = $_POST["query"];
        $found = false;
        foreach (table_status() as $table => $table_status) {
                $name = $adminer->tableName($table_status);
index 834cbf6f150dd8fc798b5a8df934406743ba24b3..ba8878645146b73dded2a4ce2d02d0d87a72df95 100644 (file)
@@ -1,14 +1,21 @@
 <?php
 page_header(lang('Server'), "", false);
 
-?>
-<form action=""><p>
-<?php echo lang('Search data in tables'); ?>:
-<?php hidden_fields_get(); ?>
-<input name="where[0][val]" value="<?php echo h($_GET["where"][0]["val"]); ?>">
-<input type="submit" value="<?php echo lang('Search'); ?>" />
-</form>
-<?php
-if ($_GET["where"][0]["val"] != "") {
+echo "<form action='' method='post'>\n";
+echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' value='" . lang('Search') . "'>\n";
+if ($_POST["query"] != "") {
        search_tables();
 }
+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\[/);"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n";
+foreach (table_status() as $table => $row) {
+       $name = $adminer->tableName($row);
+       if (isset($row["Engine"]) && $name != "") {
+               echo '<tr' . odd() . '><td>' . checkbox("tables[]", $table, in_array($table, (array) $_POST["tables"], true), "", "formUncheck('check-all');");
+               echo '<th><a href="' . h(ME) . 'select=' . urlencode($table) . '">' . h($name) . '</a>';
+               $val = number_format($row["Rows"], 0, '.', lang(','));
+               echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
+       }
+}
+echo "</table>\n";
+echo "</form>\n";