 <?php
include("../../db.php");
header("Access-Control-Allow-Origin: * ");
header('Content-Type: application/json');
 
 
        $class=$_REQUEST['class'];
        $section=$_REQUEST['section'];
        $session=$_REQUEST['session'];
        $student_id=$_REQUEST['student_id'];
         
        // $class=mysql_real_escape_string($class);
        // $section=mysql_real_escape_string($section);
        // $session=mysql_real_escape_string($session);
 

  if(isset($_REQUEST['section']) && trim($_REQUEST['section'])!=""){
		
			$conwhere.=" and section='".$_REQUEST['section']."' ";
		}
	 
	
$allstudent=$db->getRows("select *  from performance where class='$class' and student_id='$student_id' $conwhere and session='$session' ");
//echo $ss="select *  from performance where class='$class' and student_id='$student_id' $conwhere and session='$session' ";



	if(is_array($allstudent) && count($allstudent)>0)
	{
foreach($allstudent as $stu){$i++;




	    $jsonn[]=array("date"=>$stu['date'],"detail"=>$stu['details']);
 	    

         $json['status']=1;
		 $json['msg']="successful";
		 $json['data']=$jsonn;


}
echo json_encode($json);	

}
else

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


?>