<?php
require('../config.php');

@mysql_connect("$host", "$username", "$password")or die("cannot connect to the database."); 
mysql_select_db("$db_name")or die("cannot select the database.");

$result = mysql_query("SELECT * FROM ".$prefix."settings WHERE id = 1");
while($row = mysql_fetch_array($result)) {
	$pagename = $row['pagename'];
	$template = $row['template'];
}

session_start();
if ($_SESSION['loggedIn'] != "true") {
	 header("Location: login.php");
}


?>

<html>

<head>
<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title><?php echo $pagename; ?> - Admin Panel</title>
<?php
echo "<link href='../template/$template' rel='stylesheet' type='text/css' />";
?>


<link href = "include/datepicker/jquery-ui.css" rel = "stylesheet">
<script src = "include/datepicker/jquery-1.10.2.js"></script>
<script src = "include/datepicker/jquery-ui.js"></script>
      
<!-- Javascript -->
      <script>
         $(function() {
            $( "#datepicker-3" ).datepicker({
               appendText:"(yy-mm-dd)",
               dateFormat:"yy-mm-dd",
               altField: "#datepicker-4",
               altFormat: "DD, d MM, yy"
            });
         });
      </script>

</head>

<body>

<div align="center">
	<table border="0" width="1024" cellspacing="0" cellpadding="0">
		<tr>
			<td valign="top" colspan="2" width="1024">
			<p align="center"><b><font size="6"><?php echo $pagename; ?></font></b><font size="5"><br>
			admin panel</font><br><br></td>
		</tr>
		<tr>
			<td valign="top" width="150">
			


				<table class="table" width="130">
					<tr class="table_header">
						<td class="table_header">Menu:</td>
					</tr>
					<tr>
						<td class="cell_content">
						<a href="index.php">Admin Home</a><br>
						<a href="../index.php">Main Website</a><br><br>
						<a href="reset_hits.php">Reset hits</a><br><br>
						<a href="settings_edit.php?settings=1">Edit Settings</a><br>
						<a href="pass_edit.php?username=1">Edit Password</a><br>
						<br><a href="logout.php">Logout</a></td>
					</tr>
				</table>			
			
			
			
			</td>
			<td valign="top" width="850">
