Invalid submission: missing eft_id or file."; echo "
";
        echo "POST data: " . print_r($_POST, true);
        echo "FILES data: " . print_r($_FILES, true);
        echo "
"; } else { $file = $_FILES['pop_file']; $target_dir = "uploads/pop/"; $target_file = $target_dir . $eft_id . ".pdf"; // Check for upload errors first if ($file['error'] !== UPLOAD_ERR_OK) { echo "
Upload error code: " . $file['error'] . "
"; // You can decode error code if needed: // https://www.php.net/manual/en/features.file-upload.errors.php exit; } // Check for PDF extension $file_type = strtolower(pathinfo($file['name'], PATHINFO_EXTENSION)); if ($file_type !== "pdf") { echo "
Only PDF files allowed. You tried uploading: .$file_type
"; exit; } // Make sure target directory exists and writable if (!is_dir($target_dir)) { echo "
Upload directory does not exist: $target_dir
"; exit; } if (!is_writable($target_dir)) { echo "
Upload directory is not writable: $target_dir
"; exit; } if (move_uploaded_file($file['tmp_name'], $target_file)) { // Update EFT and booking status $stmt1 = $conn->prepare("UPDATE efts SET status = 'PROCESSING' WHERE eft_id = ?"); $stmt1->bind_param("s", $eft_id); $stmt1->execute(); $stmt2 = $conn->prepare("UPDATE bookings SET status = 'PROCESSING' WHERE eft_id = ?"); $stmt2->bind_param("s", $eft_id); $stmt2->execute(); //TODO send mail with pop attachment to jacqui & louise $_SESSION['message'] = "We have received your P.O.P. We will process it soon."; header("Location: bookings.php"); exit; } else { echo "
Unable to move uploaded file.
"; echo "
Tmp file exists? " . (file_exists($file['tmp_name']) ? "Yes" : "No") . "
"; echo "
Tmp file path: " . htmlspecialchars($file['tmp_name']) . "
"; exit; } } } // Fetch bookings for dropdown $stmt = $conn->prepare("SELECT eft_id FROM bookings WHERE user_id = ? AND status = 'AWAITING PAYMENT'"); //TODO add membership id as well $stmt->bind_param("i", $user_id); $stmt->execute(); $result = $stmt->get_result(); $bookings = $result->fetch_all(MYSQLI_ASSOC); $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)]; } ?>

Submit Proof of Payment

To finalise your booking, select the booking that you have paid for below, and then upload your PDF proof of payment.

0) {?>
  • Select Booking