<?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 ( ref_no like '%$q%' or  first_name like '%$q%' or cell_no like '%$q%' or candidate_roll_no like '%$q%' or family_code 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");

    $m->where("section_id", $student['section_id']);
    $section_data=$m->get("edu_adm_section_detail");

	$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='student_profile.php?$dumy&student=$id&qr=$name&$dumy#std_section'>
	 <span> " .$student['first_name']." | " .$student['last_name']."  </span> |".$class_data[0]['Class_Name']."-" .$section_data[0]['section_name']." |
	 <span style=''> " .$student['candidate_roll_no']." | " .$student['cell_no']." | " .$student['ref_no']." | " .$student['family_code']." </span>
	</a>

	<span style=''> <a href='pay_fee.php?$dumy&student=$id&qr=$name&session=$sess&$dumy#std_section'><b style='color:MediumSeaGreen;'>Fee History</b> </a> </span>
</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;


}

?>