sadiq
This commit is contained in:
parent
ec5d85b37d
commit
0c0cc2ad68
48
about.php
Normal file
48
about.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
include __DIR__ . '/includes/header.php';
|
||||
?>
|
||||
|
||||
<main>
|
||||
<section class="hero" style="min-height: 40vh; padding: 100px 0;">
|
||||
<div class="container">
|
||||
<h1>About <span class="text-gold">Us</span></h1>
|
||||
<p>Car Sales in Afghanistan – Premium Car Marketplace (2026 Edition)</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="glass-card">
|
||||
<h2 class="text-gold mb-4">Our Mission</h2>
|
||||
<p>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.</p>
|
||||
<p class="mt-4">Developed by <strong>Mohammad Sadiq</strong> as a University Final-Year Project, this system represents the pinnacle of local software engineering, focusing on performance, aesthetics, and user experience.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="glass-card">
|
||||
<h2 class="text-gold mb-4">Why Choose Us?</h2>
|
||||
<ul style="list-style: none; color: var(--text-muted);">
|
||||
<li class="mb-4"><span class="text-gold">✔</span> Verified listings from across Afghanistan.</li>
|
||||
<li class="mb-4"><span class="text-gold">✔</span> Premium Dark UI for comfortable browsing.</li>
|
||||
<li class="mb-4"><span class="text-gold">✔</span> Secure role-based access control.</li>
|
||||
<li class="mb-4"><span class="text-gold">✔</span> Detailed car history and specifications.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container mt-4">
|
||||
<div class="glass-card text-center">
|
||||
<h2 class="text-gold mb-4">Contact Developer</h2>
|
||||
<p><strong>Owner:</strong> Mohammad Sadiq</p>
|
||||
<p><strong>Email:</strong> admin@gmail.com</p>
|
||||
<p class="mt-4">Available for consultation and custom software development projects.</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||
291
assets/css/style.css
Normal file
291
assets/css/style.css
Normal file
@ -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%; }
|
||||
BIN
assets/images/cars/camry.jpg
Normal file
BIN
assets/images/cars/camry.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
assets/images/cars/corolla.jpg
Normal file
BIN
assets/images/cars/corolla.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
BIN
assets/images/cars/hilux.jpg
Normal file
BIN
assets/images/cars/hilux.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
assets/images/cars/lx570.jpg
Normal file
BIN
assets/images/cars/lx570.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/images/cars/tucson.jpg
Normal file
BIN
assets/images/cars/tucson.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
BIN
assets/images/hero-bg.jpg
Normal file
BIN
assets/images/hero-bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
33
assets/js/app.js
Normal file
33
assets/js/app.js
Normal file
@ -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);
|
||||
});
|
||||
});
|
||||
55
car_detail.php
Normal file
55
car_detail.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
$car = null;
|
||||
|
||||
if ($id > 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';
|
||||
?>
|
||||
|
||||
<main>
|
||||
<section class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="glass-card">
|
||||
<img src="<?php echo htmlspecialchars($car['main_image']); ?>" alt="<?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?>" class="w-100" style="border-radius: var(--radius-lg);" onerror="this.src='https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg?auto=compress&cs=tinysrgb&w=600'">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="glass-card">
|
||||
<h1 class="text-gold"><?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?></h1>
|
||||
<p class="text-muted mb-4">Location: <?php echo htmlspecialchars($car['city']); ?> | Year: <?php echo $car['year']; ?></p>
|
||||
|
||||
<div class="car-price mb-4" style="font-size: 2.5rem;">$<?php echo number_format($car['price']); ?></div>
|
||||
|
||||
<div class="mb-4">
|
||||
<h3 class="text-gold mb-2">Description</h3>
|
||||
<p><?php echo nl2br(htmlspecialchars($car['description'])); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-4">
|
||||
<a href="contact.php?car_id=<?php echo $car['id']; ?>" class="btn btn-primary w-100">Contact Seller</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||
60
cars.php
Normal file
60
cars.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
// Fetch all cars
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT * FROM cars ORDER BY created_at DESC");
|
||||
$stmt->execute();
|
||||
$cars = $stmt->fetchAll();
|
||||
} catch (PDOException $e) {
|
||||
$cars = [];
|
||||
}
|
||||
|
||||
include __DIR__ . '/includes/header.php';
|
||||
?>
|
||||
|
||||
<main>
|
||||
<section class="hero" style="min-height: 30vh; padding: 60px 0;">
|
||||
<div class="container">
|
||||
<h1>Browse <span class="text-gold">Our Collection</span></h1>
|
||||
<p>Explore our wide range of premium vehicles across Afghanistan.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container mt-4">
|
||||
<div class="row">
|
||||
<?php if (empty($cars)): ?>
|
||||
<div class="col-12 text-center">
|
||||
<p class="text-muted">No cars available at the moment.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($cars as $car): ?>
|
||||
<div class="col-4">
|
||||
<div class="glass-card car-card mb-4">
|
||||
<?php if ($car['is_hot_deal']): ?>
|
||||
<span class="badge-hot">Hot Deal</span>
|
||||
<?php endif; ?>
|
||||
<div class="car-img-container">
|
||||
<img src="<?php echo htmlspecialchars($car['main_image']); ?>" alt="<?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?>" class="car-img" onerror="this.src='https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg?auto=compress&cs=tinysrgb&w=600'">
|
||||
</div>
|
||||
<div class="car-info">
|
||||
<h3><?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?></h3>
|
||||
<div class="car-details">
|
||||
<span>Year: <?php echo $car['year']; ?></span>
|
||||
<span>City: <?php echo htmlspecialchars($car['city']); ?></span>
|
||||
</div>
|
||||
<div class="justify-between align-center d-flex">
|
||||
<span class="car-price">$<?php echo number_format($car['price']); ?></span>
|
||||
<a href="car_detail.php?id=<?php echo $car['id']; ?>" class="btn btn-outline">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||
66
db/database.sql
Normal file
66
db/database.sql
Normal file
@ -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.');
|
||||
29
includes/footer.php
Normal file
29
includes/footer.php
Normal file
@ -0,0 +1,29 @@
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="footer-content">
|
||||
<div class="col-6">
|
||||
<a href="index.php" class="logo">AFG CARS</a>
|
||||
<p class="mt-4" style="color: var(--text-muted);">Premium car marketplace in Afghanistan. Find your dream car with ease and confidence.</p>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<h4 class="mb-4">Quick Links</h4>
|
||||
<ul class="nav-links" style="flex-direction: column; gap: 10px;">
|
||||
<li><a href="index.php">Home</a></li>
|
||||
<li><a href="cars.php">Browse Cars</a></li>
|
||||
<li><a href="contact.php">Contact Us</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<h4 class="mb-4">Contact</h4>
|
||||
<p style="color: var(--text-muted);">Email: admin@gmail.com</p>
|
||||
<p style="color: var(--text-muted);">Location: Kabul, Afghanistan</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">
|
||||
<p>© 2026 Car Sales in Afghanistan. Developer: Mohammad Sadiq. University Final-Year Project.</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="assets/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
30
includes/header.php
Normal file
30
includes/header.php
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Car Sales Afghanistan | Premium Marketplace</title>
|
||||
<link rel="stylesheet" href="assets/css/style.css?v=<?php echo time(); ?>">
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<nav>
|
||||
<a href="index.php" class="logo">AFG CARS</a>
|
||||
<ul class="nav-links">
|
||||
<li><a href="index.php">Home</a></li>
|
||||
<li><a href="about.php">About</a></li>
|
||||
<li><a href="cars.php">Browse Cars</a></li>
|
||||
<li><a href="contact.php">Contact</a></li>
|
||||
</ul>
|
||||
<div class="auth-buttons">
|
||||
<a href="login.php" class="btn btn-outline" style="margin-right: 10px;">Login</a>
|
||||
<a href="register.php" class="btn btn-primary">Register</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
28
includes/pexels.php
Normal file
28
includes/pexels.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
function pexels_key() {
|
||||
$k = getenv('PEXELS_KEY');
|
||||
return $k && strlen($k) > 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;
|
||||
}
|
||||
237
index.php
237
index.php
@ -1,150 +1,95 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
// Fetch "Hot Deal" cars for the landing page
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->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';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<main>
|
||||
<!-- Hero Section -->
|
||||
<section class="hero">
|
||||
<div class="container">
|
||||
<h1>Premium Car Marketplace <br> <span class="text-gold">Afghanistan 2026</span></h1>
|
||||
<p>Experience the future of car buying with our enterprise-level marketplace. Premium cars, verified sellers, and smooth transactions.</p>
|
||||
<div class="hero-btns">
|
||||
<a href="cars.php" class="btn btn-primary">Browse All Cars</a>
|
||||
<a href="#hot-deals" class="btn btn-outline" style="margin-left: 15px;">Hot Deals</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Stats Section -->
|
||||
<section class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="glass-card text-center">
|
||||
<h2 class="text-gold">20+</h2>
|
||||
<p class="text-muted">Premium Cars</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="glass-card text-center">
|
||||
<h2 class="text-gold">1.2k</h2>
|
||||
<p class="text-muted">Active Users</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="glass-card text-center">
|
||||
<h2 class="text-gold">4</h2>
|
||||
<p class="text-muted">Major Cities</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Hot Deals Section -->
|
||||
<section id="hot-deals" class="car-grid">
|
||||
<div class="container">
|
||||
<h2 class="section-title">Hot <span class="text-gold">Deals</span></h2>
|
||||
<div class="row">
|
||||
<?php if (empty($hot_deals)): ?>
|
||||
<div class="col-12 text-center">
|
||||
<p class="text-muted">No hot deals available at the moment.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($hot_deals as $car): ?>
|
||||
<div class="col-4">
|
||||
<div class="glass-card car-card">
|
||||
<span class="badge-hot">Hot Deal</span>
|
||||
<div class="car-img-container">
|
||||
<img src="<?php echo htmlspecialchars($car['main_image']); ?>" alt="<?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?>" class="car-img" onerror="this.src='https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg?auto=compress&cs=tinysrgb&w=600'">
|
||||
</div>
|
||||
<div class="car-info">
|
||||
<h3><?php echo htmlspecialchars($car['brand'] . ' ' . $car['model']); ?></h3>
|
||||
<div class="car-details">
|
||||
<span>Year: <?php echo $car['year']; ?></span>
|
||||
<span>City: <?php echo htmlspecialchars($car['city']); ?></span>
|
||||
</div>
|
||||
<div class="justify-between align-center d-flex">
|
||||
<span class="car-price">$<?php echo number_format($car['price']); ?></span>
|
||||
<a href="car_detail.php?id=<?php echo $car['id']; ?>" class="btn btn-outline">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<?php include __DIR__ . '/includes/footer.php'; ?>
|
||||
|
||||
22
setup.php
Normal file
22
setup.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
$sql = file_get_contents(__DIR__ . '/db/database.sql');
|
||||
|
||||
// Split SQL by semicolon to execute multiple queries
|
||||
// Simple regex to split by ; followed by newline or end of file
|
||||
$queries = preg_split("/;(\r\n|\n|\r|$)/", $sql);
|
||||
|
||||
foreach ($queries as $query) {
|
||||
$query = trim($query);
|
||||
if (!empty($query)) {
|
||||
$pdo->exec($query);
|
||||
}
|
||||
}
|
||||
|
||||
echo "Database initialized successfully!";
|
||||
} catch (PDOException $e) {
|
||||
die("Database error: " . $e->getMessage());
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user