<?

include "../mysqlcon.php";

$admin_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_admin"));
$n = basename($_SERVER['PHP_SELF']);

// INCLUDE LANGUAGE FILE
include "../lang/$admin_info[language]";

include "../functions.php";

if($n != "admin_login.php") {
  if(isset($_COOKIE['admin_username']) & isset($_COOKIE['admin_password'])) {
    if($_COOKIE['admin_username'] != crypt($admin_info[username], "admin") | $_COOKIE['admin_password'] != crypt($admin_info[password], "admin")) {
    header("Location: admin_login.php");
    exit;
    }
  } else {
    header("Location: admin_login.php");
    exit;
  }
}


if($page == "admin.php" OR $page == "admin_changepass.php") { $b1 = "2"; $o1 = "_open"; }
elseif($page == "admin_users.php" OR $page == "admin_userdelete.php" OR $page == "admin_useredit.php") { $b2 = "2"; $o2 = "_open"; }
elseif($page == "admin_weblogs.php") { $b20 = "2"; $o20 = "_open"; }
elseif($page == "admin_entries.php" OR $page == "admin_entrydelete.php" OR $page == "admin_entryedit.php") { $b3 = "2"; $o3 = "_open"; }
elseif($page == "admin_templates.php") { $b5 = "2"; $o5 = "_open"; }
elseif($page == "admin_html.php") { $b6 = "2"; $o6 = "_open"; }
elseif($page == "admin_signup.php") { $b7 = "2"; $o7 = "_open"; }
elseif($page == "admin_backup.php") { $b8 = "2"; $o8 = "_open"; }
elseif($page == "admin_faq.php") { $b9 = "2"; $o9 = "_open"; }
elseif($page == "admin_log.php") { $b10 = "2"; $o10 = "_open"; }
elseif($page == "admin_emailsettings.php") { $b11 = "2"; $o11 = "_open"; }
elseif($page == "admin_profile.php") { $b12 = "2"; $o12 = "_open"; }
elseif($page == "admin_weblogsettings.php") { $b21 = "2"; $o21 = "_open"; }
elseif($page == "admin_paypal.php") { $b22 = "2"; $o22 = "_open"; }
elseif($page == "admin_mobile.php") { $b23 = "2"; $o23 = "_open"; }
elseif($page == "admin_groups.php") { $b14 = "2"; $o14 = "_open"; }
elseif($page == "admin_emailall.php") { $b15 = "2"; $o15 = "_open"; }
elseif($page == "admin_stats.php") { $b16 = "2"; $o16 = "_open"; }
elseif($page == "admin_ban.php") { $b17 = "2"; $o17 = "_open"; }
elseif($page == "admin_url.php") { $b18 = "2"; $o18 = "_open"; }
elseif($page == "admin_broadcast.php") { $b19 = "2"; $o19 = "_open"; }

