diff --git a/assets/images/pp/7a7b9965853213ea1e4ed1aec4e18ad0.jpg b/assets/images/pp/7a7b9965853213ea1e4ed1aec4e18ad0.jpg new file mode 100644 index 00000000..cde64514 Binary files /dev/null and b/assets/images/pp/7a7b9965853213ea1e4ed1aec4e18ad0.jpg differ diff --git a/assets/images/trips/7_01.jpg b/assets/images/trips/7_01.jpg deleted file mode 100644 index 3018e71c..00000000 Binary files a/assets/images/trips/7_01.jpg and /dev/null differ diff --git a/src/admin/admin_trip_bookings.php b/src/admin/admin_trip_bookings.php index 4f76e8d1..db42554c 100644 --- a/src/admin/admin_trip_bookings.php +++ b/src/admin/admin_trip_bookings.php @@ -174,7 +174,7 @@ if (!empty($bannerImages)) { // Fetch bookings for the current trip $bookingsSql = "SELECT b.user_id, b.num_vehicles, b.num_adults, b.num_children, b.num_pensioners, b.radio, b.status, - u.first_name, u.last_name, + u.first_name, u.last_name, u.profile_pic, (b.total_amount - b.discount_amount) AS paid FROM bookings b INNER JOIN users u ON b.user_id = u.user_id diff --git a/src/admin/admin_trips.php b/src/admin/admin_trips.php index a1acd97f..f98d219b 100644 --- a/src/admin/admin_trips.php +++ b/src/admin/admin_trips.php @@ -22,88 +22,220 @@ if ($result && $result->num_rows > 0) { } ?> + + + + 'index'], ['Admin' => 'admin'], [$pageTitle => '']]; - require_once($rootPath . '/components/banner.php'); +$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)]; +} ?> +
+ +
+ +
+
-
+
-
-
-
-

Manage Trips

- - Create New Trip - -
- -
- - - - - - - - - - - - - - - - 0): ?> - - - - - - - - - - - - - - - - - - - -
Trip NameLocationStart DateEnd DateCapacityBookedCost (Member)StatusActions
- - - - - - R - - Published - - Draft - - - - - - -
-

No trips found. Create one

-
-
-
+
+ + 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

'; + } + ?>
@@ -111,6 +243,44 @@ if ($result && $result->num_rows > 0) {