Skip to content
Newer
Older
100644 36 lines (31 sloc) 1.09 KB
f2d21d2 @vrana Sequences
authored May 5, 2010
1 <?php
2 $SEQUENCE = $_GET["sequence"];
3
4 if ($_POST && !$error) {
5 $link = substr(ME, 0, -1);
ef867e6 @vrana Trim identifiers (bug #3405309)
authored Sep 10, 2011
6 $name = trim($_POST["name"]);
f2d21d2 @vrana Sequences
authored May 5, 2010
7 if ($_POST["drop"]) {
8 query_redirect("DROP SEQUENCE " . idf_escape($SEQUENCE), $link, lang('Sequence has been dropped.'));
9 } elseif ($SEQUENCE == "") {
ef867e6 @vrana Trim identifiers (bug #3405309)
authored Sep 10, 2011
10 query_redirect("CREATE SEQUENCE " . idf_escape($name), $link, lang('Sequence has been created.'));
11 } elseif ($SEQUENCE != $name) {
12 query_redirect("ALTER SEQUENCE " . idf_escape($SEQUENCE) . " RENAME TO " . idf_escape($name), $link, lang('Sequence has been altered.'));
f2d21d2 @vrana Sequences
authored May 5, 2010
13 } else {
14 redirect($link);
15 }
16 }
17
18 page_header($SEQUENCE != "" ? lang('Alter sequence') . ": " . h($SEQUENCE) : lang('Create sequence'), $error);
19
b7e1cb0 @vrana Save bytes
authored Aug 8, 2011
20 $row = $_POST;
21 if (!$row) {
22 $row = array("name" => $SEQUENCE);
f2d21d2 @vrana Sequences
authored May 5, 2010
23 }
24 ?>
25
26 <form action="" method="post">
27 <p><input name="name" value="<?php echo h($row["name"]); ?>">
28 <input type="submit" value="<?php echo lang('Save'); ?>">
29 <?php
30 if ($SEQUENCE != "") {
a93bc19 @vrana Create confirm function
authored Oct 18, 2010
31 echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
f2d21d2 @vrana Sequences
authored May 5, 2010
32 }
33 ?>
740ae10 @vrana Don't send incomplete forms
authored Mar 8, 2011
34 <input type="hidden" name="token" value="<?php echo $token; ?>">
f2d21d2 @vrana Sequences
authored May 5, 2010
35 </form>
Something went wrong with that request. Please try again.