From 5808788b9eb6852bcc652a72fed139be583fa1e6 Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:35:22 +0200 Subject: [PATCH] Make blog cards clickable - wrap in anchor tags matching gallery pattern --- src/admin/admin_events.php | 495 +++++++++++++--------------------- src/admin/admin_trips.php | 427 ++++++++++++----------------- src/pages/blog/blog.php | 2 + src/pages/blog/user_blogs.php | 143 +++++----- src/pages/events/events.php | 19 +- src/pages/gallery/gallery.php | 67 +---- 6 files changed, 442 insertions(+), 711 deletions(-) diff --git a/src/admin/admin_events.php b/src/admin/admin_events.php index a62f1747..42bc39d1 100644 --- a/src/admin/admin_events.php +++ b/src/admin/admin_events.php @@ -1,13 +1,20 @@ 'index']]; +require_once($rootPath . '/components/banner.php'); // Fetch all events $events_query = " SELECT - event_id, name, type, location, date, published + event_id, name, type, location, date, image, published FROM events ORDER BY date DESC "; @@ -22,340 +29,202 @@ if ($result && $result->num_rows > 0) { ?> 'index'], [$pageTitle => '']]; - require_once($rootPath . '/components/banner.php'); -?> - - 'index'], [$pageTitle => '']]; + $breadcrumbs = [['Home' => 'index']]; require_once($rootPath . '/components/banner.php'); ?> -
+
-
+ - - -
-
- +
+

Manage Events

+ + New Event + +
+ +
+ + × +
+ 0) { + echo ''; + echo '
'; + + foreach ($events as $event) { + $eventImagePath = $event['image'] ? htmlspecialchars($event['image']) : 'assets/images/placeholder.jpg'; + $publishStatusBadge = $event['published'] == 1 ? 'PUBLISHED' : 'DRAFT'; + + echo ' +
+
+ ' . htmlspecialchars($event['name']) . ' +
+
+
+
+ ' . strtoupper($publishStatusBadge) . ' +
' . htmlspecialchars($event['name']) . '
+ 📍 ' . htmlspecialchars($event['location']) . ' +
+
+

+ Type: ' . htmlspecialchars($event['type']) . '
+ Date: ' . convertDate($event['date']) . ' +

+ +
- - - - - - - - - - - - '; - foreach ($events as $event) { - $publishButtonText = $event['published'] == 1 ? 'Unpublish' : 'Publish'; - $publishButtonClass = $event['published'] == 1 ? 'btn-warning' : 'btn-success'; - echo ' - - - - - - - '; - } - echo '
Event NameTypeLocationDateStatusActions
' . htmlspecialchars($event['name']) . '' . htmlspecialchars($event['type']) . '' . htmlspecialchars($event['location']) . '' . convertDate($event['date']) . '' . ($event['published'] == 1 ? 'Published' : 'Draft') . ' - - - - - -
'; - echo '
'; - echo '
'; - } else { - echo '

No events found. Create one

'; - } - ?> + '; + } + + echo '
'; + } else { + echo '
+

No events found. Create one

