1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 11:34:10 +02:00

Display number of manipulated rows in JS confirm

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1133 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-09-23 12:21:14 +00:00
parent 6168e0b601
commit 06ce6828b1
5 changed files with 20 additions and 11 deletions

View File

@@ -8,15 +8,13 @@ if ($tables_views && !$error) {
queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once
}
if (isset($_POST["truncate"])) {
if ($_POST["tables"]) {
foreach ($_POST["tables"] as $table) {
if (!queries("TRUNCATE " . idf_escape($table))) {
$result = false;
break;
}
foreach ((array) $_POST["tables"] as $table) {
if (!queries("TRUNCATE " . idf_escape($table))) {
$result = false;
break;
}
$message = lang('Tables have been truncated.');
}
$message = lang('Tables have been truncated.');
} elseif (isset($_POST["move"])) {
$rename = array();
foreach ($tables_views as $table) {
@@ -66,7 +64,7 @@ if (!$table_status) {
}
}
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') . "'$confirm> <input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\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?') . " (' + form_checked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + form_checked(this, /tables|views/) + ')');\">\n";
$dbs = get_databases();
if (count($dbs) != 1) {
$db = (isset($_POST["target"]) ? $_POST["target"] : DB);