[r1466]: trunk / adminer / view.inc.php  Maximize  Restore  History

Download this file

35 lines (31 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$TABLE = $_GET["view"];
$dropped = false;
if ($_POST && !$error) {
$dropped = drop_create(
"DROP VIEW " . idf_escape($TABLE),
"CREATE VIEW " . idf_escape($_POST["name"]) . " AS\n$_POST[select]",
($_POST["drop"] ? substr(ME, 0, -1) : ME . "table=" . urlencode($_POST["name"])),
lang('View has been dropped.'),
lang('View has been altered.'),
lang('View has been created.'),
$TABLE
);
}
page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, array("table" => $TABLE), $TABLE);
$row = array();
if ($_POST) {
$row = $_POST;
} elseif ($TABLE != "") {
$row = view($TABLE);
$row["name"] = $TABLE;
}
?>
<form action="" method="post">
<p><textarea name="select" rows="10" cols="80" style="width: 98%;"><?php echo h($row["select"]); ?></textarea>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php if ($dropped) { // old view was dropped but new wasn't created ?><input type="hidden" name="dropped" value="1"><?php } ?>
<?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64">
<input type="submit" value="<?php echo lang('Save'); ?>">
</form>

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks