<?php include('parent/callMe.php');?>
<?php include('Sessioncheck.php');

$dumy=session_id().session_id().session_id().session_id().session_id();
   
 $q=$_GET["q"];

 if ($q!="" AND $q!=null) {

 $branch=$_SESSION['branch'];
 $query="SELECT * FROM `edu_student_details` where (branch_id='$branch' and status='0') AND ( first_name like '%$q%' or last_name like '%$q%'  or candidate_roll_no like '%$q%' or ref_no like '%$q%' )  limit 0,15";
  

 $students = $m->query($query);

 $data="";
 foreach($students as $student){


	if (strlen($q)>0) {
	
	$m->where("class_id", $student['class_id']);
    $class_data=$m->get("edu_class_config");

	$id=$student['student_id'];
	$name=$student['first_name'];
	$sess=$student['session_id'];

		$data=$data . "
		<br>
<div style='padding-left:0.5%;border-bottom:1px solid lightgray;'>
	<a href='pay_fee.php?$dumy&student=$id&qr=$name&session=$sess&$dumy#std_section'>
	 <span> " .$student['first_name']." | " .$student['last_name']."  </span> |".$class_data[0]['Class_Name']." | 
	 <span style=''> " .$student['candidate_roll_no']." | " .$student['ref_no']." </span>
	</a>
</div>
		";



	}
	     
		// Set output to "no suggestion" if no hint was found
		// or to the correct values
		

 }

 if ($data=="") {
	  $data="No Suggestion...";
	} else {
	  $data=$data;
}

 echo $data;


}

?>