diff --git a/admin_course_bookings.php b/admin_course_bookings.php index 5c1c91cd..27b915fb 100644 --- a/admin_course_bookings.php +++ b/admin_course_bookings.php @@ -2,7 +2,8 @@ checkAdmin(); // Fetch all trips -$courseSql = "SELECT date, course_id, course_type FROM courses"; +$courseSql = "SELECT date, course_id, course_type FROM courses WHERE DATE(date) >= CURDATE()"; + $courseResult = $conn->query($courseSql); if (!$courseResult) { echo "Error in SQL query: " . $conn->error; diff --git a/admin_members.php b/admin_members.php index dc781820..ce0497a9 100644 --- a/admin_members.php +++ b/admin_members.php @@ -1,7 +1,19 @@ prepare("UPDATE membership_application SET accept_indemnity = 1 WHERE user_id = ?"); + if ($stmt) { + $stmt->bind_param("i", $user_id); + $stmt->execute(); + $stmt->close(); + } +} + // SQL query to fetch data -$sql = "SELECT user_id, first_name, last_name, tel_cell, email, dob FROM membership_application"; +$sql = "SELECT user_id, first_name, last_name, tel_cell, email, dob, accept_indemnity FROM membership_application"; + $result = $conn->query($sql); ?>
- +
- + CURDATE()"; + $sql = "SELECT event_id, date, time, name, image, description, feature, location, type, promo FROM events WHERE date > CURDATE() ORDER BY date ASC"; $result = $conn->query($sql); @@ -85,6 +131,7 @@ if (!empty($bannerImages)) { $feature = $row['feature']; $location = $row['location']; $type = $row['type']; + $promo = $row['promo']; // Determine the badge text based on the status $badge_text = 'OPEN DAY'; @@ -104,8 +151,14 @@ if (!empty($bannerImages)) {

' . $description . '

