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




         //$result_term =mysql_query("select * from teacher_complain where teacher_id='$teacher_id'");
         
     $result_term = mysql_query("select s.idno,s.name,s.class,s.section,s.photo,e.id,e.student_id from student as s inner join teacher_complain as e on s.idno=e.student_id where e.teacher_id='$teacher_id' group by e.student_id ");

   while ($rowt = mysql_fetch_assoc($result_term)) 	
	{
	    
    $jsond[]=array("id"=>$rowt['id'],"student_id"=>$rowt['student_id'],"name"=>$rowt['name'],"class"=>$rowt['class'],"section"=>$rowt['section'],"photo"=>"media/photo/".$rowt['photo']);
 	    
	}
	
         $json['status']=1;
		 $json['msg']="successful";
		 $json['data']=$jsond;   	



if(is_array($jsond) && count($jsond)>0)
	{  
		echo json_encode($json);    
			
	}else
	{		
	 	echo json_encode(array('status' => 0, 'msg'=>'data not found..!'));
	}

	?>