1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Use SHOW TABLES in navigation for performance

Display view structure

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@891 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-24 06:05:21 +00:00
parent 7cea63e513
commit 0ed4c1d212
8 changed files with 102 additions and 100 deletions

View File

@@ -1,6 +1,31 @@
<?php
page_header(lang('View') . ": " . htmlspecialchars($_GET["view"]));
$dropped = false;
if ($_POST && !$error) {
if (strlen($_GET["view"])) {
$dropped = query_redirect("DROP VIEW " . idf_escape($_GET["view"]), substr($SELF, 0, -1), lang('View has been dropped.'), $_POST["drop"], !$_POST["dropped"]);
}
if (!$_POST["drop"]) {
query_redirect("CREATE VIEW " . idf_escape($_POST["name"]) . " AS\n$_POST[select]", $SELF . "table=" . urlencode($_POST["name"]), (strlen($_GET["view"]) ? lang('View has been altered.') : lang('View has been created.')));
}
}
$view = view($_GET["view"]);
echo "<pre class='jush-sql'>" . htmlspecialchars($view["select"]) . "</pre>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'createv=' . urlencode($_GET["view"]) . '">' . lang('Alter view') . "</a>\n";
page_header((strlen($_GET["view"]) ? lang('Alter view') : lang('Create view')), $error, array("table" => $_GET["view"]), $_GET["view"]);
$row = array();
if ($_POST) {
$row = $_POST;
} elseif (strlen($_GET["view"])) {
$row = view($_GET["view"]);
$row["name"] = $_GET["view"];
}
?>
<form action="" method="post">
<p><textarea name="select" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($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 htmlspecialchars($row["name"]); ?>" maxlength="64">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if (strlen($_GET["view"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
</form>