+
  • ' . $time . '
  • + + +
    '; } @@ -117,12 +170,51 @@ if (!empty($bannerImages)) { $conn->close(); ?> - +
    + +
    +
    + × +
    + +
    +
    + \ No newline at end of file diff --git a/functions.php b/functions.php index 7050e9a6..fb94792c 100644 --- a/functions.php +++ b/functions.php @@ -32,7 +32,7 @@ function getTripCount() $conn = openDatabaseConnection(); // SQL query to count the number of rows - $sql = "SELECT COUNT(*) AS total FROM trips WHERE start_date > CURDATE()"; + $sql = "SELECT COUNT(*) AS total FROM trips WHERE published = 1 AND start_date > CURDATE()"; $result = $conn->query($sql); // Fetch the count from the result @@ -1391,7 +1391,8 @@ function countUpcomingTrips() // Open database connection $conn = openDatabaseConnection(); - $query = "SELECT COUNT(*) AS trip_count FROM trips WHERE start_date > CURDATE()"; + $query = "SELECT COUNT(*) AS trip_count FROM trips WHERE published = 1 AND start_date > CURDATE()"; + if ($result = $conn->query($query)) { $row = $result->fetch_assoc(); diff --git a/index.php b/index.php index eba977df..b03534a0 100644 --- a/index.php +++ b/index.php @@ -81,7 +81,11 @@ if (countUpcomingTrips() > 0) { ?>
    query($sql); if ($result->num_rows > 0) { @@ -114,7 +118,7 @@ if (countUpcomingTrips() > 0) { ?>
    '; diff --git a/payment_confirmation.php b/payment_confirmation.php index 86481fd6..2de6948b 100644 --- a/payment_confirmation.php +++ b/payment_confirmation.php @@ -132,7 +132,7 @@ if (!empty($bannerImages)) {

    Your invoice has been sent to . Please upload your proof of payment below.

    -

    Bookings not paid for within 24 hours will be forfeited.

    +
    Payment Details:

    The Four Wheel Drive Club of Southern Africa
    FNB
    Account Number: 58810022334
    Branch code: 250655
    Reference:
    Amount: R

    diff --git a/process_payments.php b/process_payments.php index 2bea93cc..f1a68af1 100644 --- a/process_payments.php +++ b/process_payments.php @@ -107,6 +107,7 @@ if (!empty($bannerImages)) { // Loop through each row while ($row = $result->fetch_assoc()) { $eft_id = $row['eft_id']; + $file_name = str_replace(' ', '_', $eft_id); $eft_user = $row['user_id']; $eft_amount = $row['amount']; $eft_description = $row['description']; @@ -115,8 +116,8 @@ if (!empty($bannerImages)) { echo '
    - -

    View Full PDF

    + +

    View Full PDF

    diff --git a/process_trip_booking.php b/process_trip_booking.php index 33560be9..90db52d9 100644 --- a/process_trip_booking.php +++ b/process_trip_booking.php @@ -34,9 +34,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $num_vehicles = isset($_POST['vehicles']) ? intval($_POST['vehicles']) : 1; // Default to 1 vehicle $num_adults = isset($_POST['adults']) ? intval($_POST['adults']) : 1; // Default to 1 adult $num_children = isset($_POST['children']) ? intval($_POST['children']) : 0; // Default to 0 children - $radio = isset($_POST['AddExtra']) ? 1 : 0; // Checkbox for extras + $num_pensioners = isset($_POST['pensioners']) ? intval($_POST['pensioners']) : 0; // Default to 0 pensioners + // $radio = isset($_POST['AddExtra']) ? 1 : 0; // Checkbox for extras // Fetch trip costs from the database - $query = "SELECT trip_name, cost_members, cost_nonmembers, booking_fee, start_date, end_date, trip_code FROM trips WHERE trip_id = ?"; + $query = "SELECT trip_name, cost_members, cost_nonmembers, cost_pensioner_member, cost_pensioner, booking_fee, start_date, end_date, trip_code FROM trips WHERE trip_id = ?"; $stmt = $conn->prepare($query); $stmt->bind_param('i', $trip_id); $stmt->execute(); @@ -56,7 +57,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $trip_name = $trip['trip_name']; $cost_members = intval($trip['cost_members']); $cost_nonmembers = intval($trip['cost_nonmembers']); + $cost_pensioner_member = intval($trip['cost_pensioner_member']); + $cost_pensioner = intval($trip['cost_pensioner']); $member_discount = $cost_nonmembers - $cost_members; + $member_discount_pensioner = $cost_pensioner - $cost_pensioner_member; $booking_fee = $trip['booking_fee']; $radioCost = $radio ? 50 : 0; $start_date = $trip['start_date']; // Start date of the trip @@ -72,11 +76,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Calculate total based on membership if ($is_member) { - $total = (($num_adults + $num_children) * $cost_nonmembers) + $radioCost + ($num_vehicles * $booking_fee); - $discountAmount = ($num_adults + $num_children) * $member_discount; + $total = (($num_adults + $num_children) * $cost_nonmembers) + ($num_pensioners * $cost_pensioner) + $radioCost + ($num_vehicles * $booking_fee); + $discountAmount = (($num_adults + $num_children) * $member_discount) + ($num_pensioners * $member_discount_pensioner ); $payment_amount = $total - $discountAmount; } else { - $total = (($num_adults + $num_children) * $cost_nonmembers) + $radioCost + ($num_vehicles * $booking_fee); + $total = (($num_adults + $num_children) * $cost_nonmembers) + ($num_pensioners * $cost_pensioner) + $radioCost + ($num_vehicles * $booking_fee); $payment_amount = $total; } @@ -85,19 +89,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $type = 'trip'; $payment_id = uniqid(); // $eft_id = strtoupper(base_convert(time(), 10, 36)); // Convert timestamp to base36 - $eft_id = strtoupper($trip_code." ".getLastName($user_id)); + $eft_id = strtoupper($trip_code." ".getInitialSurname($user_id)); // Insert booking into the database - $sql = "INSERT INTO bookings (booking_type, user_id, from_date, to_date, num_vehicles, num_adults, num_children, total_amount, discount_amount, status, payment_id, trip_id, radio, eft_id) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + $sql = "INSERT INTO bookings (booking_type, user_id, from_date, to_date, num_vehicles, num_adults, num_children, total_amount, discount_amount, status, payment_id, trip_id, radio, eft_id, num_pensioners) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $stmt = $conn->prepare($sql); if (!$stmt) { die("Preparation failed: " . $conn->error); } - $stmt->bind_param('sissiiiddssiis', $type, $user_id, $start_date, $end_date, $num_vehicles, $num_adults, $num_children, $total, $discountAmount, $status, $payment_id, $trip_id, $radio, $eft_id); + $stmt->bind_param('sissiiiddssiisi', $type, $user_id, $start_date, $end_date, $num_vehicles, $num_adults, $num_children, $total, $discountAmount, $status, $payment_id, $trip_id, $radio, $eft_id, $num_pensioners); if ($stmt->execute()) { // Get the generated booking_id diff --git a/trip-details.php b/trip-details.php index fd610a85..7e4c5e6d 100644 --- a/trip-details.php +++ b/trip-details.php @@ -12,7 +12,7 @@ $trip_id = intval(decryptData($token, $salt)); // Ensures $trip_id is treated as // Prepare the SQL query $sql = "SELECT trip_id, trip_name, location, short_description, long_description, start_date, end_date, - vehicle_capacity, cost_members, cost_nonmembers, places_booked, booking_fee + vehicle_capacity, cost_members, cost_nonmembers, places_booked, booking_fee, cost_pensioner, cost_pensioner_member FROM trips WHERE trip_id = ?"; @@ -45,7 +45,10 @@ if ($stmt) { $capacity = $row['vehicle_capacity']; $cost_members = $row['cost_members']; $cost_nonmembers = $row['cost_nonmembers']; + $cost_pensioner = $row['cost_pensioner']; + $cost_pensioner_member = $row['cost_pensioner_member']; $member_discount = $cost_nonmembers - $cost_members; + $member_discount_pensioner = $cost_pensioner - $cost_pensioner_member; $places_booked = $row['places_booked']; $booking_fee = $row['booking_fee']; $remaining_places = getAvailableSpaces($trip_id); @@ -145,25 +148,52 @@ $conn->close(); /* Optional: makes non-member price stand out */ } - -
    -
    -
    -
    - + + + + + +
    + +
    +
    - + + @@ -215,23 +245,23 @@ $conn->close();

    -
    +
    -
    +

    @@ -263,7 +293,7 @@ $conn->close();

    R

    /club fee per vehicle
    -
    +
    -

    Activities

    + -

    Itinerary

    + -

    Maps

    +
    - +
    @@ -430,6 +460,7 @@ $conn->close();
  • Adults
  • - -
    -
    Extras:
    - + + +
    @@ -474,6 +514,34 @@ $conn->close(); +
    +
    +

    INDEMNITY AND WAIVER

    +

    1. I agree to abide by the Code of Conduct as listed below, as well as any reasonable instructions given by any Member of the Committee of the Club, or any person appointed by the Club to organise or control any event (Club Officer).

    +

    2. I acknowledge that driving the off-road track is inherently dangerous, and that I am fully aware of the dangers thereof. I warrant that I will make all members of my party aware of such dangers prior to driving the track.

    +

    3. While I, or any member of my party, enjoy the facilities at Base 4 including overnight camping, picnicking, driving the track, using the swimming pool facility or activity or any other activity while at Base 4, I agree that under no circumstances shall the Club be liable for any loss or damage of any kind whatsoever (including consequential loss) which I or any of my party may suffer, regardless of how such loss or damage may have been caused or sustained, and whether or not as a result of the negligence or breach of contract (whether fundamental or otherwise) or other wrongful act of the Club, or any Club Officer, or any of the Club’s agents or contractors, and I hereby indemnify and hold harmless the Club and any Club Officer against all such loss or damage.

    +

    4. The expression, ‘member of my party’, means all persons who accompany me or attending any event at my specific invitation, request or suggestion, and includes without limitation, members of family, guests and invitees.

    +

    5. I understand that I am responsible for ensuring my vehicle and equipment and that all members of my party have adequate health and medical insurance to cover any and all likely occurrences.

    +

    6. This indemnity is irrevocable and shall apply to me and the members of my party for any Club events in which I may participate or attend.

    +

    BASE 4 CODE OF CONDUCT

    +

    1. No motorbikes or quadbikes.

    +

    2. No loud music (unless authorised by the Committee or its representatives).

    +

    3. Dogs to be controlled by their owners who take full responsibility for the animal’s behaviour.

    +

    4. No dogs belonging to non-members are allowed at Base 4 unless with the express permission of the Committee.

    +

    5. No person in the rear of open vehicles when driving on obstacles.

    +

    6. When driving the obstacles stay on the tracks.

    +

    7. Engage 4WD when driving the obstacles to minimise wear and damage to the track.

    +

    8. No alcohol to be consumed while driving the track.

    +

    9. No littering (please pick up cigarette butts etc.)

    +

    10. All rubbish is to be taken away with you when leaving. Dustbins and refuse collection is not provided.

    +

    11. Use water sparingly. Please bring your own water and a little extra for the Club.

    +

    I am a member of the Four Wheel Drive Club of Southern Africa and I will strive to uphold these Codes.

    +
    +
    + + +
    +
    Total: -
    - Need some help? | Payments will be redirected to Payfast. + Need some help?
    @@ -498,12 +566,12 @@ $conn->close();
    Need Help?
    -
    +
    @@ -528,40 +596,65 @@ $conn->close(); + + + diff --git a/trips.php b/trips.php index e7223c43..3bd26421 100644 --- a/trips.php +++ b/trips.php @@ -80,7 +80,7 @@ if (!empty($bannerImages)) { // Query to retrieve data from the trips table - $sql = "SELECT trip_id, trip_name, location, short_description, start_date, end_date, vehicle_capacity, cost_members, places_booked FROM trips WHERE start_date > CURDATE()"; + $sql = "SELECT trip_id, trip_name, location, short_description, start_date, end_date, vehicle_capacity, cost_members, places_booked FROM trips WHERE published = 1 AND start_date > CURDATE()"; $result = $conn->query($sql); if ($result->num_rows > 0) { diff --git a/uploads/pop/COURSE_06-21_C._PINTO.pdf b/uploads/pop/COURSE_06-21_C._PINTO.pdf deleted file mode 100644 index 5bd364b3..00000000 Binary files a/uploads/pop/COURSE_06-21_C._PINTO.pdf and /dev/null differ diff --git a/uploads/pop/COURSE_11-22_C._PINTO.pdf b/uploads/pop/COURSE_11-22_C._PINTO.pdf deleted file mode 100644 index dc09f12e..00000000 Binary files a/uploads/pop/COURSE_11-22_C._PINTO.pdf and /dev/null differ