2007-07-02 05:51:26 +00:00
|
|
|
<?php
|
|
|
|
function page_header($title, $missing = false) {
|
|
|
|
global $SELF;
|
|
|
|
header("Content-Type: text/html; charset=utf-8");
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="cs">
|
|
|
|
<head>
|
|
|
|
<title><?php echo lang('phpMinAdmin') . ($title ? " - $title" : ""); ?></title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<style type="text/css">
|
|
|
|
BODY { color: Black; background-color: White; }
|
|
|
|
A { color: Blue; }
|
|
|
|
A:visited { color: Navy; }
|
|
|
|
H2 { font-size: 150%; margin-top: 0; }
|
|
|
|
.error { color: Red; }
|
|
|
|
.message { color: Green; }
|
|
|
|
#menu { float: left; width: 15em; overflow: auto; white-space: nowrap; }
|
|
|
|
#menu H1 { font-size: 150%; margin: 0; }
|
|
|
|
#menu H1 A { color: Black; }
|
|
|
|
#content { margin-left: 16em; }
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if ($missing != "auth") {
|
|
|
|
?>
|
|
|
|
<div id="menu">
|
|
|
|
<h1><a href="<?php echo htmlspecialchars(substr($SELF, 0, -1)); ?>"><?php echo lang('phpMinAdmin'); ?></a></h1>
|
2007-07-05 10:46:44 +00:00
|
|
|
<?php switch_lang(); ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
<p>
|
|
|
|
<a href="<?php echo htmlspecialchars($SELF); ?>sql="><?php echo lang('SQL command'); ?></a>
|
|
|
|
<a href="<?php echo htmlspecialchars($SELF); ?>dump="><?php echo lang('Dump'); ?></a>
|
2007-07-02 15:52:29 +00:00
|
|
|
<a href="<?php echo htmlspecialchars($SELF); ?>logout="><?php echo lang('Logout'); ?></a>
|
2007-07-02 05:51:26 +00:00
|
|
|
</p>
|
|
|
|
<form action="" method="get">
|
|
|
|
<p><select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
|
|
|
|
<?php
|
|
|
|
$result = mysql_query("SHOW DATABASES");
|
|
|
|
while ($row = mysql_fetch_row($result)) {
|
|
|
|
echo "<option" . ($row[0] == $_GET["db"] ? " selected='selected'" : "") . ">" . htmlspecialchars($row[0]) . "</option>\n";
|
|
|
|
}
|
|
|
|
mysql_free_result($result);
|
|
|
|
?>
|
|
|
|
</select><?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?></p>
|
|
|
|
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
|
|
|
</form>
|
|
|
|
<?php
|
2007-07-02 20:21:30 +00:00
|
|
|
if ($missing != "db" && strlen($_GET["db"])) {
|
2007-07-02 05:51:26 +00:00
|
|
|
$result = mysql_query("SHOW TABLES");
|
|
|
|
if (!mysql_num_rows($result)) {
|
|
|
|
echo "<p class='message'>" . lang('No tables.') . "</p>\n";
|
|
|
|
} else {
|
|
|
|
echo "<p>\n";
|
|
|
|
while ($row = mysql_fetch_row($result)) {
|
2007-07-02 15:52:29 +00:00
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row[0]) . '">' . lang('select') . '</a> ';
|
2007-07-02 05:51:26 +00:00
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row[0]) . '">' . htmlspecialchars($row[0]) . "</a><br />\n"; //! views
|
|
|
|
}
|
|
|
|
echo "</p>\n";
|
|
|
|
}
|
|
|
|
echo '<p><a href="' . htmlspecialchars($SELF) . 'create=">' . lang('Create new table') . "</a></p>\n"; //! rights
|
|
|
|
mysql_free_result($result);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="content">
|
|
|
|
<?php
|
2007-07-05 05:15:53 +00:00
|
|
|
echo "<h2>$title</h2>\n";
|
2007-07-02 05:51:26 +00:00
|
|
|
}
|
|
|
|
if ($_SESSION["message"]) {
|
|
|
|
echo "<p class='message'>$_SESSION[message]</p>\n";
|
|
|
|
$_SESSION["message"] = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function page_footer($missing = false) {
|
|
|
|
echo "\n" . ($missing ? "" : "</div>\n");
|
|
|
|
?>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<?php
|
|
|
|
}
|