diff --git a/about.php b/about.php new file mode 100644 index 0000000..573171a --- /dev/null +++ b/about.php @@ -0,0 +1,48 @@ + + +
+
+
+

About Us

+

Car Sales in Afghanistan – Premium Car Marketplace (2026 Edition)

+
+
+ +
+
+
+
+

Our Mission

+

We aim to revolutionize the automotive industry in Afghanistan by providing a professional, secure, and transparent marketplace for car buyers and sellers. Our platform is designed with the latest technology to ensure a premium experience for all users.

+

Developed by Mohammad Sadiq as a University Final-Year Project, this system represents the pinnacle of local software engineering, focusing on performance, aesthetics, and user experience.

+
+
+
+
+

Why Choose Us?

+
    +
  • Verified listings from across Afghanistan.
  • +
  • Premium Dark UI for comfortable browsing.
  • +
  • Secure role-based access control.
  • +
  • Detailed car history and specifications.
  • +
+
+
+
+
+ +
+
+

Contact Developer

+

Owner: Mohammad Sadiq

+

Email: admin@gmail.com

+

Available for consultation and custom software development projects.

+
+
+
+ + diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..775d500 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,291 @@ +/* + Car Sales in Afghanistan - Premium Master Styles + University Final-Year Project 2026 + No Bootstrap - 100% Custom CSS +*/ + +:root { + --bg-dark: #0f0f12; + --bg-surface: #1a1a22; + --bg-card: rgba(255, 255, 255, 0.05); + --accent-gold: #d4af37; + --accent-gold-hover: #b8962d; + --text-main: #ffffff; + --text-muted: #a0a0a5; + --glass-border: rgba(255, 255, 255, 0.1); + --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.8); + --radius-lg: 16px; + --radius-md: 12px; +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + background-color: var(--bg-dark); + color: var(--text-main); + line-height: 1.6; + overflow-x: hidden; +} + +/* Custom Responsive Grid System */ +.container { + max-width: 1200px; + margin: 0 auto; + padding: 0 20px; +} + +.row { + display: flex; + flex-wrap: wrap; + margin: 0 -15px; +} + +.col-3 { flex: 0 0 25%; padding: 15px; } +.col-4 { flex: 0 0 33.333%; padding: 15px; } +.col-6 { flex: 0 0 50%; padding: 15px; } +.col-12 { flex: 0 0 100%; padding: 15px; } + +@media (max-width: 992px) { + .col-4, .col-6 { flex: 0 0 50%; } +} + +@media (max-width: 768px) { + .col-3, .col-4, .col-6 { flex: 0 0 100%; } +} + +/* Glassmorphism Components */ +.glass-card { + background: var(--bg-card); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + border: 1px solid var(--glass-border); + border-radius: var(--radius-lg); + padding: 25px; + box-shadow: var(--shadow-main); + position: relative; +} + +/* Header & Nav */ +header { + background: rgba(15, 15, 18, 0.9); + backdrop-filter: blur(10px); + position: sticky; + top: 0; + z-index: 1000; + border-bottom: 1px solid var(--glass-border); +} + +nav { + display: flex; + justify-content: space-between; + align-items: center; + height: 80px; +} + +.logo { + font-size: 24px; + font-weight: 800; + color: var(--accent-gold); + text-transform: uppercase; + letter-spacing: 2px; + text-decoration: none; +} + +.nav-links { + display: flex; + gap: 30px; + list-style: none; +} + +.nav-links a { + color: var(--text-main); + text-decoration: none; + font-weight: 500; + transition: color 0.3s; +} + +.nav-links a:hover { + color: var(--accent-gold); +} + +/* Buttons */ +.btn { + display: inline-block; + padding: 12px 28px; + border-radius: var(--radius-md); + text-decoration: none; + font-weight: 600; + transition: all 0.3s ease; + cursor: pointer; + border: none; + text-align: center; +} + +.btn-primary { + background: linear-gradient(135deg, var(--accent-gold), #b8962d); + color: #000; +} + +.btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4); +} + +.btn-outline { + background: transparent; + border: 1px solid var(--accent-gold); + color: var(--accent-gold); +} + +.btn-outline:hover { + background: var(--accent-gold); + color: #000; +} + +/* Hero Section */ +.hero { + position: relative; + padding: 160px 0; + text-align: center; + background: linear-gradient(rgba(15, 15, 18, 0.7), rgba(15, 15, 18, 0.7)), url('../images/hero-bg.jpg'); + background-size: cover; + background-position: center; + display: flex; + align-items: center; + justify-content: center; + min-height: 80vh; +} + +.hero::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 150px; + background: linear-gradient(to top, var(--bg-dark), transparent); +} + +.hero h1 { + font-size: 4rem; + margin-bottom: 20px; + font-weight: 900; + line-height: 1.1; + text-shadow: 0 4px 20px rgba(0,0,0,0.5); +} + +.hero p { + font-size: 1.2rem; + color: var(--text-muted); + max-width: 600px; + margin: 0 auto 40px; +} + +/* Car Cards */ +.car-grid { + padding: 60px 0; +} + +.section-title { + margin-bottom: 40px; + font-size: 2rem; + border-left: 4px solid var(--accent-gold); + padding-left: 15px; +} + +.car-card { + transition: transform 0.3s ease; +} + +.car-card:hover { + transform: translateY(-10px); +} + +.car-img-container { + width: 100%; + height: 200px; + background: #333; + border-radius: var(--radius-md); + margin-bottom: 15px; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; + color: #666; +} + +.car-img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.car-info h3 { + margin-bottom: 5px; + font-size: 1.25rem; +} + +.car-details { + display: flex; + justify-content: space-between; + color: var(--text-muted); + font-size: 0.9rem; + margin-bottom: 15px; +} + +.car-price { + font-size: 1.5rem; + font-weight: 700; + color: var(--accent-gold); +} + +.badge-hot { + background: #ff4d4d; + color: white; + padding: 4px 10px; + border-radius: 4px; + font-size: 0.7rem; + font-weight: 800; + text-transform: uppercase; + position: absolute; + top: 15px; + right: 15px; + z-index: 10; +} + +/* Footer */ +footer { + padding: 60px 0 20px; + background: var(--bg-surface); + border-top: 1px solid var(--glass-border); + margin-top: 100px; +} + +.footer-content { + display: flex; + justify-content: space-between; + margin-bottom: 40px; +} + +.footer-bottom { + text-align: center; + color: var(--text-muted); + font-size: 0.9rem; + border-top: 1px solid var(--glass-border); + padding-top: 20px; +} + +/* Utility classes */ +.text-gold { color: var(--accent-gold); } +.mt-4 { margin-top: 1.5rem; } +.mb-4 { margin-bottom: 1.5rem; } +.d-flex { display: flex; } +.justify-between { justify-content: space-between; } +.align-center { align-items: center; } +.text-center { text-align: center; } +.w-100 { width: 100%; } diff --git a/assets/images/cars/camry.jpg b/assets/images/cars/camry.jpg new file mode 100644 index 0000000..c4679f1 Binary files /dev/null and b/assets/images/cars/camry.jpg differ diff --git a/assets/images/cars/corolla.jpg b/assets/images/cars/corolla.jpg new file mode 100644 index 0000000..6473883 Binary files /dev/null and b/assets/images/cars/corolla.jpg differ diff --git a/assets/images/cars/hilux.jpg b/assets/images/cars/hilux.jpg new file mode 100644 index 0000000..608939c Binary files /dev/null and b/assets/images/cars/hilux.jpg differ diff --git a/assets/images/cars/lx570.jpg b/assets/images/cars/lx570.jpg new file mode 100644 index 0000000..c732a87 Binary files /dev/null and b/assets/images/cars/lx570.jpg differ diff --git a/assets/images/cars/tucson.jpg b/assets/images/cars/tucson.jpg new file mode 100644 index 0000000..ac3521f Binary files /dev/null and b/assets/images/cars/tucson.jpg differ diff --git a/assets/images/hero-bg.jpg b/assets/images/hero-bg.jpg new file mode 100644 index 0000000..537d080 Binary files /dev/null and b/assets/images/hero-bg.jpg differ diff --git a/assets/js/app.js b/assets/js/app.js new file mode 100644 index 0000000..1664877 --- /dev/null +++ b/assets/js/app.js @@ -0,0 +1,33 @@ +// Car Sales Afghanistan - App Scripts +document.addEventListener('DOMContentLoaded', () => { + const header = document.querySelector('header'); + + // Header scroll effect + window.addEventListener('scroll', () => { + if (window.scrollY > 50) { + header.style.background = 'rgba(15, 15, 18, 0.95)'; + header.style.boxShadow = '0 4px 20px rgba(0,0,0,0.5)'; + } else { + header.style.background = 'rgba(15, 15, 18, 0.8)'; + header.style.boxShadow = 'none'; + } + }); + + // Simple fade-in animation for cards + const cards = document.querySelectorAll('.glass-card'); + const observer = new IntersectionObserver((entries) => { + entries.forEach(entry => { + if (entry.isIntersecting) { + entry.target.style.opacity = '1'; + entry.target.style.transform = 'translateY(0)'; + } + }); + }, { threshold: 0.1 }); + + cards.forEach(card => { + card.style.opacity = '0'; + card.style.transform = 'translateY(20px)'; + card.style.transition = 'all 0.6s ease-out'; + observer.observe(card); + }); +}); diff --git a/car_detail.php b/car_detail.php new file mode 100644 index 0000000..471506a --- /dev/null +++ b/car_detail.php @@ -0,0 +1,55 @@ + 0) { + try { + $pdo = db(); + $stmt = $pdo->prepare("SELECT * FROM cars WHERE id = ?"); + $stmt->execute([$id]); + $car = $stmt->fetch(); + } catch (PDOException $e) { + $car = null; + } +} + +if (!$car) { + header("Location: cars.php"); + exit; +} + +include __DIR__ . '/includes/header.php'; +?> + +
+
+
+
+
+ <?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?> +
+
+
+
+

+

Location: | Year:

+ +
$
+ +
+

Description

+

+
+ + +
+
+
+
+
+ + diff --git a/cars.php b/cars.php new file mode 100644 index 0000000..73b5dad --- /dev/null +++ b/cars.php @@ -0,0 +1,60 @@ +prepare("SELECT * FROM cars ORDER BY created_at DESC"); + $stmt->execute(); + $cars = $stmt->fetchAll(); +} catch (PDOException $e) { + $cars = []; +} + +include __DIR__ . '/includes/header.php'; +?> + +
+
+
+

