 <?php
include("../../db.php");
header("Access-Control-Allow-Origin: * ");
header('Content-Type: application/json');
 
 
        $class=$_REQUEST['class'];
        $section=$_REQUEST['section'];
        $session=$_REQUEST['session'];
        $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 idno, admissionno,name,fname,fincome,class,section,mobile,photo from student where session='$session' and class='$class' $conwhere  and  status=1  and issue_TC=0 order by name");

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



	    $jsonn[]=array("student"=>array("idno"=>$stu['idno'],"name"=>$stu['name'],"admission no "=>$stu['admissionno'],"father name"=>$stu['fname'],"rollno"=>$stu['fincome'],"section"=>$stu['section'],"photo"=>"media/photo/".$stu['photo']));
 	    

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


}
echo json_encode($json);	

}
else

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


?>