prepare($sql); if (!$stmt) { die("Prepare failed: " . $conn->error); } $stmt->bind_param("i", $booking_id); $stmt->execute(); $stmt->bind_result($eft_id, $amount, $discount, $trip_id, $course_id); $stmt->fetch(); $stmt->close(); // Check if booking was found if (!$eft_id) { die("Error: Booking not found."); } // Retrieve trip details $sql = "SELECT trip_name, start_date, end_date FROM trips WHERE trip_id = ?"; $stmt = $conn->prepare($sql); if (!$stmt) { die("Prepare failed: " . $conn->error); } $stmt->bind_param("i", $trip_id); $stmt->execute(); $stmt->bind_result($trip_name, $start_date, $end_date); $stmt->fetch(); $stmt->close(); // Retrieve trip details $sql = "SELECT course_type, date FROM courses WHERE course_id = ?"; $stmt = $conn->prepare($sql); if (!$stmt) { die("Prepare failed: " . $conn->error); } $stmt->bind_param("i", $course_id); $stmt->execute(); $stmt->bind_result($type, $start_date); $stmt->fetch(); $stmt->close(); if ($type === "driver_training") { $course_name = "Basic 4X4 Driver Training Course"; } elseif ($type === "bush_mechanics") { $course_name = "Bush Mechanics Course"; } elseif ($type === "rescue_recovery") { $course_name = "Rescue & Recovery Training Course"; } else { $course_name = "General Course"; // Default fallback description } // $start_date = $date; // Get user's email $sql = "SELECT email FROM users WHERE user_id = ?"; $stmt = $conn->prepare($sql); if (!$stmt) { die("Prepare failed: " . $conn->error); } $stmt->bind_param("i", $user_id); $stmt->execute(); $stmt->bind_result($user_email); $stmt->fetch(); $stmt->close(); $conn->close(); $payment_amount = $amount - $discount; ?>
Booking Summary:

'. htmlspecialchars($start_date).' - '.htmlspecialchars($end_date).'

'; } else { echo htmlspecialchars($course_name).'

'. htmlspecialchars($start_date).'

'; }?>

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

Submit Proof of Payment