<?php
	session_start();

	require_once("../lib/helper.php");
	require_once("../lib/library_functions.php");
	
	$user_name = $obj->data_filter($_POST['user_name']);
	$user_password = sha1($obj->data_filter($_POST['user_password']));

	$is_admin = $obj->select("*","gbca_user_master","user_name = '$user_name' AND user_password = '$user_password' AND user_status = '1'");
	
	if($is_admin == 0)
	{
      $response['n'] = 0;
		$response['msg']= "Login UNSuccessfull";
	}
	else
	{
		$_SESSION['gbca_user_id'] = $is_admin[0]['user_id'];
		$_SESSION['gbca_user_full_name'] = $is_admin[0]['user_full_name'];
		$response['n'] = 1;
		$response['msg']= "Login Successfull";
		//$response['user_id'] = $_SESSION['gbca_user_id'];
		//$response['user_name'] = $_SESSION['leave_app_user_full_name'];
		//$response['gbca_user_full_name'] = $_SESSION['gbca_user_full_name'];
	}
	
echo json_encode($response);
	
?>