<?php

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
$course_id = $request->getAttribute('course_id');
$season_id=$request->getAttribute('season_id');
$exams_id=$request->getAttribute('exams_id');
$papers_id=$request->getAttribute('papers_id');
$response=array();

if(isset($course_id)&&isset($season_id)&&isset($exams_id)){
$sql="SELECT * from assign_papers where course_id='$course_id' AND season_id='$season_id'  AND exams_id='$exams_id' ";
}
elseif(isset($course_id)&&isset($season_id)){
$sql="SELECT * from assign_papers where course_id='$course_id' AND season_id='$season_id' ";
}
elseif(isset($course_id)){
$sql="SELECT * from assign_papers where course_id='$course_id' ";
}
else{
$sql="SELECT  * from assign_papers";
}
 $result=mysqli_query($con,$sql);

    while ($row[]=mysqli_fetch_assoc($result)) { 
      $user=$row;
   	}

 echo json_encode($user);


?>