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

$status = 0;
$msg = "Unable to fetch data..! Please retry later";
$data = new stdClass();

if (isset($_GET['student_id']) && isset($_GET['teacher_id']) && isset($_GET['session'])){

    $student_id = $_GET['student_id'];
    $teacher_id = $_GET['teacher_id'];
    $session    = $_GET['session'];

    $feedback_month = date('F');

    $result = $db->getRow("SELECT * FROM teacher_feedback_by_student WHERE student_id = '$student_id' AND teacher_id = '$teacher_id' AND session = '$session' AND feedback_month = '$feedback_month'");

    if ($result){
        $status = 1;
        $data = $result;
        $msg = "Record found";
    }else{
        $msg = "Record not found";
    }

}

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

