-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@198 7c3ca157-0c34-0410-bff1-cbf682f78f5c
- Loading branch information
jakubvrana
committed
Jul 16, 2007
1 parent
a7096dd
commit 67096cd
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE"); | ||
|
||
if ($_POST && !$error) { | ||
if (strlen($_GET["procedure"]) && $mysql->query("DROP $routine " . idf_escape($_GET["procedure"])) && $_POST["drop"]) { | ||
redirect(substr($SELF, 0, -1), lang('Routine has been dropped.')); | ||
} | ||
if (!$_POST["drop"]) { | ||
$set = array(); | ||
ksort($_POST["fields"]); | ||
foreach ($_POST["fields"] as $field) { | ||
$set[] = idf_escape($field["field"]) . process_type($field); | ||
} | ||
if ($mysql->query( | ||
"CREATE $routine " . idf_escape($_POST["name"]) | ||
. " (" . implode(", ", $set) . ")" | ||
. (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"]) : "") . " | ||
$_POST[definition]" | ||
)) { | ||
redirect(substr($SELF, 0, -1), (strlen($_GET["createp"]) ? lang('Routine has been altered.') : lang('Routine has been created.'))); | ||
} | ||
} | ||
} | ||
|
||
$collations = get_vals("SHOW CHARACTER SETS"); | ||
?> | ||
<table border="0" cellspacing="0" cellpadding="2"> | ||
<tr><th><?php echo lang('Return type'); ?></th><?php echo edit_type("returns", $row["returns"], $collations); ?></tr> | ||
</table> | ||
<?php echo type_change(count($row["fields"])); ?> | ||
<?php if (isset($_GET["function"])) { ?> | ||
<script type="text/javascript"> | ||
document.getElementById('form')['returns[type]'].onchange(); | ||
</script> | ||
<?php } ?> |