<?php
include("../../db.php");
header('Content-Type: application/json');

  $mobile = $_POST['mobile'];
  $password = $_POST['password'];

$status = 0;
$name = '';
$institute_name = '';

$getData = $db->getRow("select * from staff where mobile='".$mobile."' and password='".$password."' limit 1 ");

 if(count($getData)>0){
     $status=1;
     $name = $getData['name'];
 }
 else {
     $status= 0;
 }

    	$aryReturn=array();
		$arySetData=$db->getRows("select * from settings");
		if(is_array($arySetData) && count($arySetData)>0)
		{
			foreach($arySetData as $iSetData)
			{
				$aryReturn[$iSetData['field']]=$iSetData['value'];
			}
		}
		$institute_name = $aryReturn['site_name'];

 $array = array("status"=>$status, "institute_name"=>"$institute_name", "name"=>"$name");
 
 echo json_encode($array);
 
// $simple_string = json_encode($array);
// $ciphering = "AES-128-CTR"; 
// $iv_length = openssl_cipher_iv_length($ciphering); 
// $options = 0;
// $encryption_iv = '1234567891011121';
// $encryption_key = "GeeksforGeeks";
// $encryption = openssl_encrypt($simple_string, $ciphering,$encryption_key, $options, $encryption_iv); 

// echo $encryption;

?>