<?php
include("../../db.php");
header("Access-Control-Allow-Origin: * ");


$session = $_REQUEST['session'];
$school_id = $_REQUEST['school_id'];
$date = $_REQUEST['date'];

//$class=$_REQUEST['class'];
//$month=$_REQUEST['month'];

$session = mysql_real_escape_string($session);
$school_id = mysql_real_escape_string($school_id);
//$class=mysql_real_escape_string($class);


$holiday = $db->getVal("select reasion  from staff_holiday where date='" . $date . "'  and session='$session' and school_id= '$school_id'");

if (empty($holiday)) {

    $holidays = '';
} else {
    $holidays = 'H';
}

$day = date('l', strtotime($date));
//	$json['data']=array("reasion" =>$holiday,"day" =>$day);
$json['status'] = 1;
$json['msg'] = "successful";
$json['data'] = array("reasion" => $holidays, "day" => $day);


if (is_array($json) && count($json) > 0) {
    echo json_encode($json);

} else {
    echo json_encode(array('status' => 0, 'msg' => 'Profile not found..!'));
}
