Move time information

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1363 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2010-04-02 15:27:37 +00:00
parent a0dd59ea64
commit d6972bde5b
2 changed files with 7 additions and 6 deletions

View file

@ -71,16 +71,16 @@ if (!$error && $_POST) {
break; break;
} }
} else { } else {
$end = explode(" ", microtime());
echo "<p class='time'>" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . "</p>\n";
do { do {
$result = $connection->store_result(); $result = $connection->store_result();
$end = explode(" ", microtime());
$time = " <span class='time'>(" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . ")</span>";
if (is_object($result)) { if (is_object($result)) {
select($result, $connection2); select($result, $connection2);
echo "<p>" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time;
if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q)) { if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q)) {
$id = "explain-$queries"; $id = "explain-$queries";
echo "<p>" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) . ", " : ""); echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>\n";
echo "<a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>\n";
echo "<div id='$id' class='hidden'>\n"; echo "<div id='$id' class='hidden'>\n";
select($connection2->query("EXPLAIN $q")); select($connection2->query("EXPLAIN $q"));
echo "</div>\n"; echo "</div>\n";
@ -91,9 +91,10 @@ if (!$error && $_POST) {
$_SESSION["databases"][$_GET["server"]] = null; // clear cache $_SESSION["databases"][$_GET["server"]] = null; // clear cache
session_write_close(); session_write_close();
} }
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "\n"; echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
} }
unset($result); // free resultset unset($result); // free resultset
$start = $end;
} while ($connection->next_result()); } while ($connection->next_result());
} }
$query = substr($query, $offset); $query = substr($query, $offset);

View file

@ -29,7 +29,7 @@ tr:hover td, tr:hover th { background: #ddf; }
.enum { color: #007F7F; } .enum { color: #007F7F; }
.binary { color: red; } .binary { color: red; }
.odd td { background: #F5F5F5; } .odd td { background: #F5F5F5; }
.time { color: silver; font-size: 70%; float: right; margin-top: -3em; } .time { color: silver; font-size: 70%; }
.function { text-align: right; } .function { text-align: right; }
.number { text-align: right; } .number { text-align: right; }
.datetime { text-align: right; } .datetime { text-align: right; }