<?php 
include("../db.php");

header('Content-Type: application/json');

  $class = $_POST['class'];
  $session = $_POST['session'];
  $date = $_POST['date'];

    $status = 0;

    $subjectArray = array();
    
    $array = array();
//echo $ss="select * from student_notice where class='$class' and type='2' and session='$session' ";
	$allSubject = $db->getRows("select * from performance where class='$class' and session='$session' and date='$date' ORDER BY id DESC ");
    if(count($allSubject) > 0){
        $status = 1;

    	foreach($allSubject as $subject){
                array_push($subjectArray,["id"=>"$subject[id]","class"=>"$subject[class]","details"=>"$subject[details]","date"=>"$subject[date]" ]);
    	}

    }
 
 $array['status'] = $status;
 $array['performance'] = $subjectArray;
 
 echo json_encode($array);
?>