Get number of rows on export page asynchronously

This commit is contained in:
Jakub Vrana 2013-05-17 17:40:08 -07:00
parent 5a4d1b3704
commit fabfb8a0bc
2 changed files with 9 additions and 4 deletions

View file

@ -169,20 +169,24 @@ if (DB != "") {
echo "</thead>\n"; echo "</thead>\n";
$views = ""; $views = "";
//! defer number of rows to JavaScript $tables_list = tables_list();
foreach (table_status() as $name => $table_status) { foreach ($tables_list as $name => $type) {
$prefix = ereg_replace("_.*", "", $name); $prefix = ereg_replace("_.*", "", $name);
$checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name $checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name
$print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick(event, this); formUncheck('check-tables');"); $print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick(event, this); formUncheck('check-tables');");
if (is_view($table_status)) { if ($type !== null && !eregi("table", $type)) {
$views .= "$print\n"; $views .= "$print\n";
} else { } else {
echo "$print<td align='right'><label>" . ($table_status["Engine"] == "InnoDB" && $table_status["Rows"] ? "~ " : "") . $table_status["Rows"] . checkbox("data[]", $name, $checked, "", "checkboxClick(event, this); formUncheck('check-data');") . "</label>\n"; echo "$print<td align='right'><label><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked, "", "checkboxClick(event, this); formUncheck('check-data');") . "</label>\n";
} }
$prefixes[$prefix]++; $prefixes[$prefix]++;
} }
echo $views; echo $views;
if ($tables_list) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=db');</script>\n";
}
} else { } else {
echo "<thead><tr><th style='text-align: left;'><label><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . " onclick='formCheck(this, /^databases\\[/);'>" . lang('Database') . "</label></thead>\n"; echo "<thead><tr><th style='text-align: left;'><label><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . " onclick='formCheck(this, /^databases\\[/);'>" . lang('Database') . "</label></thead>\n";
$databases = $adminer->databases(); $databases = $adminer->databases();

View file

@ -13,6 +13,7 @@ Fix resetting search (bug #3612507)
Don't use LIMIT 1 if updating unique row (bug #3613109) Don't use LIMIT 1 if updating unique row (bug #3613109)
Restrict editing rows without unique identifier to search results Restrict editing rows without unique identifier to search results
Display navigation bellow main content on mobile browsers Display navigation bellow main content on mobile browsers
Get number of rows on export page asynchronously
MySQL: Optimize create table page and Editor navigation MySQL: Optimize create table page and Editor navigation
MySQL: Display bit type as binary number MySQL: Display bit type as binary number
MySQL: Improve export of binary data types MySQL: Improve export of binary data types