<?php
$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

 $course=$request->getAttribute('course');
 $department=$request->getAttribute('department');
 $level_id=$request->getAttribute('level_id');

$response=array();

if(isset($course)&&isset($department)&&isset($level_id)){
    $sql="SELECT * FROM student WHERE course = '$course'AND department = '$department'AND level_id = '$level_id'AND status='0'";
}
elseif(isset($course)&&isset($department)){
	$sql="SELECT * FROM student WHERE course = '$course'AND department = '$department'AND status='0'";
}
elseif(isset($course)){
	$sql="SELECT * FROM student WHERE course='$course' AND status='0'";
}
else{
	$sql="SELECT * FROM student WHERE status='0'";
}
$result=mysqli_query($con,$sql);
    while ($row[]=mysqli_fetch_assoc($result)) {  
      $user=$row;
	}


echo json_encode($user);

?>