From 1b34824493d94ce8eb851c5616f50822a116cf9b Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Thu, 26 Jul 2007 09:18:58 +0000 Subject: [PATCH] Remove column or parameter by button git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@260 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- create.inc.php | 10 +++++----- editing.inc.php | 9 +++++++-- procedure.inc.php | 10 +++++----- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/create.inc.php b/create.inc.php index 06195caa..2ac1a29f 100644 --- a/create.inc.php +++ b/create.inc.php @@ -1,5 +1,5 @@ free(); if ($_POST) { $row = $_POST; ksort($row["fields"]); - if (!$_POST["add"]) { - echo "

" . lang('Unable to operate table') . ": " . htmlspecialchars($error) . "

\n"; - $row["fields"] = array_values($row["fields"]); - } else { + $row["fields"] = array_values($row["fields"]); + if ($_POST["add"]) { array_splice($row["fields"], key($_POST["add"]), 0, array(array())); + } elseif (!$_POST["drop_col"]) { + echo "

" . lang('Unable to operate table') . ": " . htmlspecialchars($error) . "

\n"; } if ($row["auto_increment_col"]) { $row["fields"][$row["auto_increment_col"] - 1]["auto_increment"] = true; diff --git a/editing.inc.php b/editing.inc.php index 34fe6ab3..ae455c0b 100644 --- a/editing.inc.php +++ b/editing.inc.php @@ -102,14 +102,14 @@ function edit_fields($fields, $collations, $type = "TABLE") { ?> -" />" maxlength="64" /> +" />" maxlength="64" /> checked="checked" /> checked="checked" /> " maxlength="255" /> - + query("DROP $routine " . idf_escape($_GET["procedure"])) && $_POST["drop"]) { redirect(substr($SELF, 0, -1), lang('Routine has been dropped.')); } @@ -34,11 +34,11 @@ if ($_POST) { $row = $_POST; $row["fields"] = (array) $row["fields"]; ksort($row["fields"]); - if (!$_POST["add"]) { - echo "

" . lang('Unable to operate routine') . ": " . htmlspecialchars($error) . "

\n"; - $row["fields"] = array_values($row["fields"]); - } else { + $row["fields"] = array_values($row["fields"]); + if ($_POST["add"]) { array_splice($row["fields"], key($_POST["add"]), 0, array(array())); + } elseif (!$_POST["drop_col"]) { + echo "

" . lang('Unable to operate routine') . ": " . htmlspecialchars($error) . "

\n"; } } elseif (strlen($_GET["procedure"])) { $row = routine($_GET["procedure"], $routine);