Exemplo n.º 1
0
        $response->redirect($data['redirect_url']);
    }
    //otherwise assign the title and reservations
    $app->tpl->assign('title', $data['title']);
    $dates = $data['dates'];
    $reservations = CTSDatabaseAPI::reservation_information($dates);
    $app->tpl->assign('reservations', $reservations);
    $app->tpl->display('equipment-by-week.tpl');
});
//equipment by week
respond('/mypage', function ($request, $response, $app) {
    //display mypage for CTS technicians to view their assignments for the day
    $app->tpl->assign('locations', ReserveDatabaseAPI::locations());
    $wp_id = $_SESSION['wp_id'];
    $start_date = date('Y-m-d');
    $count = count(ReserveDatabaseAPI::by_status("pending"));
    $app->tpl->assign('count', $count);
    $app->tpl->assign('reservation', ReserveDatabaseAPI::by_user_date($start_date, $wp_id));
    $app->tpl->display('mypage.tpl');
});
//mypage
respond('/reservation', function ($request, $response, $app) {
    //the page to display todays reservation to the cts and helpdesk staff
    //$app->tpl->assign( 'locations' , ReserveDatabaseAPI::locations());
    $data = ReserveDatabaseAPI::search($request);
    if ($data['redirect_url']) {
        //if there was a redirect url in the data, redirect the user there
        $response->redirect($data['redirect_url']);
    }
    //otherwise assign the title and reservations
    $app->tpl->assign('title', $data['title']);