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");
|
2007-07-12 10:09:37 +00:00
|
|
|
?>
|
2007-07-02 05:51:26 +00:00
|
|
|
<!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-13 09:13:06 +00:00
|
|
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
2007-07-11 05:53:07 +00:00
|
|
|
<meta name="robots" content="noindex" />
|
|
|
|
<title><?php echo lang('phpMinAdmin') . " - $title"; ?></title>
|
2007-07-11 09:57:06 +00:00
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
2007-07-11 12:07:17 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="default.css" />
|
2007-07-13 07:07:28 +00:00
|
|
|
<?php if ($_COOKIE["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-14 09:33:16 +00:00
|
|
|
<script type="text/javascript">window.onload = function () { if (jush) jush.highlight_tag('pre'); }</script>
|
2007-07-11 05:29:53 +00:00
|
|
|
<?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-17 05:54:19 +00:00
|
|
|
if (isset($_SESSION["databases"][$_GET["server"]]) && !isset($_GET["sql"])) {
|
2007-07-12 10:09:37 +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-12 10:09:37 +00:00
|
|
|
?>
|
2007-07-06 08:47:20 +00:00
|
|
|
</div>
|
|
|
|
|
2007-07-02 05:51:26 +00:00
|
|
|
<div id="menu">
|
2007-07-17 09:54:00 +00:00
|
|
|
<h1><a href="<?php echo ($missing == "auth" ? "http://phpminadmin.sourceforge.net" : (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>
|
2007-07-11 15:44:35 +00:00
|
|
|
<a href="<?php echo htmlspecialchars($SELF); ?>dump=<?php echo urlencode($_GET["table"]); ?>"><?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>
|
2007-07-11 14:23:14 +00:00
|
|
|
<form action="">
|
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-16 11:41:49 +00:00
|
|
|
if (!isset($_SESSION["databases"][$_GET["server"]])) {
|
2007-07-16 11:42:58 +00:00
|
|
|
flush();
|
2007-07-16 11:41:49 +00:00
|
|
|
$_SESSION["databases"][$_GET["server"]] = get_vals("SHOW DATABASES");
|
2007-07-12 10:09:37 +00:00
|
|
|
}
|
2007-07-16 11:41:49 +00:00
|
|
|
echo optionlist($_SESSION["databases"][$_GET["server"]], $_GET["db"]);
|
2007-07-02 05:51:26 +00:00
|
|
|
?>
|
2007-07-17 07:23:17 +00:00
|
|
|
</select>
|
|
|
|
<?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?>
|
|
|
|
<?php if (isset($_GET["schema"])) { ?><input type="hidden" name="schema" value="" /><?php } ?>
|
|
|
|
</p>
|
2007-07-02 05:51:26 +00:00
|
|
|
<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
|
|
|
|
}
|