Browse Our Collection

+

Explore our wide range of premium vehicles across Afghanistan.

+
+
+ +
+
+ +
+

No cars available at the moment.

+
+ + +
+
+ + Hot Deal + +
+ <?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?> +
+
+

+
+ Year: + City: +
+
+ $ + Details +
+
+
+
+ + +
+
+
+ + diff --git a/db/database.sql b/db/database.sql new file mode 100644 index 0000000..b1cb96e --- /dev/null +++ b/db/database.sql @@ -0,0 +1,66 @@ +-- Car Sales in Afghanistan - Database Schema +-- Prepared for University Final-Year Project (2026 Edition) + +DROP TABLE IF EXISTS contact_messages; +DROP TABLE IF EXISTS cars; +DROP TABLE IF EXISTS users; + +CREATE TABLE IF NOT EXISTS users ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + email VARCHAR(100) NOT NULL UNIQUE, + password VARCHAR(255) NOT NULL, + role ENUM('admin', 'user') DEFAULT 'user', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS cars ( + id INT AUTO_INCREMENT PRIMARY KEY, + user_id INT, + brand VARCHAR(50) NOT NULL, + model VARCHAR(50) NOT NULL, + year INT NOT NULL, + price DECIMAL(10, 2) NOT NULL, + city ENUM('Kabul', 'Herat', 'Mazar-i-Sharif', 'Kandahar', 'Jalalabad') NOT NULL, + description TEXT, + main_image VARCHAR(255), + status ENUM('available', 'sold') DEFAULT 'available', + is_hot_deal BOOLEAN DEFAULT FALSE, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS contact_messages ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + email VARCHAR(100) NOT NULL, + subject VARCHAR(200), + message TEXT NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +-- Default Admin Account (Password: 12345678) +INSERT IGNORE INTO users (id, name, email, password, role) VALUES +(1, 'Mohammad Sadiq', 'admin@gmail.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'admin'); + +-- 20 Cars in Afghanistan Details +TRUNCATE TABLE cars; +INSERT INTO cars (brand, model, year, price, city, main_image, is_hot_deal, description) VALUES +('Toyota', 'Corolla', 2015, 12500, 'Kabul', 'assets/images/cars/corolla.jpg', TRUE, 'Clean Toyota Corolla, very fuel efficient and popular in Kabul.'), +('Toyota', 'Hilux', 2022, 45000, 'Kabul', 'assets/images/cars/hilux.jpg', TRUE, 'Powerful Hilux for off-road and city use.'), +('Lexus', 'LX570', 2021, 95000, 'Kandahar', 'assets/images/cars/lx570.jpg', TRUE, 'Luxury and power combined. Top condition.'), +('Toyota', 'Camry', 2020, 22000, 'Mazar-i-Sharif', 'assets/images/cars/camry.jpg', FALSE, 'Reliable family sedan.'), +('Hyundai', 'Tucson', 2021, 24500, 'Jalalabad', 'assets/images/cars/tucson.jpg', FALSE, 'Modern SUV with great features.'), + +('Kia', 'Sportage', 2022, 27000, 'Kabul', 'https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg', TRUE, 'Stylish and comfortable compact SUV.'), +('Suzuki', 'Swift', 2018, 9500, 'Herat', 'https://images.pexels.com/photos/112460/pexels-photo-112460.jpeg', FALSE, 'Small but fast, perfect for city traffic.'), +('Toyota', 'Prado', 2019, 55000, 'Kandahar', 'https://images.pexels.com/photos/1035108/pexels-photo-1035108.jpeg', FALSE, 'Robust SUV for all terrains.'), +('Mercedes-Benz', 'S-Class', 2022, 120000, 'Kabul', 'https://images.pexels.com/photos/112460/pexels-photo-112460.jpeg', FALSE, 'Ultimate luxury for high-profile individuals.'), +('Toyota', 'Surf', 2005, 13500, 'Mazar-i-Sharif', 'https://images.pexels.com/photos/1035108/pexels-photo-1035108.jpeg', FALSE, 'Classic off-roader, very durable.'), +('Honda', 'Civic', 2017, 16000, 'Kabul', 'https://images.pexels.com/photos/3311574/pexels-photo-3311574.jpeg', FALSE, 'Sharp design and great performance.'), +('Range Rover', 'Vogue', 2023, 180000, 'Kabul', 'https://images.pexels.com/photos/112460/pexels-photo-112460.jpeg', TRUE, 'The pinnacle of luxury SUVs.'), +('Toyota', 'Hiace', 2016, 18000, 'Jalalabad', 'https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg', FALSE, 'Best van for passenger transport.'), +('Chevrolet', 'Camaro', 2019, 35000, 'Kabul', 'https://images.pexels.com/photos/3311574/pexels-photo-3311574.jpeg', FALSE, 'Muscle car for speed enthusiasts.'), +('Ford', 'Mustang', 2020, 38000, 'Herat', 'https://images.pexels.com/photos/112460/pexels-photo-112460.jpeg', FALSE, 'Iconic American muscle.'), +('Toyota', 'Vitz', 2015, 7500, 'Kabul', 'https://images.pexels.com/photos/3311574/pexels-photo-3311574.jpeg', FALSE, 'Compact and very fuel efficient.'), +('Lexus', 'RX350', 2018, 42000, 'Mazar-i-Sharif', 'https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg', FALSE, 'Premium crossover with smooth ride.'); diff --git a/includes/footer.php b/includes/footer.php new file mode 100644 index 0000000..fdcb333 --- /dev/null +++ b/includes/footer.php @@ -0,0 +1,29 @@ + + + + diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..99c4fb2 --- /dev/null +++ b/includes/header.php @@ -0,0 +1,30 @@ + + + + + + Car Sales Afghanistan | Premium Marketplace + + + + + + + +
+
+ +
+
diff --git a/includes/pexels.php b/includes/pexels.php new file mode 100644 index 0000000..e140f5d --- /dev/null +++ b/includes/pexels.php @@ -0,0 +1,28 @@ + 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18'; +} + +function pexels_get($url) { + $ch = curl_init(); + curl_setopt_array($ch, [ + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ], + CURLOPT_TIMEOUT => 15, + ]); + $resp = curl_exec($ch); + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true); + return null; +} + +function download_to($srcUrl, $destPath) { + if (!filter_var($srcUrl, FILTER_VALIDATE_URL)) return false; + $data = @file_get_contents($srcUrl); + if ($data === false) return false; + if (!is_dir(dirname($destPath))) mkdir(dirname($destPath), 0775, true); + return file_put_contents($destPath, $data) !== false; +} diff --git a/index.php b/index.php index 7205f3d..f4e26ef 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,95 @@ - - - - - - New Style -prepare("SELECT * FROM cars WHERE is_hot_deal = 1 LIMIT 6"); + $stmt->execute(); + $hot_deals = $stmt->fetchAll(); +} catch (PDOException $e) { + $hot_deals = []; +} + +// Meta tags from environment +$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Premium Car Marketplace in Afghanistan - University Final-Year Project 2026.'; $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; + +include __DIR__ . '/includes/header.php'; ?> - - - - - - - - - - - - - - - - - - - - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

-
-
- - - + +
+ +
+
+

Premium Car Marketplace
Afghanistan 2026

+

Experience the future of car buying with our enterprise-level marketplace. Premium cars, verified sellers, and smooth transactions.

+ +
+
+ + +
+
+
+
+

20+

+

Premium Cars

+
+
+
+
+

1.2k

+

Active Users

+
+
+
+
+

4

+

Major Cities

+
+
+
+
+ + +
+
+

Hot Deals

+
+ +
+

No hot deals available at the moment.

+
+ + +
+
+ Hot Deal +
+ <?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?> +
+
+

+
+ Year: + City: +
+
+ $ + Details +
+
+
+
+ + +
+
+
+
+ + diff --git a/setup.php b/setup.php new file mode 100644 index 0000000..413094b --- /dev/null +++ b/setup.php @@ -0,0 +1,22 @@ +exec($query); + } + } + + echo "Database initialized successfully!"; +} catch (PDOException $e) { + die("Database error: " . $e->getMessage()); +}