<?PHP session_start(); 
	// Call config file
	include("../config.php");
	//require './inc/config.php';

	if ($_GET['stat'] == 'login') {   
		
		$LoginU=strtoupper($_POST['UserName']);
		$LoginP=md5($_POST['Password']);
		//$LoginP=$_POST['Password'];
		$query = mysql_query("SELECT * FROM p1_g_user where username = '$LoginU' and password  = '$LoginP' and stop_user = 0"); 		
		if (mysql_num_rows($query) <> "0")
			{
				$_SESSION['LoginGAdminID'] 	  = mysql_result($query,0,"uid");
				/// clear session
				$_SESSION['section'] = '';
				$_SESSION['page'] = '';
				header("Location: index.php"); 
			}else{
				$error =  '<div align="center">Error in Login</div>';
			}
				
	
	
	}
?>

<!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=windows-1256" />
<title>Login to <? echo $life_software;?></title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div align="center">
  <p>&nbsp;</p>
  <p class="box_main"><? echo $life_software;?></p>
  <p>&nbsp; <? echo $error; ?>
</p>
  
  <form id="form1" name="form1" method="post" action="Login.php?stat=login">
    <table width="40%" border="0">
      <tr>
        <td class="Main_Text1"><div align="left">User Name</div></td>
        <td class="text_box"><div align="center"><span id="sprytextfield1">
          <input type="text" name="UserName" id="UserName" />
          <span class="textfieldRequiredMsg">A value is required.</span></span></div></td>
      </tr>
      <tr>
        <td class="Main_Text1"><div align="left">Password</div></td>
        <td class="text_box"><div align="center"><span id="sprytextfield2">
          <input type="password" name="Password" id="Password" />
          <span class="textfieldRequiredMsg">A value is required.</span></span></div></td>
      </tr>
      <tr>
        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input name="Submit" type="submit" class="Button1" id="Submit" value="    Login    " /></td>
        <td>&nbsp;</td>
      </tr>
    </table>
    <p>&nbsp;</p>
  </form>
  <p>&nbsp;</p>
</div>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
//-->
</script>
</body>
</html>
