From bde9c05daa826324e3baba5e1b7c7cc284d1d41d Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 23 Feb 2026 11:37:06 +0000 Subject: [PATCH] sadiq --- about.php | 90 +++++------ add_car.php | 78 +++++----- admin_cars.php | 188 +++++++++++++---------- admin_dashboard.php | 59 ++++---- admin_messages.php | 38 +++-- admin_purchases.php | 199 +++++++++++++----------- admin_users.php | 32 ++-- assets/css/style.css | 352 +++++++++++++++++++++++++++++++++++-------- car_detail.php | 62 ++++---- cars.php | 73 +++++---- contact.php | 92 +++++------ dashboard.php | 126 ++++++++-------- edit_car.php | 63 +++++--- includes/header.php | 23 +-- index.php | 101 +++++++------ login.php | 26 ++-- purchase.php | 74 ++++----- receipt.php | 84 +++++------ register.php | 30 ++-- 19 files changed, 1059 insertions(+), 731 deletions(-) diff --git a/about.php b/about.php index 55a7a3c..3a2911a 100644 --- a/about.php +++ b/about.php @@ -2,72 +2,76 @@ require_once __DIR__ . '/includes/header.php'; ?> -
-

About AfgCars

-

Afghanistan's Premier Marketplace for Luxury & Reliable Vehicles.

+
+

Our Legacy

+

The definitive portal for elite automotive excellence in Afghanistan.

-
-
-
-

Our Mission

-

- Founded in 2026, AfgCars aims to revolutionize the automotive industry in Afghanistan by providing a safe, transparent, and efficient platform for buying and selling premium vehicles. +

+
+
+

Our Strategic Mission

+

+ Established in 2026, AfgCars has redefined the standards of the Afghan automotive industry. Our platform is engineered to deliver absolute transparency, unparalleled security, and an elite trading experience for the nation's most discerning car enthusiasts.

-

- We bridge the gap between high-end luxury and everyday reliability, ensuring that every citizen has access to the best automotive options with verified seller information and comprehensive vehicle details. +

+ We bridge the critical gap between high-end global automotive luxury and the dynamic local Afghan market, ensuring every transaction is verified and every vehicle is an asset.

-
- Team +
+ Team +
+

EST. 2026

+

Founded in Kabul

+
-
-

Our Physical Locations

-
-
-

Kabul Main Showroom

-

Wazir Akbar Khan, Street 15

-

Kabul, Afghanistan

-

+93 700 123 456

+
+

Our National Network

+
+
+

Kabul Main Experience

+

Wazir Akbar Khan, District 10

+

Kabul, Afghanistan

+

+93 700 123 456

-
-

Herat Branch

-

Jada-e-Main, Near Blue Mosque

-

Herat, Afghanistan

-

+93 700 987 654

+
+

Herat Elite Branch

+

Jada-e-Main, Near Blue Mosque

+

Herat, Afghanistan

+

+93 700 987 654

-
-

Mazar-i-Sharif Office

-

Balkh Gate Road

-

Mazar-i-Sharif, Afghanistan

-

+93 700 456 789

+
+

Mazar-i-Sharif Luxury

+

Balkh Gate National Road

+

Mazar-i-Sharif, Afghanistan

+

+93 700 456 789

-
-

Why trust us?

-
+
+

Unrivaled Standards

+
-

500+

-

Premium Cars Sold

+

800+

+

Premium Sales

-

24/7

-

Support Availability

+

24/7

+

Concierge Access

-

100%

-

Verified Sellers

+

100%

+

Verified Listings

-

5

-

Major Cities

+

08+

+

National Hubs

- + \ No newline at end of file diff --git a/add_car.php b/add_car.php index 5e7a934..5c63f34 100644 --- a/add_car.php +++ b/add_car.php @@ -79,51 +79,51 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $cities = ['Kabul', 'Herat', 'Mazar-i-Sharif', 'Kandahar', 'Jalalabad', 'Kunduz', 'Ghazni', 'Balkh']; ?> -
-
-

List Your Vehicle

-

Provide details about your car and yourself. Our team will review and approve your listing.

+
+
+

List Your Vehicle

+

Provide all details about your car and yourself. Our team will review and approve your listing shortly.

-
-

🎉 Listing Submitted!

