<?php 
session_start();
include_once '../config.php';
if(isset($_POST)){
$username = trim($_POST['Username']);
$password = $_POST['Password'];
$Roll = $_POST['Roll'];
$query = "SELECT * FROM tbl_users WHERE Username = '$username' AND Password = '$password'";
  $row = getRecord($query);
    $rncnt = getRow($query);
    if($rncnt > 0){
        $Roll = 1;
        $_SESSION['Admin'] = $row;
        $_SESSION['Roll'] = $Roll;
        echo json_encode(array('Status'=>1));
    }
    else{
        unset($_SESSION['Admin']);
        unset($_SESSION['Roll']);
        echo json_encode(array('Status'=>0));
    } 
}
?>