public function addStudentRequestAction()
 {
     $student_id = $_GET["student_id"];
     $request_id = $_GET["request_id"];
     $tableList = $_GET["tableList"];
     $request = new Request();
     $request->setRequestId($request_id);
     $request->setStudentId($student_id);
     $request->setRequestDate(date("Y-m-d"));
     $resourcesArray = array();
     //$tableList =json_decode($tableList);
     $cout = 0;
     for ($x = 0; $x < count($tableList); $x += 1) {
         $cout++;
         $requestResource = new RequestResource();
         $requestResource->setRequestId($request_id);
         $requestResource->setResourceId($tableList[$x][0]);
         $requestResource->setQty($tableList[$x][2]);
         $requestResource->setItemBorrowingDate($tableList[$x][3]);
         $requestResource->setReturnDate($tableList[$x][4]);
         $resourcesArray[] = $requestResource;
     }
     $status = StudentRequestDBaccess::addStudentRequest($request, $resourcesArray);
     $v = $resourcesArray[0];
     return new JsonResponse(['status' => $status]);
 }
 public static function getPendingRequests()
 {
     $conn = cont\connection::getConnectionObject();
     $con = $conn->getConnection();
     $sql = "SELECT * FROM Request WHERE STATUS='pending'";
     $result = mysqli_query($con, $sql);
     $requests = array();
     $req_num = 0;
     while ($row = mysqli_fetch_row($result)) {
         $request = new en\Request();
         $request->setRequestId($row[0]);
         $request->setStudentId($row[1]);
         $request->setRequestDate($row[2]);
         $requests[$req_num] = $request;
         $req_num++;
     }
     return $requests;
 }