<?php
 include "koneksi.php";
 $username = $_POST['username'];
 $password = $_POST['password'];
 $q="SELECT * FROM user WHERE nama='$username' AND password='$password'";
 echo $q;
 $res=mysqli_query($conn,$q);
 if ($row=mysqli_fetch_assoc($res))
 {
	 if ($row["status"]=="0")
	 {
		 header("location:login.php?p=6");
	 }
	 else 
	 {
		 $_SESSION["UserID"]=$row["id"];
		 $_SESSION["Level"]=$row["level"];
		 header("location:index2.php?p=1");
	 }
 }
 else 
 {
	 header("location:index.php?p=2");
 }
?>