<?
include "admin_header.php";

if(isset($_POST['task'])) { $task = $_POST['task']; } else { $task = ""; }

if($task == "dologin") {
$username = $_POST['username'];
$password = $_POST['password'];

if(isset($_POST['javascript']) & $_POST['javascript'] == "no") {
$result = "<tr><td colspan='3' style='padding: 10px; padding-top: 0px;'>$admin_login1</td></tr>";
} elseif($username == $admin_info[username] AND $password == $admin_info[password]) {
$user = crypt($admin_info[username], "admin");
$pass = crypt($admin_info[password], "admin");
setcookie("admin_username", "$user", 0, "/");
setcookie("admin_password", "$pass", 0, "/");
cheader("admin.php");
exit();
} else {
$result = "<tr><td colspan='3' style='padding: 10px; padding-top: 0px;'>$admin_login2</td></tr>";
}
}


echo "
<html>
<head>
<title>$admin_login3</title>
<style type='text/css'>
body { background: #EEEEEE; font-size: 8pt; }
td { font-family: verdana, arial, tahoma; font-size: 8pt; }
table.login { border: 1px dashed #AAAAAA; background: #FFFFFF; }
input.button { background: #DDDDDD; font-size: 9pt; font-weight: bold; font-family: verdana, arial, tahoma; }
h1 { letter-spacing: 1px; margin-left: 3px; font-family: \"Trebuchet MS\", verdana, arial, tahoma; margin-bottom: 4px; font-size: 16pt;}
input.text, textarea { font-family: arial, verdana, tahoma; }
</style>
</head>
<body>
<!--"; echo substr(str_replace("-", "", $admin_info[license]), 0, 8); echo "-->
<table width='100%' height='100%' cellpadding='0' cellspacing='0'>
<tr>
<td valign='middle' align='center'>

<table cellpadding='0' cellspacing='0'>
<tr>
<td align='center'>
<img src='../images/bhlogo.gif' border='0'>
<br><br>
 <table cellpadding='0' cellspacing='0'>
 <tr>
 <form action='admin_login.php' name='login' method='POST'>
 <td>
  <table cellpadding='0' cellspacing='0' class='login'>
  <tr>
  <td style='padding: 10px;' valign='bottom'>
  $admin_login4<br>
  <input class='text' type='text' name='username'>
  </td>
  <td style='padding: 10px; padding-left: 0px;' valign='bottom'>
  $admin_login5<br>
  <input class='text' type='password' name='password'>
  </td>
  <td style='padding: 10px; padding-left: 0px;' valign='bottom'>
  <input type='submit' value='$admin_login6' class='button' style='margin-bottom: 3px;'>
  <input type='hidden' name='task' value='dologin'>
  <NOSCRIPT><input type='hidden' name='javascript' value='no'></NOSCRIPT>
  </td>
  </tr>$result
  </table>
</td></tr></table>
 </td>
 </form>
 </tr>
 </table>
</td>
</tr>
</table>
<script language='JavaScript'>
<!-- 
appendEvent = function(el, evname, func) {
 if (el.attachEvent) { // IE
   el.attachEvent('on' + evname, func);
 } else if (el.addEventListener) { // Gecko / W3C
   el.addEventListener(evname, func, true);
 } else {
   el['on' + evname] = func;
 }
};
appendEvent(window, 'load', windowonload);

function windowonload() { document.login.username.focus(); } 
// -->
</script>
</body>
</html>
";


?>