query($events_query); $events = []; if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $events[] = $row; } } ?> 'index'], [$pageTitle => '']]; require_once($rootPath . '/components/banner.php'); ?> 'index'], [$pageTitle => '']]; require_once($rootPath . '/components/banner.php'); ?> + Create New Event Event Name Type Location Date Status Actions '; foreach ($events as $event) { $publishButtonText = $event['published'] == 1 ? 'Unpublish' : 'Publish'; $publishButtonClass = $event['published'] == 1 ? 'btn-warning' : 'btn-success'; echo ' ' . htmlspecialchars($event['name']) . ' ' . htmlspecialchars($event['type']) . ' ' . htmlspecialchars($event['location']) . ' ' . convertDate($event['date']) . ' ' . ($event['published'] == 1 ? 'Published' : 'Draft') . ' '; } echo ''; echo ''; echo ''; } else { echo 'No events found. Create one'; } ?>
No events found. Create one