+
'; + } + ?> + +
+ +
+ + + diff --git a/src/admin/admin_trips.php b/src/admin/admin_trips.php index f98d219b..1026babf 100644 --- a/src/admin/admin_trips.php +++ b/src/admin/admin_trips.php @@ -1,14 +1,22 @@ 'index']]; +require_once($rootPath . '/components/banner.php'); // Fetch all trips with booking status $trips_query = " SELECT trip_id, trip_name, location, start_date, end_date, - vehicle_capacity, places_booked, cost_members, published + vehicle_capacity, places_booked, cost_members, cost_nonmembers, + cost_pensioner_member, cost_pensioner, published FROM trips ORDER BY start_date DESC "; @@ -23,131 +31,48 @@ if ($result && $result->num_rows > 0) { ?> @@ -155,164 +80,162 @@ if ($result && $result->num_rows > 0) { $bannerFolder = 'assets/images/banners/'; $bannerImages = glob($bannerFolder . '*.{jpg,jpeg,png,webp}', GLOB_BRACE); -$randomBanner = 'assets/images/base4/camping.jpg'; // default fallback -if (!empty($bannerImages)) { - $randomBanner = $bannerImages[array_rand($bannerImages)]; -} ?> -
- -
- -
-
-
+
-
- - Create New Trip - -
+
+
- 0) { - echo ''; - echo '
'; - echo '
'; - echo ' - - - - - - - - - - - - - - '; - foreach ($trips as $trip) { - $publishButtonText = $trip['published'] == 1 ? 'Unpublish' : 'Publish'; - $publishButtonClass = $trip['published'] == 1 ? 'btn-warning' : 'btn-success'; - echo ' - - - - - - - - - - '; - } - echo '
Trip NameLocationStart DateEnd DateCapacityBookedCost (Member)StatusActions
' . htmlspecialchars($trip['trip_name']) . '' . htmlspecialchars($trip['location']) . '' . date('M d, Y', strtotime($trip['start_date'])) . '' . date('M d, Y', strtotime($trip['end_date'])) . '' . $trip['vehicle_capacity'] . '' . $trip['places_booked'] . ' / ' . $trip['vehicle_capacity'] . 'R ' . number_format($trip['cost_members'], 2) . '' . ($trip['published'] == 1 ? 'Published' : 'Draft') . ' - - - - - -
'; - echo '
'; - echo '
'; - } else { - echo '

No trips found. Create one

'; - } - ?> +
+

Manage Trips

+ + New Event + +
+ +
+ + × +
+ 0) { + echo ''; + echo '
'; + + foreach ($trips as $trip) { + $available = $trip['vehicle_capacity'] - $trip['places_booked']; + $publishStatus = $trip['published'] == 1 ? 'published' : 'draft'; + $publishStatusBadge = $trip['published'] == 1 ? 'PUBLISHED' : 'DRAFT'; + + // Get trip image - look for assets/images/trips/$trip_id_{number}.jpg + $tripImagePath = ''; + $tripImagesGlob = glob($rootPath . '/assets/images/trips/' . $trip['trip_id'] . '_*.jpg'); + if (!empty($tripImagesGlob)) { + $tripImagePath = str_replace($rootPath, '', $tripImagesGlob[0]); + } else { + // Fallback to placeholder icon if no image found + $tripImagePath = 'assets/images/placeholder.jpg'; + } + + echo ' +
+
+ ' . htmlspecialchars($trip['trip_name']) . ' +
+
+
+
+ ' . strtoupper($publishStatusBadge) . ' +
' . htmlspecialchars($trip['trip_name']) . '
+ 📍 ' . htmlspecialchars($trip['location']) . ' +
+
+

+ Dates: ' . date('M d', strtotime($trip['start_date'])) . ' - ' . date('M d, Y', strtotime($trip['end_date'])) . '
+ Capacity: ' . $trip['places_booked'] . ' / ' . $trip['vehicle_capacity'] . '
+ Costs: Members: R ' . number_format($trip['cost_members'], 2) . ' | Non-Members: R ' . number_format($trip['cost_nonmembers'], 2) . ' | Pensioner Members: R ' . number_format($trip['cost_pensioner_member'], 2) . ' | Pensioners: R ' . number_format($trip['cost_pensioner'], 2) . ' +

+ +
+
+ '; + } + + echo '
'; + } else { + echo '
+

No trips found. Create one

+
'; + } + ?> + +
+ +
diff --git a/src/pages/blog/blog.php b/src/pages/blog/blog.php index ec610e95..1b75eb1e 100644 --- a/src/pages/blog/blog.php +++ b/src/pages/blog/blog.php @@ -100,6 +100,7 @@ include_once($rootPath . '/header.php'); // Output the HTML structure with dynamic data echo ' +
' . htmlspecialchars($post[ @@ -117,6 +118,7 @@ include_once($rootPath . '/header.php');
+
'; endwhile; diff --git a/src/pages/blog/user_blogs.php b/src/pages/blog/user_blogs.php index 8d4fde9d..c061c56d 100644 --- a/src/pages/blog/user_blogs.php +++ b/src/pages/blog/user_blogs.php @@ -19,63 +19,58 @@ $posts = $result->get_result(); ?> - - - -
-
-
-
+
+
+
-

My Posts

- -
- - × -
- - - + New Post +
+

My Blog Posts

+ + Create New Post + +
+ +
+ + × +
+ fetch_assoc()): - // Determine cover image - use provided image or fallback placeholder - $coverImage = $post["image"] ? $post["image"] : 'assets/images/placeholder.jpg'; - // Output the HTML structure with dynamic data - echo ' + while ($post = $posts->fetch_assoc()): + // Determine cover image - use provided image or fallback placeholder + $coverImage = $post["image"] ? $post["image"] : 'assets/images/placeholder.jpg'; + // Output the HTML structure with dynamic data + echo '
' . htmlspecialchars($post[
@@ -88,25 +83,25 @@ $bannerImages = glob($bannerFolder . '*.{jpg,jpeg,png,webp}', GLOB_BRACE);

' . $post["description"] . '

-
'; - endwhile; ?> +
'; + endwhile; ?> + + +
- -
- -
+
- diff --git a/src/pages/events/events.php b/src/pages/events/events.php index 02c7fae0..8b6ed48f 100644 --- a/src/pages/events/events.php +++ b/src/pages/events/events.php @@ -70,24 +70,7 @@ include_once($rootPath . '/header.php');
-
- -
- Sort By -
- -
+ close(); } .album-card { - position: relative; border-radius: 12px; overflow: hidden; background: white; - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); - transition: all 0.3s ease; display: flex; flex-direction: column; height: 100%; - } - - .album-card:hover { - transform: translateY(-8px); - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); + border: 1px solid #e0e0e0; } .album-image-wrapper { @@ -86,11 +79,6 @@ $conn->close(); width: 100%; height: 100%; object-fit: cover; - transition: transform 0.3s ease; - } - - .album-card:hover .album-image-wrapper img { - transform: scale(1.05); } .album-image-wrapper .no-image { @@ -163,49 +151,21 @@ $conn->close(); display: flex; gap: 8px; margin-top: auto; + align-items: center; } - .album-view-btn { - flex: 1; - padding: 8px 12px; - background: #667eea; - color: white; + .album-edit-icon { + background: none; border: none; - border-radius: 30px; - font-size: 0.85rem; - font-weight: 600; cursor: pointer; - transition: background 0.3s; - text-decoration: none; - text-align: center; - display: block; + color: inherit; + padding: 0; + font-size: 1.2rem; + transition: color 0.2s ease; } - .album-view-btn:hover { - background: #764ba2; - text-decoration: none; - color: white; - } - - .album-edit-btn { - padding: 8px 12px; - background: white; + .album-edit-icon:hover { color: #667eea; - border: 1px solid #667eea; - border-radius: 6px; - font-size: 0.85rem; - font-weight: 600; - cursor: pointer; - transition: all 0.3s; - text-decoration: none; - display: inline-block; - text-align: center; - } - - .album-edit-btn:hover { - background: #667eea; - color: white; - text-decoration: none; } .create-album-btn { @@ -260,7 +220,8 @@ require_once($rootPath . '/components/banner.php'); 0): ?>