<?php
require_once 'library/config.php';
require_once 'library/functions.php';

$errorMessage = '&nbsp;';

if (isset($_POST['txtUserName'])) {
	$result = doLogin();
	
	if ($result != '') {
		$errorMessage = $result;
	}
}

?>
<html>
<head>
<title>Shop Admin - Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="include/admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="636" valign="top" id="mainCenterBg"><table width="779" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="100" align="center" class="heading"><img src="images/img_logo.png" width="625" height="79"></td>
      </tr>
      <tr>
        <td height="300"><form method="post" name="frmLogin" id="frmLogin">
           
          <table width="400" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#227DE5" class="entryTable" >
            <tr class="lightBlue" >
              <td height="25" class="heading" style="padding-left:10px"><strong> Admin Login:</strong></td>
            </tr>
            <tr>
              <td bgcolor="#C7EAFB" ><div class="errorMessage" align="center"><?php echo $errorMessage; ?></div>
                      <table width="100%" border="0" cellpadding="2" cellspacing="1" class="text">
                        <tr align="center">
                          <td colspan="3">&nbsp;</td>
                        </tr>
                        <tr class="text">
                          <td width="100" align="right">User Name</td>
                          <td width="10" align="center">:</td>
                          <td><input name="txtUserName" type="text" class="formField " id="txtUserName"   width="120px"></td>
                        </tr>
                        <tr>
                          <td height="10" align="right"></td>
                          <td height="10" align="center"></td>
                          <td height="10"></td>
                        </tr>
                        <tr>
                          <td width="100" align="right">Password</td>
                          <td width="10" align="center">:</td>
                          <td><input name="txtPassword" type="password" class="formField " id="txtPassword"  width="120px"></td>
                        </tr>
                        <tr>
                          <td height="10" align="right"></td>
                          <td height="10" align="center"></td>
                          <td height="10"></td>
                        </tr>
                        <tr>
                          <td colspan="2">&nbsp;</td>
                          <td><input name="btnLogin" type="submit"  id="btnLogin" value="Login" class="button" style="width:80px"></td>
                        </tr>
                        <tr>
                          <td colspan="2">&nbsp;</td>
                          <td>&nbsp;</td>
                        </tr>
                    </table></td>
            </tr>
          </table>       
        </form></td>
      </tr>
      <tr>
        <td height="20">&nbsp;</td>
      </tr>
      <tr>
        <td height="20" align="center" valign="middle">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
