示例#1
0
//chnage status
respond('/reservation/id/[i:id]/pickup', function ($request, $response, $app) {
    //when the administrator is assigning a technician to pickup the equipment
    $reservation_idx = $request->id;
    $user = $request->param('assigned_tech_pickup');
    $user = filter_var($user, FILTER_SANITIZE_STRING);
    ReserveDatabaseAPI::change_pickup($reservation_idx, $user);
    $response->redirect($GLOBALS['BASE_URL'] . '/admin/reservation/search/id/' . $reservation_idx);
});
//chnage status
respond('/reservation/id/[i:id]/dropoff', function ($request, $response, $app) {
    //when the administrator is assigning a technician to dropoff the equipment
    $reservation_idx = $request->id;
    $user = $request->param('assigned_tech_dropoff');
    $user = filter_var($user, FILTER_SANITIZE_STRING);
    ReserveDatabaseAPI::change_dropoff($reservation_idx, $user);
    $response->redirect($GLOBALS['BASE_URL'] . '/admin/reservation/search/id/' . $reservation_idx);
});
//chnage status
respond('/reservation/id/[i:id]/priority', function ($request, $response, $app) {
    //when the staff member is trying to change the priority of a loan
    $reservation_idx = $request->id;
    $priority = $request->param('priority');
    $priority = filter_var($priority, FILTER_SANITIZE_STRING);
    ReserveDatabaseAPI::change_priority($reservation_idx, $priority);
    $response->redirect($GLOBALS['BASE_URL'] . '/admin/reservation/search/id/' . $reservation_idx);
});
//change priority
respond('/reservation/id/[i:id]/equipment', function ($request, $response, $app) {
    //when a piece of equipment is added to a loan
    $reservation_idx = $request->id;