<?php
  /**
   * Login
   *
   * @package Digital Downloads Pro
   * @author wojoscripts.com
   * @copyright 2011
   * @version $Id: login.php, v2.00 2011-06-05 10:12:05 gewa Exp $
   */
  
  define("_VALID_PHP", true);
  require_once("../init.php");
?>
<?php
  if ($user->is_Admin())
      redirect_to("index.php");
	  
  if (isset($_POST['submit']))
      : $result = $user->login($_POST['username'], $_POST['password']);
  //Login successful 
  if ($result)
      : redirect_to("index.php");
  endif;
  endif;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $core->site_name;?></title>
<link href="assets/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../assets/jquery.js"></script>
<script type="text/javascript" src="../assets/jquery-ui-1.8.13.custom.min.js"></script>
</head>
<body>
<div id="content">
  <h1> ورود به کنترل پنل » <?php echo $core->site_name;?> </h1>
  <form id="admin_form" name="admin_form" method="post" action="">
    <label> : نـام مـدیـر </label>
      <input name="username" type="text" class="inputbox" id="user"  size="25" />
    <label> : کلمه عبـور </label>
      <input name="password" type="password" class="inputbox" id="password"  size="25" />
    <div style="text-align:center; margin-top:20px; margin-right:50px; ">
      <input name="submit" type="submit" value=" ورود " class="button"/>
    </div>
  </form>
</div>
<div id="footer">Copyright &copy;<?php echo date('Y').' '.$core->site_name.' v'.$core->version;?></div>
<div id="message-box"><?php echo $core->showMsg;?></div>
</body>
</html>