2007-07-02 05:51:26 +00:00
|
|
|
<?php
|
2007-07-06 08:47:20 +00:00
|
|
|
function page_header($title) {
|
2007-07-09 15:28:37 +00:00
|
|
|
global $LANG;
|
2007-07-02 05:51:26 +00:00
|
|
|
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">
|
2007-07-09 15:28:37 +00:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $LANG; ?>">
|
2007-07-02 05:51:26 +00:00
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
2007-07-11 05:53:07 +00:00
|
|
|
<meta name="robots" content="noindex" />
|
|
|
|
<title><?php echo lang('phpMinAdmin') . " - $title"; ?></title>
|
2007-07-11 09:52:22 +00:00
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AAAA/wBhTgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEQAAAAAAERExAAAAARERExEAABERMREzMQABExMRERMRAAExMRETMRAAATERERMRAAABExERExAAAAETERExEAAAATERETERERARMRETESESEBMTETESEREQExEzESEREhETMxEREhERIREREAARISIRAAAAAAERERD/4z8A/wM/APgDAADAAwAAgAMAAIAHAACADwAAgB8AAIAfAACAAQAAAAEAAAABAAAAAAAAAAAAAAcAAAD/gQAA" />
|
2007-07-02 05:51:26 +00:00
|
|
|
<style type="text/css">
|
|
|
|
BODY { color: Black; background-color: White; }
|
|
|
|
A { color: Blue; }
|
|
|
|
A:visited { color: Navy; }
|
2007-07-05 11:51:06 +00:00
|
|
|
H1 { font-size: 150%; margin: 0; }
|
2007-07-10 20:57:35 +00:00
|
|
|
H2 { font-size: 150%; margin: 0; }
|
2007-07-10 21:30:50 +00:00
|
|
|
H3 { margin: 0; }
|
2007-07-06 08:47:20 +00:00
|
|
|
FIELDSET { float: left; padding: .5em; margin: 0; }
|
2007-07-10 20:57:35 +00:00
|
|
|
PRE { margin: .12em 0; }
|
|
|
|
TABLE { margin-top: 1em; }
|
2007-07-02 05:51:26 +00:00
|
|
|
.error { color: Red; }
|
|
|
|
.message { color: Green; }
|
2007-07-06 08:47:20 +00:00
|
|
|
#menu { position: absolute; top: 8px; left: 8px; width: 15em; overflow: auto; white-space: nowrap; }
|
2007-07-02 05:51:26 +00:00
|
|
|
#content { margin-left: 16em; }
|
|
|
|
</style>
|
2007-07-11 05:29:53 +00:00
|
|
|
<?php if ($_SESSION["highlight"] == "jush") { ?>
|
2007-07-10 06:30:04 +00:00
|
|
|
<style type="text/css">@import url(http://jush.info/jush.css);</style>
|
|
|
|
<script type="text/javascript" src="http://jush.info/jush.js" defer="defer"></script>
|
2007-07-11 05:29:53 +00:00
|
|
|
<script type="text/javascript">body.onload = function () { jush.highlight_tag('pre'); }</script>
|
|
|
|
<?php } ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
</head>
|
|
|
|
|
2007-07-11 05:29:53 +00:00
|
|
|
<body>
|
2007-07-02 05:51:26 +00:00
|
|
|
|
2007-07-06 08:47:20 +00:00
|
|
|
<div id="content">
|
|
|
|
<?php
|
|
|
|
echo "<h2>$title</h2>\n";
|
|
|
|
if ($_SESSION["message"]) {
|
|
|
|
echo "<p class='message'>$_SESSION[message]</p>\n";
|
|
|
|
$_SESSION["message"] = "";
|
|
|
|
}
|
2007-07-09 14:46:11 +00:00
|
|
|
session_write_close();
|
2007-07-06 08:47:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function page_footer($missing = false) {
|
2007-07-10 13:30:42 +00:00
|
|
|
global $SELF, $mysql;
|
2007-07-06 08:47:20 +00:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
2007-07-02 05:51:26 +00:00
|
|
|
<div id="menu">
|
2007-07-05 15:03:06 +00:00
|
|
|
<h1><a href="<?php echo (strlen($SELF) > 1 ? htmlspecialchars(substr($SELF, 0, -1)) : "."); ?>"><?php echo lang('phpMinAdmin'); ?></a></h1>
|
2007-07-05 10:46:44 +00:00
|
|
|
<?php switch_lang(); ?>
|
2007-07-05 11:51:06 +00:00
|
|
|
<?php if ($missing != "auth") { ?>
|
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-10 15:08:36 +00:00
|
|
|
<a href="<?php echo htmlspecialchars(preg_replace('~db=[^&]*&~', '', $SELF)); ?>logout="><?php echo lang('Logout'); ?></a>
|
2007-07-02 05:51:26 +00:00
|
|
|
</p>
|
|
|
|
<form action="" method="get">
|
2007-07-05 10:58:09 +00:00
|
|
|
<p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
|
|
|
|
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
|
2007-07-02 05:51:26 +00:00
|
|
|
<?php
|
2007-07-06 08:47:20 +00:00
|
|
|
flush();
|
2007-07-10 13:30:42 +00:00
|
|
|
$result = $mysql->query("SHOW DATABASES");
|
|
|
|
while ($row = $result->fetch_row()) {
|
2007-07-02 05:51:26 +00:00
|
|
|
echo "<option" . ($row[0] == $_GET["db"] ? " selected='selected'" : "") . ">" . htmlspecialchars($row[0]) . "</option>\n";
|
|
|
|
}
|
2007-07-10 13:30:42 +00:00
|
|
|
$result->free();
|
2007-07-02 05:51:26 +00:00
|
|
|
?>
|
|
|
|
</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-10 13:30:42 +00:00
|
|
|
$result = $mysql->query("SHOW TABLE STATUS");
|
|
|
|
if (!$result->num_rows) {
|
2007-07-02 05:51:26 +00:00
|
|
|
echo "<p class='message'>" . lang('No tables.') . "</p>\n";
|
|
|
|
} else {
|
|
|
|
echo "<p>\n";
|
2007-07-10 13:30:42 +00:00
|
|
|
while ($row = $result->fetch_assoc()) {
|
2007-07-09 06:12:22 +00:00
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row["Name"]) . '">' . lang('select') . '</a> ';
|
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . (isset($row["Engine"]) ? 'table' : 'view') . '=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a><br />\n";
|
2007-07-02 05:51:26 +00:00
|
|
|
}
|
|
|
|
echo "</p>\n";
|
|
|
|
}
|
2007-07-09 06:12:22 +00:00
|
|
|
echo '<p><a href="' . htmlspecialchars($SELF) . 'create=">' . lang('Create new table') . "</a></p>\n";
|
2007-07-10 13:30:42 +00:00
|
|
|
$result->free();
|
2007-07-02 05:51:26 +00:00
|
|
|
}
|
2007-07-05 11:51:06 +00:00
|
|
|
}
|
|
|
|
?>
|
2007-07-02 05:51:26 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<?php
|
|
|
|
}
|