$head = "
<html>
<head>
<title>$admin_header1</title>
<style type='text/css'>
body { margin: 0px; }
form { margin: 0px; }
h1 { color: #003366; letter-spacing: 0px; margin-left: 3px; font-family: \"Trebuchet MS\", verdana, arial, tahoma; margin-bottom: 4px; font-size: 18pt;}
h2 { letter-spacing: 0px; font-family: \"Trebuchet MS\", verdana, arial, tahoma; margin-bottom: 2px; font-size: 12pt;}
td { font-size: 8pt; font-family: verdana, arial, tahoma; color: #333333; }
td.topbar { background: #F5F5F5; padding: 7px; padding-bottom: 0px; border-bottom: 2px solid #666666; }
td.item { background: #FFFFFF; color: #333333; font-size: 8pt; padding: 5px; padding-left: 4px; border-bottom: 1px solid #AAAAAA; }
td.item2 { background: #EEEEEE; color: #000000; font-size: 8pt; padding: 5px; padding-left: 4px; border-bottom: 1px solid #AAAAAA; }
td.itemcat { background: #DDDDDD; font-weight: bold; font-size: 8pt; padding: 5px; border-bottom: 1px solid #AAAAAA; }
td.content { padding: 7px; line-height: 17px; }
td.header { background-color: #DDDDDD; background-image: url(../images/header_bg.gif); background-repeat: repeat-x; border: 1px solid #AAAAAA; padding: 7px; font-weight: bold; }
td.box { border: 1px solid #AAAAAA; border-top: none; padding: 7px; background: #FFFFFF; }
td.box2 { border: 1px solid #AAAAAA; padding: 10px; background: #FFFFFF; }
td.list { border-bottom: 1px solid #AAAAAA; padding: 7px; padding-bottom: 3px; }
td.list1 { background: #F7F7F7; padding: 7px; border: 1px solid #AAAAAA; border-top: none; }
td.list2 { background: #FFFFFF; padding: 7px; border: 1px solid #AAAAAA; border-top: none; }
td.stats1 { background: #FFFFFF; padding: 7px; border: 1px solid #AAAAAA; border-top: none; }
td.stats2 { background: #FFFFFF; padding: 7px; border: 1px solid #AAAAAA; border-top: none; border-left: none; }
td.entry { border: 1px solid #666666; border-bottom: 2px solid #666666; background: #FFFFFF; padding: 5px; }
table.box { border: 1px solid #666666; border-bottom: 2px solid #666666; background: #F5F5F5; }
img.icon { vertical-align: middle; }
div.float { float: left; padding-right: 1px; }
input.button { background: #DDDDDD; font-size: 8pt; padding: 3px; font-weight: bold; font-family: verdana, arial, tahoma; }
input.text { font-family: arial, verdana, tahoma; }
textarea, select { font-family: arial, verdana, tahoma; margin-top: 1px; }
font.disabled { color: #666666; }
font.gray { color: #888888; }
a:link { color: #000066; }
a:visited { color: #000066; }
a:hover { color: #000066; }
a.menu:link { color: #000000; text-decoration: none; }
a.menu:visited { color: #000000; text-decoration: none; }
a.menu:hover { color: #000000; text-decoration: underline; }
</style>
</head>
<body>

<!-- TOPBAR -->
<table width='100%' cellpadding='0' cellspacing='0' style='margin-bottom: 10px;'>
<tr>
<td class='topbar'>
 <table width='100%' cellpadding='0' cellspacing='0'>
 <tr><td valign='bottom' NOWRAP>
 <img src='../images/logo.gif' border='0'>
 </td><td align='right' style='padding-right: 3px;' NOWRAP>
 <img src='../images/bhicon.gif' border='0'>
 <img src='../images/w.gif' border='0' alt='$admin_header2'>
 </td></tr>
 </table>
</td>
</tr>
</table>

<!-- MENU AND CONTENT -->
<table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td valign='top' width='130' style='padding-left: 10px;'>
<table width='140' cellpadding='3' cellspacing='0' class='box'>
<tr><td class='itemcat'>$admin_header25</td></tr>
 <tr><td class='item$b1'><a href='admin.php'><img src='../images/folder1$o1.gif' border='0' class='icon'></a> <a href='admin.php' class='menu'>$admin_header3</a></td></tr>
 <tr><td class='item$b2'><a href='admin_users.php'><img src='../images/folder1$o2.gif' border='0' class='icon'></a> <a href='admin_users.php' class='menu'>$admin_header4</a></td></tr>
 <tr><td class='item$b20'><a href='admin_weblogs.php'><img src='../images/folder1$o20.gif' border='0' class='icon'></a> <a href='admin_weblogs.php' class='menu'>$admin_header22</a></td></tr>
 <tr><td class='item$b3'><a href='admin_entries.php'><img src='../images/folder1$o3.gif' border='0' class='icon'></a> <a href='admin_entries.php' class='menu'>$admin_header5</a></td></tr>
 <tr><td class='item$b14'><a href='admin_groups.php'><img src='../images/folder1$o14.gif' border='0' class='icon'></a> <a href='admin_groups.php' class='menu'>$admin_header13</a></td></tr>
 <tr><td class='item$b5' style='border-bottom: none;'><a href='admin_templates.php'><img src='../images/folder1$o5.gif' border='0' class='icon'></a> <a href='admin_templates.php' class='menu'>$admin_header6</a></td></tr>
</table>
<table width='140' cellpadding='3' cellspacing='0' class='box' style='margin-top: 10px;'>
<tr><td class='itemcat'>$admin_header26</td></tr>
 <tr><td class='item$b6'><a href='admin_html.php'><img src='../images/folder1$o6.gif' border='0' class='icon'></a> <a href='admin_html.php' class='menu'>$admin_header7</a></td></tr>
 <tr><td class='item$b7'><a href='admin_signup.php'><img src='../images/folder1$o7.gif' border='0' class='icon'></a> <a href='admin_signup.php' class='menu'>$admin_header12</a></td></tr>
 <tr><td class='item$b12'><a href='admin_profile.php'><img src='../images/folder1$o12.gif' border='0' class='icon'></a> <a href='admin_profile.php' class='menu'>$admin_header11</a></td></tr>
 <tr><td class='item$b21'><a href='admin_weblogsettings.php'><img src='../images/folder1$o21.gif' border='0' class='icon'></a> <a href='admin_weblogsettings.php' class='menu'>$admin_header23</a></td></tr>
 <tr><td class='item$b18'><a href='admin_url.php'><img src='../images/folder1$o18.gif' border='0' class='icon'></a> <a href='admin_url.php' class='menu'>$admin_header17</a></td></tr>
 <tr><td class='item$b22'><a href='admin_paypal.php'><img src='../images/folder1$o22.gif' border='0' class='icon'></a> <a href='admin_paypal.php' class='menu'>$admin_header24</a></td></tr>
 <tr><td class='item$b23'><a href='admin_mobile.php'><img src='../images/folder1$o23.gif' border='0' class='icon'></a> <a href='admin_mobile.php' class='menu'>$admin_header28</a></td></tr>
 <tr><td class='item$b11'><a href='admin_emailsettings.php'><img src='../images/folder1$o11.gif' border='0' class='icon'></a> <a href='admin_emailsettings.php' class='menu'>$admin_header10</a></td></tr>
 <tr><td class='item$b17'><a href='admin_ban.php'><img src='../images/folder1$o17.gif' border='0' class='icon'></a> <a href='admin_ban.php' class='menu'>$admin_header20</a></td></tr>
 <tr><td class='item$b9' style='border-bottom: none;'><a href='admin_faq.php'><img src='../images/folder1$o9.gif' border='0' class='icon'></a> <a href='admin_faq.php' class='menu'>$admin_header9</a></td></tr>
</table>
<table width='140' cellpadding='3' cellspacing='0' class='box' style='margin-top: 10px;'>
<tr><td class='itemcat'>$admin_header27</td></tr>
 <tr><td class='item$b15'><a href='admin_emailall.php'><img src='../images/folder1$o15.gif' border='0' class='icon'></a> <a href='admin_emailall.php' class='menu'>$admin_header14</a></td></tr>
 <tr><td class='item$b19'><a href='admin_broadcast.php'><img src='../images/folder1$o19.gif' border='0' class='icon'></a> <a href='admin_broadcast.php' class='menu'>$admin_header21</a></td></tr>
 <tr><td class='item$b16'><a href='admin_stats.php'><img src='../images/folder1$o16.gif' border='0' class='icon'></a> <a href='admin_stats.php' class='menu'>$admin_header19</a></td></tr>
 <tr><td class='item$b10'><a href='admin_log.php'><img src='../images/folder1$o10.gif' border='0' class='icon'></a> <a href='admin_log.php' class='menu'>$admin_header15</a></td></tr>
 <tr><td class='item$b8'><a href='admin_backup.php'><img src='../images/folder1$o8.gif' border='0' class='icon'></a> <a href='admin_backup.php' class='menu'>$admin_header16</a></td></tr>
 <tr><td class='item' style='border-bottom: none;'><a href='admin_logout.php'><img src='../images/folder1.gif' border='0' class='icon'></a> <a href='admin_logout.php' class='menu'>$admin_header18</a></td></tr>
</table>

<center>
<br>
<img src='../images/bh.gif' border='0' style='margin-left: 6px;'>
</center>

</td>
<td valign='top' style='padding-left: 10px; padding-right: 10px;'>

<table width='100%' cellpadding='3' cellspacing='0' class='box'>
<tr>
<td valign='top' class='content'>
";




$foot = "
</td></tr></table>
</td></tr></table>
<br>
</body>
</html>
";

?>