<?php
session_start();
header("Content-type: text/html; charset=windows-1251");
if(!isset($_SESSION["login"]))
	die("<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.10 (Unix) Server at site Port 80</address>
</body></html>");

define("PATH", $_SERVER['DOCUMENT_ROOT']);
include(PATH."/core/func.php");
include(PATH."/core/db.php");
include(PATH."/core/set.php");
include(PATH."/core/define.php");
include(PATH."/core/defineset.php");

db_connect();
$res = db_query("SELECT `stas` FROM `".DBpref."users` WHERE `login` = '".db_string($_SESSION["login"])."'");
db_close();
$res = db_assoc($res);
if($res["stas"] == 0)
	die("<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.10 (Unix) Server at site Port 80</address>
</body></html>");
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="../admin/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../admin/jquery-1.9.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
</head>

<body>
<style type="text/css">
.table1 td{padding:2px; border:1px solid #bcbdbf;}
.li{border:1px solid #bcbdbf; background:#fdfdfd;}
</style>
<table width="980px" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td style="background:#00aacc;" width="250px" border="1px solid #bcbdbf">
		<li><a href="../admin3666/?p=users">Пользователи</a><br /></li>
		<li><a href="../admin3666/?p=cesh">Вывод средств</a><br /></li>
		<li><a href="../admin3666/?p=news">Новости</a><br /></li>
		<li><a href="../admin3666/?p=set">Настройка</a><br /></li>
	</td>
	<td style="border:1px solid #bcbdbf;">
	<?php
		$page = isset($_GET["p"])?htmlspecialchars($_GET["p"]):"";
		
		switch ($page) {
    	
		case "":
        $page = "index.php";
        break;
		
		case "users":
        $page = "users.php";
        break;
		
		case "cesh":
        $page = "cesh.php";
        break;
		
		case "news":
        $page = "news.php";
        break;
		
		case "set":
        $page = "set.php";
        break;
    	
		default:
		$page = "404.php";
}

		include("page/".$page);
	?>
	</td>
  </tr>
</table>
</body>
</html>