prepare(" SELECT b.*, c.make, c.model, c.year, c.price, c.mileage, u.username as buyer_name, u.role FROM bookings b JOIN cars c ON b.car_id = c.id JOIN users u ON b.user_id = u.id WHERE b.id = ? "); $stmt->execute([$bookingId]); $sale = $stmt->fetch(PDO::FETCH_ASSOC); if (!$sale || ($sale['user_id'] != $_SESSION['user_id'] && $_SESSION['role'] !== 'admin')) { die("Receipt not found or access denied."); } $pageTitle = "Sale Receipt"; ?> Receipt #<?= $sale['id'] ?>

Car Sells Afghanistan

Official Sale Receipt

Buyer Details

Name:

Bank Province:

Account: ****

Receipt Info

Receipt #:

Date:

Status: Paid

Description Amount

Mileage: km
$
Total $

Thank you for your business!

This receipt is electronically generated and valid without signature.

Back to Home