$pdo->query("SELECT COUNT(*) FROM cars")->fetchColumn(), 'approved_cars' => $pdo->query("SELECT COUNT(*) FROM cars WHERE status = 'approved'")->fetchColumn(), 'cars_sold' => $pdo->query("SELECT COUNT(*) FROM bookings WHERE status = 'approved'")->fetchColumn(), ]; // Recently Added (Limit 4) $stmt = $pdo->query("SELECT * FROM cars WHERE status = 'approved' ORDER BY created_at DESC LIMIT 4"); $recentCars = $stmt->fetchAll(PDO::FETCH_ASSOC); // Featured (Random 5 for Carousel) $stmt = $pdo->query("SELECT * FROM cars WHERE status = 'approved' ORDER BY RAND() LIMIT 5"); $featuredCars = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (Exception $e) { error_log("DB Error: " . $e->getMessage()); } $pageTitle = "Home"; include 'partials/header.php'; ?>

+

Cars Available for Sale

+

Happy Customers

100%

Verified Listings

Recently Added

Fresh arrivals just for you

View All
<?= htmlspecialchars($car['title']) ?>

$

What Our Users Say

Trusted by thousands of sellers and buyers across Afghanistan.

"Sold my Corolla in just 2 days! The process was super smooth and the admin support was helpful."

- Ahmad Wali, Kabul

"Found a great deal on a Ford Ranger. The car was exactly as described. Highly recommended!"

- Fatima Noor, Herat

"Best platform for cars in Afghanistan. Secure, fast, and easy to use."

- Mustafa Khan, Mazar