<?
	require("config.inc");
	
	$AdminID = $_POST['AdminID'];
	$Password = $_POST['Password'];
	
	if($_POST['logging'] == "login")
	{
		$admin = mysql_query("select * from tbl_admin where user_ID='$AdminID' and password='$Password'");
		//echo "<script>alert('".$AdminID."');</script>";
		if(mysql_num_rows($admin) == 1)
		{
			$_SESSION['AdminID'] = $AdminID;
			$_SESSION['UserType'] = "admin";
			echo "<script>window.location='checkingOutDate.php';</script>";
		}
		else
		{
			echo "<script>alert('Login Fail!');</script>";
			echo "<script>window.location='login.php';</script>";
		}
	}
	else
	{
		session_destroy();
		header("location:login.php");
	}
?>