Example #1
0
        $city = $results->fetch_assoc()['id'];
        $values = ['id' => $_POST['id'], 'user' => $_SESSION['id'], 'category' => $_POST['category'], 'name' => $_POST['name'], 'address' => $_POST['address'], 'city' => $city, 'description' => $_POST['description'], 'dateStart' => $dateStart, 'dateEnd' => $dateEnd, 'img' => $_POST['image'], 'public' => 1, 'offer' => $_POST['offer']];
        $connection->update("event", $values, ["id" => $_POST['id']]);
    }
}
?>
    <div class="container">
        <div class="row">
            <ul class="collapsible popout" data-collapsible="accordion">
                <?php 
include 'classes/Event.php';
$connection = Connection::get();
$results = $connection->select("select * from Events where user = {$_SESSION['id']}");
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']);
    $event->paintUserEvents();
}
?>
            </ul>
        </div>
    </div>
</main>

<?php 
include 'components/Footer.php';
?>

<?php 
include 'components/Script.php';
echo Script::JQUERY;
echo Script::MATERIALIZE;