Exemple #1
0
if (isset($user) && is_null($page)) {
    $centre = new Centre($user->getCentre());
    if ($centre->isLocked()) {
        echo "<div class=\"alert alert-info\">";
        echo "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>";
        echo "Your centre is not currently opened for data entry.";
        echo "</div>";
    }
}
if ($include) {
    $include = basename($include);
    // Should be unneccesary, but you never know!
    require "./includes/{$include}.php";
} else {
    echo $trial->getWelcome();
    if ($trial->randomisationOffline()) {
        echo "<h4>Apologies, but randomisation is currently paused, it should be resumed soon.</h4>";
    }
    if ($trial->isOffline()) {
        echo "<h2>The site is currently offline for maintenance.</h2>";
    } else {
        if ($loggedIn) {
            /*        $result = DB::query( "SELECT title, content, time, forename, surname FROM news INNER JOIN user ON news.user_id = user.id ORDER BY time DESC LIMIT 0, 4" );
                    if ( $result->getRows() ) {
                        echo <<<_END
                        <div id="news">
                            <h3>Latest news:</h3>
            _END;
                        $pattern = '/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})/';
                        foreach ( $result->rows as $row ) {
                            preg_match( $pattern, $row->time, $date );