1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Maintain insert prefill value

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@957 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-08-03 13:37:29 +00:00
parent 1589362522
commit db46fc24cb
3 changed files with 22 additions and 16 deletions

View File

@@ -8,10 +8,16 @@ foreach ($fields as $name => $field) {
}
}
if ($_POST && !$error && !isset($_GET["select"])) {
$location = ($_POST["insert"] // continue edit or insert
? $_SERVER["REQUEST_URI"]
: ME . (isset($_GET["default"]) ? "table=" : "select=") . urlencode($_GET["edit"]) //! append &set converted to &where
);
$location = $_SERVER["REQUEST_URI"]; // continue edit or insert
if (!$_POST["insert"]) {
$location = ME . (isset($_GET["default"]) ? "table=" : "select=") . urlencode($_GET["edit"]);
$i = 0; // append &set converted to &where
foreach ((array) $_GET["set"] as $key => $val) {
if ($val == $_POST["fields"][$key]) {
$location .= where_link($i++, bracket_escape($key, "back"), $val);
}
}
}
$set = array();
foreach ($fields as $name => $field) {
$val = process_input($field);