예제 #1
0
파일: index.php 프로젝트: uhtoff/eCRF
            /*        $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 );
                            $datetime = strtotime($row->time);
                            $mysqldate = date("g:ia", $datetime ) . " on the " . date( "jS F, Y", $datetime);
                            if( $row->title ) echo "<h4>{$row->title}</h4>";
                            echo "<h5>Posted at {$mysqldate} by {$row->forename} {$row->surname}</h5>";
                            echo "<article>" . nl2br( HTML::clean( $row->content ) ) . "</article>";
                        }
                        echo "</div>";
                    }
            */
        } else {
            echo '<p>Please log in to access the site.</p>';
        }
    }
}
echo "</div>";
// End container div
echo "<div id=\"push\"></div>";
echo "</div>";
// End wrap div
$trial->writeFooter();
unset($_SESSION[$include]);
// unset any page specific session variables