public static function getRequestResource(en\Request $request)
 {
     $request_id = $request->getRequestId();
     $conn = cont\connection::getConnectionObject();
     $con = $conn->getConnection();
     $sql = $con->prepare("SELECT * FROM RequestResource WHERE request_id={$request_id}");
     $sql->bind_param('s', $request_id);
     $sql->execute();
     $result = $sql->get_result();
     //
     $requestResources = array();
     $res_num = 0;
     while ($row = $result->fetch_assoc()) {
         $requestResource = new en\RequestResource();
         $requestResource->setResourceId($row[1]);
         $requestResource->setItemBorrowingDate($row[2]);
         $requestResource->setIssueDate($row[3]);
         $requestResource->setReturnDate($row[4]);
         $requestResource->setStatus($row[5]);
         $requestResources[$res_num] = $requestResource;
         $res_num++;
     }
     return $requestResources;
 }
 public function approvalAction()
 {
     $tableList = $_GET["resourceTable"];
     $resourcesArray = array();
     echo "<br/>";
     for ($x = 0; $x < count($tableList) - 1; $x += 1) {
         $requestResource = new en\RequestResource();
         $requestResource->setRequestId($tableList[$x][0]);
         $requestResource->setResourceId($tableList[$x][1]);
         $requestResource->setItemBorrowingDate($tableList[$x][2]);
         $requestResource->setStatus($tableList[$x][6]);
         $resourcesArray[$x] = $requestResource;
     }
     $status = cont\ResourceDBaccess::updateRequestResources($resourcesArray);
     $v = $resourcesArray[0];
     return new JsonResponse(['status' => $status]);
 }