Beispiel #1
0
} elseif ($_GET['page'] === 'show-seats') {
    $seats = $model->getSeatsForRoom($_GET['room-id']);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($seats);
    exit;
} elseif ($_GET['page'] === 'edit-seat-accommodations') {
    $model->editSeatAccommodations($_POST);
    $loggers['audit']->info("Accommodations modified for seat {$_POST['seat_id']}");
} elseif ($_GET['page'] === 'add-seat') {
    $result = $model->addSeat($_POST);
    $loggers['audit']->info("Seat created for room {$_POST['room_id']}");
} elseif ($_GET['page'] === 'toggle-active') {
    $model->toggleActive($_POST);
    $loggers['audit']->info("Active status toggled for {$_POST['toggle-for']} {$_POST['id']}");
} elseif ($_GET['page'] === 'update-building') {
    $model->updateBuilding($_POST);
    $loggers['audit']->info("Building {$_POST['id']} updated");
} elseif ($_GET['page'] === 'update-room') {
    $model->updateRoom($_POST);
    $loggers['audit']->info("Room {$_POST['id']} updated");
} elseif ($_GET['page'] === 'clone-accommodations') {
    $newAccommodations = $model->cloneAccommodations($_POST['clone_from'], $_POST['clone_to']);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($newAccommodations);
    exit;
}
/**
 * View rendering
 */
if (isset($render) && $render) {
    $follow_up_pending_count = $follow->fetchFollowUpsCountEmployee($SESSION->user_id);