2007-07-02 05:51:26 +00:00
|
|
|
<?php
|
2008-04-10 14:37:10 +00:00
|
|
|
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
2007-07-26 10:45:49 +00:00
|
|
|
global $SELF, $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" />
|
2008-08-27 14:34:21 +00:00
|
|
|
<title><?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.7.1-dev"; ?></title>
|
2007-07-11 09:57:06 +00:00
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
2007-08-09 16:47:06 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="default.css" /><?php // Ondrej Valka, http://valka.info ?>
|
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
|
2007-07-26 10:45:49 +00:00
|
|
|
if (isset($breadcrumb)) {
|
|
|
|
$link = substr(preg_replace('~db=[^&]*&~', '', $SELF), 0, -1);
|
2007-08-09 16:47:06 +00:00
|
|
|
echo '<p id="breadcrumb"><a href="' . (strlen($link) ? htmlspecialchars($link) : ".") . '">' . (isset($_GET["server"]) ? htmlspecialchars($_GET["server"]) : lang('Server')) . '</a> » ';
|
2007-07-26 10:45:49 +00:00
|
|
|
if (is_array($breadcrumb)) {
|
|
|
|
if (strlen($_GET["db"])) {
|
2007-08-09 16:47:06 +00:00
|
|
|
echo '<a href="' . substr($SELF, 0, -1) . '">' . htmlspecialchars($_GET["db"]) . '</a> » ';
|
2007-07-26 10:45:49 +00:00
|
|
|
}
|
|
|
|
foreach ($breadcrumb as $key => $val) {
|
|
|
|
if (strlen($val)) {
|
2007-08-09 16:47:06 +00:00
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . "$key=" . ($key != "privileges" ? urlencode($val) : "") . '">' . htmlspecialchars($val) . '</a> » ';
|
2007-07-26 10:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "$title</p>\n";
|
|
|
|
}
|
|
|
|
echo "<h2>$title" . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . "</h2>\n";
|
2008-04-18 12:01:53 +00:00
|
|
|
if ($_SESSION["messages"]) {
|
|
|
|
echo "<p class='message'>" . implode("<br />", $_SESSION["messages"]) . "</p>\n";
|
|
|
|
$_SESSION["messages"] = array();
|
2007-07-06 08:47:20 +00:00
|
|
|
}
|
2008-04-15 12:06:08 +00:00
|
|
|
if (!$_SESSION["tokens"][$_GET["server"]]["?logout"]) {
|
|
|
|
$_SESSION["tokens"][$_GET["server"]]["?logout"] = rand(1, 1e6);
|
|
|
|
}
|
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();
|
|
|
|
}
|
2008-04-10 14:37:10 +00:00
|
|
|
if ($error) {
|
|
|
|
echo "<p class='error'>" . htmlspecialchars($error) . "</p>\n";
|
|
|
|
}
|
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-08-09 16:47:06 +00:00
|
|
|
<?php switch_lang(); ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
<div id="menu">
|
2007-07-26 10:45:49 +00:00
|
|
|
<h1><a href="http://phpminadmin.sourceforge.net"><?php echo lang('phpMinAdmin'); ?></a></h1>
|
2007-07-05 11:51:06 +00:00
|
|
|
<?php if ($missing != "auth") { ?>
|
2008-04-10 15:10:10 +00:00
|
|
|
<form action="" method="post">
|
2007-07-02 05:51:26 +00:00
|
|
|
<p>
|
|
|
|
<a href="<?php echo htmlspecialchars($SELF); ?>sql="><?php echo lang('SQL command'); ?></a>
|
2008-06-20 14:13:37 +00:00
|
|
|
<a href="<?php echo htmlspecialchars($SELF); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo lang('Dump'); ?></a>
|
|
|
|
<input type="hidden" name="token" value="<?php echo $_SESSION["tokens"][$_GET["server"]]["?logout"]; ?>" />
|
2008-04-10 15:10:10 +00:00
|
|
|
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" />
|
2007-07-02 05:51:26 +00:00
|
|
|
</p>
|
2008-04-10 15:10:10 +00:00
|
|
|
</form>
|
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 } ?>
|
2008-07-31 14:29:01 +00:00
|
|
|
<?php if (isset($_GET["dump"])) { ?><input type="hidden" name="dump" value="" /><?php } ?>
|
2007-07-17 07:23:17 +00:00
|
|
|
</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()) {
|
2008-03-26 09:54:00 +00:00
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row["Name"]) . '" title="' . ($row["Engine"] == "MyISAM" ? lang('%d row(s)', $row["Rows"]) : lang('around %d row(s)', $row["Rows"])) . '">' . lang('select') . '</a> ';
|
2007-08-04 19:38:36 +00:00
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . (isset($row["Engine"]) ? 'table' : 'view') . '=' . urlencode($row["Name"]) . '" title="' . (isset($row["Engine"]) ? htmlspecialchars($row["Engine"]) : lang('View')) . '">' . 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>
|
|
|
|
|
2008-08-28 10:28:56 +00:00
|
|
|
<?php if ($_COOKIE["highlight"] == "jush") { ?>
|
|
|
|
<script type="text/javascript" src="http://jush.sourceforge.net/jush.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
if (typeof jush != 'undefined') {
|
|
|
|
jush.style('http://jush.sourceforge.net/jush.css');
|
|
|
|
jush.highlight_tag('pre');
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php } ?>
|
|
|
|
|
2007-07-02 05:51:26 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<?php
|
|
|
|
}
|