Exemplo n.º 1
0
<?php

$app->get('/managers/bets/', function () use($app) {
    // AUTHENTICATION FIRST
    if (!Sentry::check()) {
        // User is not logged in, or is not activated
        $app->flash('error', 'User is not logged in, or is not activated');
        $app->redirect('/managers/login');
    }
    $user = Sentry::getUser();
    if (!$user->isSuperUser()) {
        $app->flash('error', 'Your are not administrator.');
        $app->redirect('/managers/login');
    }
    $twig = Twig::get();
    $template = $twig->loadTemplate('managers-bets.html');
    echo $template->render(array());
});
$app->get('/managers/bets/request/', function () use($app) {
    // AUTHENTICATION FIRST
    if (!Sentry::check()) {
        // User is not logged in, or is not activated
        $app->status(401);
    }
    $user = Sentry::getUser();
    if (!$user->isSuperUser()) {
        $app->status(401);
    }
    $data = array();
    $counter = 0;
    $draws = Bet::orderBy('id', 'desc')->get()->toArray();