$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
Verified Listings
Fresh arrivals just for you
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."
"Found a great deal on a Ford Ranger. The car was exactly as described. Highly recommended!"
"Best platform for cars in Afghanistan. Secure, fast, and easy to use."