<?php
include("../../db.php");
//header("Access-Control-Allow-Origin: * ");
header('Content-Type: application/json');
/*
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);*/

$termName = $_REQUEST['term'];
$session = $_REQUEST['session'];
$class = $_REQUEST['class'];

$status = 0;
$data = new stdClass();

$result = $db->getRow("select * from examterm where session='$session' AND name = '$termName' AND class = '$class'");

if ($result) {
    $status = 1;
    $data = $result;
}

echo json_encode(array("status" => $status, "data" => $data));