+
+
+
+ prepare("SELECT event_id, name, type, location, date, published FROM events ORDER BY date DESC");
+ $stmt->execute();
+ $result = $stmt->get_result();
+
+ if ($result->num_rows > 0) {
+ echo '
';
+ echo '
+
+
+ | Event Name |
+ Type |
+ Location |
+ Date |
+ Status |
+ Actions |
+
+
+ ';
+
+ while ($event = $result->fetch_assoc()) {
+ $event_id = $event['event_id'];
+ $name = htmlspecialchars($event['name']);
+ $type = htmlspecialchars($event['type']);
+ $location = htmlspecialchars($event['location']);
+ $date = convertDate($event['date']);
+ $status = $event['published'] ? 'Published' : 'Draft';
+
+ echo "
+ | {$name} |
+ {$type} |
+ {$location} |
+ {$date} |
+ {$status} |
+
+
+ |
+
";
+ }
+
+ echo '
';
+ } else {
+ echo '
';
+ }
+ ?>
+
+
+
+
diff --git a/src/admin/manage_events.php b/src/admin/manage_events.php
new file mode 100644
index 00000000..21157eeb
--- /dev/null
+++ b/src/admin/manage_events.php
@@ -0,0 +1,183 @@
+prepare("SELECT * FROM events WHERE event_id = ?");
+ $stmt->bind_param("i", $event_id);
+ $stmt->execute();
+ $result = $stmt->get_result();
+ if ($result->num_rows > 0) {
+ $event = $result->fetch_assoc();
+ }
+ $stmt->close();
+}
+?>
+
+ 'index'], ['Admin' => 'admin_events'], [$pageTitle => '']];
+ require_once($rootPath . '/components/banner.php');
+?>
+
+
+