Ejemplo n.º 1
0
    $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);
    require FS_PHP . '/header.php';
    require FS_PHP . '/nav.php';
    if (isset($viewFile) && file_exists($viewFile)) {
        require $viewFile;
    } else {
        require FS_PHP . '/error.php';