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" />
|
2009-05-08 05:13:51 +00:00
|
|
|
<title><?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.10.2-dev"; ?></title>
|
2007-07-11 09:57:06 +00:00
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
2009-04-03 14:08:58 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="<?php echo (file_exists("phpMinAdmin.css") ? "phpMinAdmin.css" : "default.css"); // Ondrej Valka, http://valka.info ?>" />
|
2007-07-02 05:51:26 +00:00
|
|
|
</head>
|
|
|
|
|
2007-07-11 05:29:53 +00:00
|
|
|
<body>
|
2008-09-03 09:35:12 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
document.body.className = 'js';
|
|
|
|
function toggle(id) {
|
|
|
|
var el = document.getElementById(id);
|
|
|
|
el.className = (el.className == 'hidden' ? '' : 'hidden');
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
</script>
|
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"])) {
|
2008-09-24 20:46:21 +00:00
|
|
|
echo '<a href="' . htmlspecialchars(substr($SELF, 0, -1)) . '">' . htmlspecialchars($_GET["db"]) . '</a> » ';
|
2007-07-26 10:45:49 +00:00
|
|
|
}
|
|
|
|
foreach ($breadcrumb as $key => $val) {
|
|
|
|
if (strlen($val)) {
|
2008-09-27 08:52:18 +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"]) {
|
2008-09-02 12:39:04 +00:00
|
|
|
echo "<p class='message'>" . implode("</p>\n<p class='message'>", $_SESSION["messages"]) . "</p>\n";
|
2008-04-18 12:01:53 +00:00
|
|
|
$_SESSION["messages"] = array();
|
2007-07-06 08:47:20 +00:00
|
|
|
}
|
2008-10-02 15:25:12 +00:00
|
|
|
$databases = &$_SESSION["databases"][$_GET["server"]];
|
|
|
|
if (strlen($_GET["db"]) && $databases && !in_array($_GET["db"], $databases, true)) {
|
|
|
|
$databases = null;
|
|
|
|
}
|
2008-10-02 16:42:55 +00:00
|
|
|
if (isset($databases) && !isset($_GET["sql"]) && !isset($_SESSION["coverage"])) {
|
2007-07-12 10:09:37 +00:00
|
|
|
session_write_close();
|
|
|
|
}
|
2008-04-10 14:37:10 +00:00
|
|
|
if ($error) {
|
2008-09-02 12:39:04 +00:00
|
|
|
echo "<p class='error'>$error</p>\n";
|
2008-04-10 14:37:10 +00:00
|
|
|
}
|
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>
|
2009-05-08 05:13:51 +00:00
|
|
|
<input type="hidden" name="token" value="<?php echo $_SESSION["tokens"][$_GET["server"]]; ?>" />
|
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 } ?>
|
2008-09-30 12:00:18 +00:00
|
|
|
<?php if (get_databases()) { ?>
|
|
|
|
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option><?php echo optionlist(get_databases(), $_GET["db"]); ?></select>
|
|
|
|
<?php } else { ?>
|
|
|
|
<input name="db" value="<?php echo htmlspecialchars($_GET["db"]); ?>" /> <input type="submit" value="<?php echo lang('Use'); ?>" />
|
|
|
|
<?php } ?>
|
2007-07-17 07:23:17 +00:00
|
|
|
<?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>
|
2008-09-30 12:00:18 +00:00
|
|
|
<?php if (get_databases()) { ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
2008-09-30 12:00:18 +00:00
|
|
|
<?php } ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
</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-09-25 14:27:19 +00:00
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row["Name"]) . '">' . lang('select') . '</a> ';
|
|
|
|
echo '<a href="' . htmlspecialchars($SELF) . (isset($row["Rows"]) ? '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>
|
|
|
|
|
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');
|
2008-09-01 12:22:26 +00:00
|
|
|
jush.highlight_tag('code');
|
2008-08-28 10:28:56 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php } ?>
|
|
|
|
|
2007-07-02 05:51:26 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<?php
|
|
|
|
}
|