Exemplo n.º 1
0
}
$mini = new Mini($db);
// Mini is the boss
$todaysLevel = $mini->getTodaysLevel();
if (isset($_GET['level']) && is_numeric($_GET['level']) && $_GET['level'] == $todaysLevel) {
    if ($todaysLevel > 9) {
        require DOCUMENT_ROOT . 'includes/html/event/mini_ended.php';
        exit;
    } elseif ($todaysLevel == 0) {
        require DOCUMENT_ROOT . 'includes/html/event/mini_not_started.php';
        exit;
    } elseif (!$mini->isLevelAvailable($todaysLevel)) {
        require DOCUMENT_ROOT . 'includes/html/event/mini_started.php';
        exit;
    }
    if ($mini->isAnswered()) {
        require DOCUMENT_ROOT . 'includes/html/event/mini_answered.php';
        exit;
    }
    $question = $mini->getQuestion($todaysLevel);
    $page = MINI_SERIES;
    /*	Prevent form spoofing */
    $spoof_proof = sha1(time() . chr(mt_rand(97, 122)));
    $_SESSION['spoof_proof'] = $spoof_proof;
} else {
    header('Location: ' . SITE_URL . 'mini/1.' . $todaysLevel . '/');
    exit;
}
?>
<!DOCTYPE html>
<html>