Example #1
0
function displayContent($condition = null)
{
    include 'classes/Event.php';
    $connection = Connection::get();
    $sentenceSQL = "select * from Events";
    if ($condition != null) {
        $sentenceSQL .= " where category = " . $condition;
    }
    $sentenceSQL .= " limit 30";
    $results = $connection->select($sentenceSQL);
    while ($evt = $results->fetch_assoc()) {
        $event = new Event($evt['id'], $evt['user'], $evt['category'], $evt['name'], $evt['address'], $evt['city'], $evt['description'], $evt['dateStart'], $evt['dateEnd'], $evt['img'], $evt['public'], $evt['offer']);
        echo '<div class="col s12 m4">';
        $event->paintEvent();
        echo '</div>';
    }
}