-

Your car and seller information have been sent for approval. You can track its status in your dashboard.

-
- Go to Dashboard +
+

🎉 Listing Successfully Submitted!

+

Your vehicle and seller documentation are now under review. Check your dashboard for status updates.

+
-
+
-

1. Vehicle Details

-
+

1. Vehicle Details

+
- +
- +
-
+
- +
- +
- + -
-
- - +
+ +
- - + +
-
+
-

2. Seller Information

+

2. Verified Seller Documentation

- +
- - + +
-
- - Cancel +
+ + CANCEL
@@ -177,7 +177,7 @@ $cities = ['Kabul', 'Herat', 'Mazar-i-Sharif', 'Kandahar', 'Jalalabad', 'Kunduz' document.getElementById('car_image').onchange = function() { if (this.files && this.files[0]) { const fileName = document.getElementById('file-name'); - fileName.textContent = 'Selected: ' + this.files[0].name; + fileName.textContent = '✅ Selected File: ' + this.files[0].name; fileName.style.display = 'block'; } }; diff --git a/admin_cars.php b/admin_cars.php index 9412983..fc1366d 100644 --- a/admin_cars.php +++ b/admin_cars.php @@ -1,8 +1,9 @@ query(" "); $cars = $stmt->fetchAll(); ?> + + + + + + Manage Inventory | Admin + + + + +
+ + -
-
-
-

Inventory Management

-

Review and approve vehicle listings from sellers.

-
- + +
+
+
+

Inventory Management

+

Review, approve, and manage all vehicle listings across the platform.

+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
Vehicle DetailsSeller InfoPrice & CityStatusActions
+
+ +
+
+
+
+
+
+
+
+
+
$
+
+
+ + + + +
+ +
+ + +
+
+ + +
+ + Edit + Delete +
+
+
+
+
- - -
- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
VehicleSellerPriceLocationStatusAction
-
- -
-
-
-
-
-
-
-
-
$ - - - - -
- -
- - -
-
- - -
- - Edit - Delete -
-
-
-
- - \ No newline at end of file + + \ No newline at end of file diff --git a/admin_dashboard.php b/admin_dashboard.php index 163403e..33ecfd4 100644 --- a/admin_dashboard.php +++ b/admin_dashboard.php @@ -36,10 +36,10 @@ $recentMessages = $pdo->query("SELECT * FROM contact_messages ORDER BY created_a Admin Dashboard | AfgCars - + - +
-
+
-

Dashboard Overview

-

Welcome back,

+

Dashboard Overview

+

Welcome back,

-
@@ -88,21 +88,20 @@ $recentMessages = $pdo->query("SELECT * FROM contact_messages ORDER BY created_a
-
+
-
-
-

Recent Car Listings

- View All +
+
+

Recent Car Listings

+ View All
-
- +
+
- @@ -110,17 +109,12 @@ $recentMessages = $pdo->query("SELECT * FROM contact_messages ORDER BY created_a - - - + + @@ -129,19 +123,22 @@ $recentMessages = $pdo->query("SELECT * FROM contact_messages ORDER BY created_a -
-

Recent Messages

+
+
+

Recent Messages

+ All Messages +
-

No new messages.

+

No new messages.

- - + +
-

+

...

diff --git a/admin_messages.php b/admin_messages.php index 00061e4..878883c 100644 --- a/admin_messages.php +++ b/admin_messages.php @@ -12,7 +12,7 @@ $pdo = db(); if (isset($_GET['action']) && isset($_GET['id'])) { $id = $_GET['id']; if ($_GET['action'] === 'read') { - $pdo->prepare("UPDATE contact_messages SET status = 'read' WHERE id = ?")->execute([$id]); + $pdo->prepare("UPDATE contact_messages SET status = 'read' WHERE id = ?")->execute([id]); } elseif ($_GET['action'] === 'delete') { $pdo->prepare("DELETE FROM contact_messages WHERE id = ?")->execute([$id]); } @@ -28,10 +28,12 @@ $messages = $pdo->query("SELECT * FROM contact_messages ORDER BY created_at DESC Manage Messages | Admin + - +
+ +
-

Customer Inquiries

+
+

Customer Inquiries

+

Review and respond to messages from marketplace users and visitors.

+
-
+
-

No messages found.

+

No messages found.

-
-
+
+
-

-

From: ()

+

+

From: ()

-
+
-
+
- diff --git a/admin_purchases.php b/admin_purchases.php index 25e2c86..6f27c0c 100644 --- a/admin_purchases.php +++ b/admin_purchases.php @@ -1,8 +1,9 @@ query(" "); $purchases = $stmt->fetchAll(); ?> + + + + + + Purchase Requests | Admin + + + + +
+ + -
-
-
-

Purchase Requests

-

Review and manage buyer bank verification requests.

-
- Back to Dashboard + +
+
+

Purchase Requests

+

Verify bank IDs and personal information to approve or reject vehicle transactions.

+
+ + +
+ +
+ + +
+
+
Car Owner PriceStatus Action
-
-
+
+
$ - - - - View$View
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Vehicle DetailsBuyer VerificationBank ReferenceTransaction AmountCurrent StatusAction
+
+ +
+
+
+
+
+
+
+
+
+
+ + +
$
+
+ + + + + +
+
+ + +
+
+ + +
+
+ + Verified + +
+

No purchase requests waiting for verification.

+
+
+
+
- - -
- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VehicleBuyer DetailsBank IDPriceStatusAction
-
- -
-
-
-
-
-
-
-
-
-
- - $ - - - - - -
-
- - -
-
- - -
-
- - Completed - -
No purchase requests found.
-
-
- - \ No newline at end of file + + \ No newline at end of file diff --git a/admin_users.php b/admin_users.php index 6767659..dc3d0c4 100644 --- a/admin_users.php +++ b/admin_users.php @@ -30,10 +30,12 @@ $users = $pdo->query("SELECT * FROM users WHERE deleted_at IS NULL ORDER BY crea Manage Users | Admin + - +
+ +
-

User Management

- -
+
+

User Management

+

Manage access levels and monitor activity of marketplace users.

+
+ +
@@ -67,23 +73,23 @@ $users = $pdo->query("SELECT * FROM users WHERE deleted_at IS NULL ORDER BY crea diff --git a/assets/css/style.css b/assets/css/style.css index 131c492..b795617 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -7,7 +7,7 @@ --text-primary: #f8fafc; --text-secondary: #94a3b8; --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); - --sidebar-width: 260px; + --sidebar-width: 280px; --danger: #ff4757; --success: #2ed573; --warning: #ffa502; @@ -103,6 +103,76 @@ nav { padding: 0 4%; } +/* Dashboard Layout */ +.dashboard-container { + display: flex; + min-height: 100vh; + background: #050505; +} + +.main-content { + flex: 1; + margin-left: var(--sidebar-width); + padding: 3rem 4rem; + min-width: 0; +} + +/* Sidebar (Admin) */ +.sidebar { + width: var(--sidebar-width); + height: 100vh; + background: #0a0a0a; + border-right: 1px solid var(--glass-border); + position: fixed; + padding: 2.5rem 1.5rem; + display: flex; + flex-direction: column; + z-index: 100; +} + +.sidebar-brand { + font-size: 1.5rem; + font-weight: 900; + color: var(--primary-color); + text-decoration: none; + letter-spacing: 4px; + margin-bottom: 3.5rem; + padding-left: 1rem; + display: block; +} + +.sidebar-menu { + list-style: none; + flex: 1; +} + +.sidebar-menu li { + margin-bottom: 0.5rem; +} + +.sidebar-menu a { + display: flex; + align-items: center; + gap: 1rem; + padding: 1.2rem 1.5rem; + color: var(--text-secondary); + text-decoration: none; + font-weight: 600; + border-radius: 12px; + transition: var(--transition); + font-size: 0.95rem; +} + +.sidebar-menu a:hover, .sidebar-menu a.active { + background: rgba(212, 175, 55, 0.1); + color: var(--primary-color); +} + +.sidebar-footer { + padding-top: 2rem; + border-top: 1px solid var(--glass-border); +} + /* Hero Section */ .hero { height: 85vh; @@ -161,6 +231,10 @@ label { box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2); } +textarea.form-control { + resize: none; +} + /* Buttons */ .btn { padding: 1rem 2rem; @@ -170,10 +244,12 @@ label { text-decoration: none; display: inline-flex; align-items: center; + justify-content: center; gap: 0.8rem; transition: var(--transition); border: none; font-size: 0.95rem; + white-space: nowrap; } .btn-primary { @@ -204,6 +280,22 @@ label { font-size: 0.85rem; } +.btn-lg { + padding: 1.5rem 3rem; + font-size: 1.1rem; +} + +.btn-danger { + background: rgba(255, 71, 87, 0.1); + color: var(--danger); + border: 1px solid var(--danger); +} + +.btn-danger:hover { + background: var(--danger); + color: white; +} + .btn-auth { padding: 0.8rem 1.5rem; border-radius: 12px; @@ -213,6 +305,9 @@ label { font-weight: 700; font-size: 0.9rem; transition: var(--transition); + display: inline-flex; + align-items: center; + gap: 0.5rem; } .btn-auth:hover { @@ -223,12 +318,97 @@ label { /* Grid Layouts */ .grid { display: grid; - gap: 2.5rem; + gap: 2rem; } +.grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } +/* Stats Card */ +.stats-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + gap: 1.5rem; + margin-bottom: 3rem; +} + +.stat-card { + padding: 2.5rem 2rem; + display: flex; + flex-direction: column; +} + +.stat-label { + font-size: 0.8rem; + color: var(--text-secondary); + text-transform: uppercase; + letter-spacing: 2px; + font-weight: 800; + margin-bottom: 1rem; +} + +.stat-value { + font-size: 3rem; + font-weight: 900; + color: var(--primary-color); + line-height: 1; +} + +/* Table Styling */ +.table-container { + overflow-x: auto; + border-radius: 16px; +} + +table { + width: 100%; + border-collapse: collapse; + text-align: left; +} + +table thead tr { + background: rgba(255, 255, 255, 0.03) !important; +} + +table th { + padding: 1.5rem; + color: var(--text-primary); + font-weight: 800; + font-size: 0.85rem; + text-transform: uppercase; + letter-spacing: 1px; + border-bottom: 1px solid var(--glass-border); +} + +table td { + padding: 1.5rem; + color: var(--text-secondary); + border-bottom: 1px solid rgba(255, 255, 255, 0.05); + vertical-align: middle; +} + +table tr:last-child td { + border-bottom: none; +} + +/* Badge */ +.badge { + padding: 0.4rem 1rem; + border-radius: 30px; + font-size: 0.75rem; + font-weight: 800; + text-transform: uppercase; + letter-spacing: 1px; + display: inline-block; +} + +.badge-success { background: rgba(46, 213, 115, 0.15); color: #2ed573; border: 1px solid rgba(46, 213, 115, 0.3); } +.badge-warning { background: rgba(255, 165, 2, 0.15); color: #ffa502; border: 1px solid rgba(255, 165, 2, 0.3); } +.badge-danger { background: rgba(255, 71, 87, 0.15); color: #ff4757; border: 1px solid rgba(255, 71, 87, 0.3); } +.badge-info { background: rgba(30, 144, 255, 0.15); color: #1e90ff; border: 1px solid rgba(30, 144, 255, 0.3); } +.badge-primary { background: rgba(212, 175, 55, 0.15); color: var(--primary-color); border: 1px solid rgba(212, 175, 55, 0.3); } + /* Card Styling */ .card { background: var(--card-bg); @@ -254,61 +434,103 @@ label { padding: 2rem; } -/* Table styling */ -table thead tr { - background: rgba(255, 255, 255, 0.05) !important; +/* Page Header */ +.page-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 4rem; + padding: 2rem 0; } -table tr { - border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; +.page-header h1 { + font-size: 3rem; + font-weight: 900; + color: #fff; + margin-bottom: 0.5rem; } -table td { - padding: 1.2rem; +.page-header p { color: var(--text-secondary); + font-size: 1.1rem; } -table th { - padding: 1.2rem; - text-align: left; - color: var(--text-primary); - font-weight: 700; -} - -/* Sidebar (Admin) */ -.sidebar { - width: var(--sidebar-width); - height: 100vh; - background: var(--bg-color); - border-right: 1px solid var(--glass-border); - position: fixed; - padding: 3rem 2rem; -} - -.sidebar-link { +/* Section Title */ +.section-title { + font-size: 2rem; + font-weight: 800; + margin-bottom: 2.5rem; display: flex; align-items: center; gap: 1rem; - padding: 1.2rem; - color: var(--text-secondary); - text-decoration: none; - font-weight: 600; - border-radius: 12px; - margin-bottom: 0.5rem; - transition: var(--transition); + color: #fff; } -.sidebar-link:hover, .sidebar-link.active { - background: rgba(212, 175, 55, 0.1); +.section-icon { + background: var(--primary-color); + color: #000; + width: 45px; + height: 45px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 12px; + font-size: 1.3rem; +} + +/* Sold Overlay */ +.sold-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.7); + display: flex; + align-items: center; + justify-content: center; color: var(--primary-color); + font-weight: 900; + font-size: 2.5rem; + letter-spacing: 5px; + text-shadow: 0 5px 15px rgba(0,0,0,0.5); + z-index: 5; +} + +.sold-stamp { + border: 10px double white; + color: white; + padding: 20px 50px; + font-weight: 900; + font-size: 5rem; + transform: rotate(-15deg); + letter-spacing: 10px; + text-shadow: 0 10px 30px rgba(0,0,0,0.5); +} + +/* Price Tag */ +.price-tag { + font-weight: 900; + color: var(--primary-color); + font-size: 1.5rem; +} + +.price-tag-large { + font-size: 3.5rem; + font-weight: 900; + color: var(--primary-color); + line-height: 1; } /* Alerts */ .alert { - padding: 1rem 1.5rem; - border-radius: 12px; - margin-bottom: 1rem; + padding: 1.2rem 2rem; + border-radius: 16px; + margin-bottom: 2rem; font-weight: 600; + display: flex; + align-items: center; + gap: 1rem; } .alert-error { @@ -326,32 +548,28 @@ table th { /* Box component */ .box { background: var(--card-bg); - border-radius: 24px; + border-radius: 32px; border: 1px solid var(--glass-border); - box-shadow: 0 10px 30px rgba(0,0,0,0.3); + padding: 4rem; } -/* Stats Card */ -.stats-card { - padding: 2rem; - border-radius: 20px; - background: var(--card-bg); - border: 1px solid var(--glass-border); -} - -.stats-card h3 { - font-size: 0.9rem; - color: var(--text-secondary); - text-transform: uppercase; - letter-spacing: 1px; - margin-bottom: 0.5rem; -} - -.stats-card .value { - font-size: 2.5rem; - font-weight: 900; - color: var(--primary-color); -} +/* Utility */ +.mb-1 { margin-bottom: 1rem; } +.mb-2 { margin-bottom: 2rem; } +.mb-3 { margin-bottom: 3rem; } +.mt-1 { margin-top: 1rem; } +.mt-2 { margin-top: 2rem; } +.mt-3 { margin-top: 3rem; } +.fw-bold { font-weight: 700; } +.fw-black { font-weight: 900; } +.text-gold { color: var(--primary-color); } +.text-sm { font-size: 0.85rem; } +.text-center { text-align: center; } +.flex { display: flex; } +.justify-between { justify-content: space-between; } +.align-center { align-items: center; } +.gap-1 { gap: 1rem; } +.w-full { width: 100%; } /* Footer Styles */ footer { @@ -404,13 +622,21 @@ footer { font-size: 0.9rem; } +@media (max-width: 1200px) { + .main-content { padding: 3rem 2rem; } +} + @media (max-width: 1024px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } .footer-grid { grid-template-columns: 1fr 1fr; } + .sidebar { width: 80px; padding: 2rem 0.5rem; } + .sidebar span, .sidebar-brand { display: none; } + .main-content { margin-left: 80px; } } @media (max-width: 768px) { - .grid-4, .grid-3 { grid-template-columns: 1fr; } + .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } .hero h1 { font-size: 3rem; } .footer-grid { grid-template-columns: 1fr; } + .page-header { flex-direction: column; text-align: center; gap: 2rem; } } \ No newline at end of file diff --git a/car_detail.php b/car_detail.php index 23c6c4b..2129387 100644 --- a/car_detail.php +++ b/car_detail.php @@ -25,29 +25,29 @@ $stmt->execute([$id]); $images = $stmt->fetchAll(PDO::FETCH_COLUMN); ?> -
-
+
+
- + -
-
SOLD
+
+
SOLD
-
+
- +
-

Description

-
+

Description

+
@@ -55,51 +55,51 @@ $images = $stmt->fetchAll(PDO::FETCH_COLUMN);
-
-
- +
+
+
-

+

-

- Year: | Status: +

+ Year: | Status:

-
-

Current Price

-
$
+
+

Current Marketplace Price

+
$
-
- This vehicle has been sold. +
+

This vehicle has been successfully sold.

- Initiate Purchase Request + Initiate Purchase Request -
-
-
+
+
+
-

Seller

-

+

Verified Seller

+

-
-

- 🛡️ AfgCars Secure +
+

+ 🛡️ AfgCars Secure Payment

-

- Every listing is manually verified by our team. Personal information and bank IDs are encrypted and used only for legal documentation. +

+ Every transaction is protected. We verify bank references and legal documentation before finalizing any sale in Afghanistan.

diff --git a/cars.php b/cars.php index 7607e17..a7a8a59 100644 --- a/cars.php +++ b/cars.php @@ -35,30 +35,32 @@ $cities = $pdo->query("SELECT DISTINCT city FROM cars WHERE status = 'approved'" $brands = $pdo->query("SELECT DISTINCT brand FROM cars WHERE status = 'approved'")->fetchAll(PDO::FETCH_COLUMN); ?> -
-
-

Premium Inventory

-

Find the perfect vehicle for your lifestyle in our verified marketplace.

+
+ -
-
-
- +
+ +
+
-
- +
+
-
- +
+
- +
-
+
-
-
+
+
-
-
SOLD
+
+
SOLD
- Hot Deal + Hot Deal
-
-

-

- 📍 -

-
- $ - View Details +
+
+ 📍 + 📅 Model +
+

+
+ $ + + View Info + + View Details +
@@ -98,12 +105,12 @@ $brands = $pdo->query("SELECT DISTINCT brand FROM cars WHERE status = 'approved'
-
-
🔍
-

No vehicles found

-

Try adjusting your filters or search terms.

+
+
🔍
+

No premium vehicles found

+

Try adjusting your filters or refining your search criteria.

- + \ No newline at end of file diff --git a/contact.php b/contact.php index dafd8fb..8531dbc 100644 --- a/contact.php +++ b/contact.php @@ -16,90 +16,92 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } ?> -
-

Get in Touch

-

Have questions? Our team is here to help you find the perfect vehicle.

+
+

Connect With Us

+

Our elite concierge team is ready to assist you with every aspect of your premium automotive journey.

-
-
-
-
-

- 📍 Visit Us +
+
+
+
+

+ 📍 Headquarters

-

+

Wazir Akbar Khan, District 10,
Kabul, Afghanistan

-

+93 799 123 456

+

+93 799 123 456

-
-

- 🕒 Working Hours +
+

+ 🕒 Concierge Hours

-
- Sat - Wed: - 8:00 - 18:00 +
+ Sat - Wed: + 08:00 - 18:00
-
- Thursday: - 8:00 - 13:00 +
+ Thursday: + 08:00 - 13:00
-
-

- ✉️ Support Email +
+

+ ✉️ Digital Inquiries

-

info@afgcars.af

-

support@afgcars.af

+

info@afgcars.af

+

concierge@afgcars.af

-
-

Send us a message

+
+

Direct Inquiry Portal

+

Submit your requirements and our specialists will contact you shortly.

+ -
- ✨ Message sent successfully! Our representative will contact you within 24 hours. +
+ Your message has been encrypted and securely transmitted to our team.
-
+
- +
- +
- - + +
- - + +
- +
-
-
+
+
-
-
-
📍
-

Our Location

-

VISIT US IN KABUL

- Open in Google Maps +
+
+
📍
+

Strategic Location

+

VISIT THE KABUL EXPERIENCE CENTER

+ OPEN IN NAVIGATION
diff --git a/dashboard.php b/dashboard.php index fef1c68..795752d 100644 --- a/dashboard.php +++ b/dashboard.php @@ -34,51 +34,51 @@ $my_purchases = $stmt->fetchAll(); ?>
-
+ -
+
-

- 🚗 +

+ 🚗 My Vehicle Listings

-
-

You haven't listed any vehicles yet.

+
+

You haven't listed any vehicles yet.

Start Selling Today
-
+
-
SOLD
+
SOLD
-
+
-

-

+

+

- +
- @@ -90,58 +90,60 @@ $my_purchases = $stmt->fetchAll();
-

- 💰 +

+ 💰 My Purchase Requests

-
-

You haven't made any purchase requests yet.

+
+

You haven't made any purchase requests yet.

Browse Marketplace
-
-

-
-
+
+
-
-
+
+
-
- - - - - - - - - - - - - - - - - +
+
+
VehiclePriceBank IDStatusAction
-
- -
-
-
Model
-
-
-
$ - - - - - - View Receipt - - Under Review - -
+ + + + + + + - - -
VehiclePriceBank IDStatusAction
+ + + + + +
+ +
+
+
Model
+
+
+ + $ + + + + + + + + + View Receipt + + Under Review + + + + + + +
diff --git a/edit_car.php b/edit_car.php index b141657..7481054 100644 --- a/edit_car.php +++ b/edit_car.php @@ -10,9 +10,15 @@ $pdo = db(); $id = $_GET['id'] ?? 0; $userId = $_SESSION['user_id']; -// Check ownership -$stmt = $pdo->prepare("SELECT * FROM cars WHERE id = ? AND user_id = ? AND deleted_at IS NULL"); -$stmt->execute([$id, $userId]); +// Check ownership or admin role +$isAdmin = isset($_SESSION['role']) && $_SESSION['role'] === 'admin'; +if ($isAdmin) { + $stmt = $pdo->prepare("SELECT * FROM cars WHERE id = ? AND deleted_at IS NULL"); + $stmt->execute([$id]); +} else { + $stmt = $pdo->prepare("SELECT * FROM cars WHERE id = ? AND user_id = ? AND deleted_at IS NULL"); + $stmt->execute([$id, $userId]); +} $car = $stmt->fetch(); if (!$car) { @@ -35,6 +41,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $stmt = $pdo->prepare("UPDATE cars SET brand = ?, model = ?, year = ?, price = ?, city = ?, description = ?, status = 'pending' WHERE id = ?"); $stmt->execute([$brand, $model, $year, $price, $city, $description, $id]); $success = true; + // Refresh car data + $car['brand'] = $brand; + $car['model'] = $model; + $car['year'] = $year; + $car['price'] = $price; + $car['city'] = $city; + $car['description'] = $description; } catch (Exception $e) { $error = "Update failed: " . $e->getMessage(); } @@ -43,50 +56,50 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $cities = ['Kabul', 'Herat', 'Mazar-i-Sharif', 'Kandahar', 'Jalalabad', 'Kunduz', 'Ghazni', 'Balkh']; ?> -
-
-

Edit Listing

-

Update your vehicle details. Note: editing will reset the status to 'pending' for re-approval.

+
+
+

Edit Vehicle Listing

+

Update your vehicle specifications. Note: making changes will reset the approval status to 'pending'.

-
-

✨ Changes Saved!

-

Your listing has been updated and is now pending approval.

-
- Back to Dashboard +
+

✨ Vehicle Updated Successfully!

+

Your changes have been saved and the listing is awaiting re-approval by our administrators.

+
-
+
-
+
- +
- +
-
+
- +
- +
- + + +
-
- - Cancel +
+ + DISCARD & EXIT
diff --git a/includes/header.php b/includes/header.php index a6e95b7..dff79e0 100644 --- a/includes/header.php +++ b/includes/header.php @@ -4,6 +4,17 @@ if (session_status() === PHP_SESSION_NONE) { } require_once __DIR__ . '/../db/config.php'; $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Premium Car Marketplace Afghanistan'; + +// List of admin pages that use the sidebar layout +$adminPages = [ + 'admin_dashboard.php', + 'admin_cars.php', + 'admin_users.php', + 'admin_messages.php', + 'admin_purchases.php' +]; +$currentPage = basename($_SERVER['SCRIPT_NAME']); +$isAdminPage = in_array($currentPage, $adminPages); ?> @@ -13,19 +24,11 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Premium Car Marketplac AfgCars | Premium Marketplace - - - +