prepare("SELECT c.*, ci.image_path FROM cars c LEFT JOIN car_images ci ON c.id = ci.car_id AND ci.is_main = 1 WHERE c.id = ? AND c.status = 'approved'"); $stmt->execute([$id]); $car = $stmt->fetch(); if (!$car) { header('Location: cars.php'); exit; } $success = false; $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $name = $_POST['buyer_name'] ?? ''; $phone = $_POST['buyer_phone'] ?? ''; $bank_id = $_POST['bank_id'] ?? ''; $personal_info = $_POST['personal_info'] ?? ''; $email = $_SESSION['user_email'] ?? ''; $stmt = $pdo->prepare("INSERT INTO purchases (car_id, user_id, buyer_name, buyer_email, buyer_phone, bank_id, personal_info, status) VALUES (?, ?, ?, ?, ?, ?, ?, 'pending')"); if ($stmt->execute([$id, $_SESSION['user_id'], $name, $email, $phone, $bank_id, $personal_info])) { $success = true; } else { $error = "Failed to submit request. Please try again."; } } ?>
🚀

Purchase Request Sent!

Your verification request for the with Bank Reference has been successfully submitted to our verification team.

Transaction Summary

Model •

Total Amount Due $

Buyer Verification

Provide your legal documentation and banking details to proceed with this secure purchase.

This reference will be verified with the Afghan banking systems.

IMPORTANT SECURITY NOTICE: Your personal data is encrypted. Submission of fraudulent bank IDs will result in account suspension and legal action under Afghanistan's automotive marketplace regulations.

CANCEL