prepare(" SELECT p.*, c.brand, c.model, c.year, c.city, u.name as seller_name, u.phone as seller_phone FROM purchases p JOIN cars c ON p.car_id = c.id JOIN users u ON c.user_id = u.id WHERE p.transaction_id = ? AND (p.user_id = ? OR ?) "); $isAdmin = isset($_SESSION['role']) && $_SESSION['role'] === 'admin'; $stmt->execute([$txId, $_SESSION['user_id'], $isAdmin]); $data = $stmt->fetch(); if (!$data) { echo "
Secure Vehicle Transaction Module
Invoice #: = htmlspecialchars($data['reference_number'] ?: 'INV-'.$data['id']) ?>
Date: = date('M d, Y', strtotime($data['created_at'])) ?>
Status: = strtoupper($data['status']) ?>
= htmlspecialchars($data['buyer_name']) ?>
= htmlspecialchars($data['buyer_email']) ?>
= htmlspecialchars($data['buyer_phone']) ?>
Transaction ID:
= htmlspecialchars($data['transaction_id']) ?>
= htmlspecialchars($data['seller_name']) ?>
Status: Verified Premium Merchant
= htmlspecialchars($data['seller_phone']) ?>
= htmlspecialchars($data['city']) ?>, Afghanistan
| Item Description | Amount (USD) |
|---|---|
|
= htmlspecialchars($data['brand'] . ' ' . $data['model']) ?>
= $data['year'] ?> Model Vehicle - Base Price
|
$= number_format($data['base_price'], 2) ?> |
|
Marketplace Service Fee
|
$= number_format($data['marketplace_fee'], 2) ?> |
|
Automotive Sales Tax
|
$= number_format($data['tax'], 2) ?> |
| Total Payable Amount | $= number_format($data['total_amount'], 2) ?> |
Scan to Verify
= $verificationHash ?>
This official document is computer-generated and verified by AfgCars Enterprise Systems.
ESCROW STATUS: = strtoupper($data['escrow_status'] ?: 'held_in_escrow') ?> • PAYMENT METHOD: = strtoupper($data['payment_method'] ?: 'bank_transfer') ?>