<?php 
session_start(); // Starting Session
error_reporting(0);
class login{
	function fn_login($con){
		$select_login_query="SELECT a_id FROM tbl_admin where username='".$_POST['username']."' and password='".$_POST['password']."'";
		$exec_select_login_query=mysqli_query($con,$select_login_query) or die("error");
		$rows=mysqli_num_rows($exec_select_login_query);
		$row=mysqli_fetch_array($exec_select_login_query);
		if($rows==1){
			return $rows;
			
			
		}
		else{
			return 0;
		}
	}
}
include_once("connection.php");
$obj_lg=new login();
$result=$obj_lg->fn_login($conn);

$_SESSION['lg_id']=$result;

$json = array( "op" =>$result);
		/* Send as JSON */
     header("Content-Type: application/json", true);
		echo json_encode($json);
 ?>