diff --git a/README.md b/README.md
new file mode 100644
index 0000000..fd75e90
--- /dev/null
+++ b/README.md
@@ -0,0 +1,95 @@
+# AFG CARS - Premium Car Marketplace Afghanistan
+
+Welcome to **AFG CARS**, an enterprise-level automotive marketplace platform specifically designed for the Afghanistan market (2026 Edition). This application provides a seamless experience for buying, selling, and managing vehicle listings with a modern, high-end UI and robust administrative features.
+
+---
+
+## 🚀 Key Features
+
+### 1. Advanced Marketplace
+* **Verified Listings:** High-quality vehicle listings with detailed specifications.
+* **Smart Search:** Filter by Brand, Model, Year, Location (Kabul, Herat, etc.), and Price range.
+* **Badging System:** Visual indicators for "Hot Deals" and "SOLD" status.
+
+### 2. Role-Based Access Control (RBAC)
+* **Guests:** Browse cars, search the market, and view company information.
+* **Registered Users:** List their own cars for sale, manage favorites, track purchases, and submit reviews.
+* **Administrators:** Full control over listing approvals, user management, sales tracking, and system notifications.
+
+### 3. User & Admin Dashboards
+* **User Hub:** Track pending/approved listings, manage personal car ads, and view purchase history.
+* **Admin Command Center:** Review user-submitted cars for approval, view total revenue, manage users, and receive real-time alerts.
+
+### 4. Enterprise-Grade Systems
+* **Review & Rating System:** Users can rate vehicles and leave feedback for sold items.
+* **Simulated Purchase System:** Integrated "Buy Now" flow featuring major Afghanistan banks (DAB, Azizi, AIB, etc.).
+* **Contact & Mail Integration:** Functional contact forms using the platform's internal mail service.
+
+### 5. Physical Presence
+* Detailed information about physical showrooms in **Kabul, Herat, Mazar-i-Sharif, and Kandahar**.
+
+---
+
+## 🛠 Tech Stack
+
+* **Language:** PHP 8.x (Vanilla)
+* **Database:** MariaDB / MySQL (via PDO)
+* **Frontend:** Bootstrap 5, Inter Typography, Bi-Icons
+* **Styling:** Custom CSS with modern glassmorphism and soft gradient effects
+* **AI Integration:** Local AI Proxy for advanced processing
+* **Mail Service:** PHPMailer-based `MailService`
+
+---
+
+## ⚙️ Installation & How to Run
+
+### Prerequisites
+* A web server (Apache/Nginx) with PHP 8.x support.
+* MariaDB or MySQL database server.
+
+### Setup Steps
+1. **Clone the Repository:**
+ Place the project files into your web server's document root (e.g., `/var/www/html` or `htdocs`).
+
+2. **Database Configuration:**
+ * Open `db/config.php` and update the `DB_HOST`, `DB_NAME`, `DB_USER`, and `DB_PASS` constants to match your local environment.
+ * Run the database initialization script by visiting `http://your-domain/db/setup.php` in your browser. This will create the necessary tables and seed the initial admin user.
+ * Alternatively, run `php db/run_migrations.php` from the terminal.
+
+3. **Environment Variables:**
+ Ensure your `.env` file (if applicable) contains the necessary mail and AI configuration as described in the system documentation.
+
+4. **Access the Site:**
+ Open your browser and navigate to the project root (e.g., `http://localhost`).
+
+---
+
+## 🔐 Default Credentials (Enterprise Edition)
+
+| Role | Email | Password |
+| :--- | :--- | :--- |
+| **Admin** | `admin@gmail.com` | `12345678` |
+
+---
+
+## 📁 Project Structure
+
+* `index.php` - Enterprise landing page with "Hot Deals" and Hero section.
+* `cars.php` - Marketplace search and listing page.
+* `admin/` - Administrative dashboard and management scripts.
+* `user/` - Registered user dashboard and car submission area.
+* `db/` - Database configuration, setup scripts, and migrations.
+* `includes/` - Reusable UI components (Header, Footer).
+* `assets/` - CSS, JS, and image assets.
+* `mail/` - Integrated mail service logic.
+
+---
+
+## 📄 License & Notes
+
+This project is built for the **Flatlogic LAMP VM**.
+* **Reminder:** Always click **Save** in the Flatlogic editor to sync changes to the platform.
+* **SEO:** Every page is optimized with unique meta titles and descriptions for maximum visibility.
+
+---
+*Last Updated: February 13, 2026*
diff --git a/about.php b/about.php
new file mode 100644
index 0000000..cf81d27
--- /dev/null
+++ b/about.php
@@ -0,0 +1,43 @@
+
+
+
+
+
+
Driving the Future of Afghanistan
+
AFG CARS is the premier destination for buying and selling vehicles in Afghanistan. Founded in 2026, we aim to modernize the automotive market through transparency, technology, and trust.
+
Our platform connects thousands of buyers and sellers across Kabul, Herat, Mazar-i-Sharif, and beyond. Whether you're looking for a luxury SUV or a reliable daily driver, we have the perfect match for you.
+
+
+
+
+
+
+
+
+
+
+
Verified Listings
+
Every car submitted by users goes through a strict approval process by our expert team.
+
+
+
+
+
+
Best Prices
+
We ensure fair market value for both buyers and sellers with our data-driven pricing tools.
+
+
+
+
+
+
National Reach
+
With physical locations and representatives in all major Afghan provinces.
+
+
\ No newline at end of file
diff --git a/contact.php b/contact.php
new file mode 100644
index 0000000..c7096a4
--- /dev/null
+++ b/contact.php
@@ -0,0 +1,74 @@
+
+
+
+
+
+
Get in Touch
+
Have questions about a listing or want to partner with us? Our team is here to help you 24/7.
+
+
+
+
+
+
+
Our Office
+
Main Road, Shar-e-Naw, Kabul, Afghanistan
+
+
+
+
+
+
+
+
+
Phone
+
+93 700 123 456
+
+
+
+
+
+
+
+
+
Email
+
info@afgcars.af
+
+
+
+
+
+
+
Send us a Message
+
+
+
+
+
+
+
diff --git a/db/migrations/2026_02_13_v2_enterprise.sql b/db/migrations/2026_02_13_v2_enterprise.sql
new file mode 100644
index 0000000..33ff5c1
--- /dev/null
+++ b/db/migrations/2026_02_13_v2_enterprise.sql
@@ -0,0 +1,45 @@
+-- Update Users table: add status and possibly other fields if needed
+-- Users already has 'role' ENUM('admin', 'user')
+
+-- Update Cars table
+ALTER TABLE cars ADD COLUMN owner_id INT NULL AFTER id;
+ALTER TABLE cars ADD COLUMN approval_status ENUM('pending', 'approved', 'rejected') DEFAULT 'approved' AFTER status;
+ALTER TABLE cars ADD COLUMN view_count INT DEFAULT 0 AFTER approval_status;
+ALTER TABLE cars ADD COLUMN badge VARCHAR(50) NULL AFTER view_count;
+ALTER TABLE cars ADD CONSTRAINT fk_cars_owner FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE SET NULL;
+
+-- Reviews Table
+CREATE TABLE IF NOT EXISTS reviews (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ user_id INT NOT NULL,
+ car_id INT NOT NULL,
+ rating INT NOT NULL CHECK (rating >= 1 AND rating <= 5),
+ comment TEXT,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY (car_id) REFERENCES cars(id) ON DELETE CASCADE
+) ENGINE=InnoDB;
+
+-- Notifications Table
+CREATE TABLE IF NOT EXISTS notifications (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ user_id INT NULL, -- NULL means it might be for all admins or system-wide
+ message TEXT NOT NULL,
+ type VARCHAR(50) DEFAULT 'info', -- 'new_car', 'new_booking', 'new_purchase'
+ is_read TINYINT(1) DEFAULT 0,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+) ENGINE=InnoDB;
+
+-- Purchases Table (Simulation)
+CREATE TABLE IF NOT EXISTS purchases (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ user_id INT NOT NULL,
+ car_id INT NOT NULL,
+ amount DECIMAL(12, 2) NOT NULL,
+ bank_name VARCHAR(100) NOT NULL,
+ transaction_id VARCHAR(100) NOT NULL,
+ status ENUM('pending', 'completed', 'failed') DEFAULT 'completed',
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY (car_id) REFERENCES cars(id) ON DELETE CASCADE
+) ENGINE=InnoDB;
diff --git a/db/run_migrations.php b/db/run_migrations.php
new file mode 100644
index 0000000..02c9d8c
--- /dev/null
+++ b/db/run_migrations.php
@@ -0,0 +1,18 @@
+exec($sql);
+ echo "Migration executed successfully.\n";
+ } else {
+ echo "Migration file not found.\n";
+ }
+} catch (PDOException $e) {
+ echo "Migration Error: " . $e->getMessage() . "\n";
+}
+
diff --git a/db/setup.php b/db/setup.php
new file mode 100644
index 0000000..c9a676e
--- /dev/null
+++ b/db/setup.php
@@ -0,0 +1,111 @@
+exec("CREATE TABLE IF NOT EXISTS users (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ full_name VARCHAR(100) NOT NULL,
+ email VARCHAR(100) NOT NULL UNIQUE,
+ password VARCHAR(255) NOT NULL,
+ phone VARCHAR(20),
+ role ENUM('admin', 'user') DEFAULT 'user',
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+ ) ENGINE=InnoDB;");
+
+ // Cars Table
+ $pdo->exec("CREATE TABLE IF NOT EXISTS cars (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ title VARCHAR(255) NOT NULL,
+ brand VARCHAR(100) NOT NULL,
+ model VARCHAR(100) NOT NULL,
+ year INT NOT NULL,
+ price DECIMAL(12, 2) NOT NULL,
+ location VARCHAR(100) NOT NULL,
+ fuel_type VARCHAR(50),
+ transmission VARCHAR(50),
+ mileage INT,
+ description TEXT,
+ image_url VARCHAR(255),
+ status ENUM('available', 'sold') DEFAULT 'available',
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+ ) ENGINE=InnoDB;");
+
+ // Bookings Table
+ $pdo->exec("CREATE TABLE IF NOT EXISTS bookings (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ user_id INT NOT NULL,
+ car_id INT NOT NULL,
+ message TEXT,
+ status ENUM('pending', 'confirmed', 'cancelled') DEFAULT 'pending',
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY (car_id) REFERENCES cars(id) ON DELETE CASCADE
+ ) ENGINE=InnoDB;");
+
+ // Favorites Table
+ $pdo->exec("CREATE TABLE IF NOT EXISTS favorites (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ user_id INT NOT NULL,
+ car_id INT NOT NULL,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ UNIQUE KEY user_car (user_id, car_id),
+ FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
+ FOREIGN KEY (car_id) REFERENCES cars(id) ON DELETE CASCADE
+ ) ENGINE=InnoDB;");
+
+ // Create Admin if not exists
+ $adminEmail = 'admin@gmail.com';
+ $stmt = $pdo->prepare("SELECT id FROM users WHERE email = ?");
+ $stmt->execute([$adminEmail]);
+ if (!$stmt->fetch()) {
+ $pass = password_hash('12345678', PASSWORD_DEFAULT);
+ $pdo->prepare("INSERT INTO users (full_name, email, password, role) VALUES (?, ?, ?, ?)")
+ ->execute(['Admin User', $adminEmail, $pass, 'admin']);
+ echo "Admin user created (admin@gmail.com / 12345678)\n";
+ }
+
+ // Insert 20 cars if empty
+ $stmt = $pdo->query("SELECT COUNT(*) FROM cars");
+ if ($stmt->fetchColumn() < 20) {
+ $pdo->exec("SET FOREIGN_KEY_CHECKS = 0");
+ $pdo->exec("TRUNCATE TABLE cars");
+ $pdo->exec("TRUNCATE TABLE bookings");
+ $pdo->exec("TRUNCATE TABLE favorites");
+ $pdo->exec("SET FOREIGN_KEY_CHECKS = 1");
+
+ $sampleCars = [
+ ['Toyota Corolla 2022', 'Toyota', 'Corolla', 2022, 18500, 'Kabul', 'Petrol', 'Automatic', 12000, 'Like new condition, full options.', 'https://images.pexels.com/photos/3311574/pexels-photo-3311574.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Lexus LX570 2018', 'Lexus', 'LX570', 2018, 75000, 'Herat', 'Petrol', 'Automatic', 45000, 'Powerful SUV, VIP interior.', 'https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Mercedes-Benz C300', 'Mercedes-Benz', 'C300', 2020, 32000, 'Mazar-i-Sharif', 'Petrol', 'Automatic', 25000, 'Excellent fuel efficiency and comfort.', 'https://images.pexels.com/photos/120049/pexels-photo-120049.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Toyota Land Cruiser Prado', 'Toyota', 'Prado', 2019, 55000, 'Kabul', 'Diesel', 'Automatic', 30000, 'Perfect for off-road and city driving.', 'https://images.pexels.com/photos/112460/pexels-photo-112460.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Hyundai Elantra', 'Hyundai', 'Elantra', 2021, 21000, 'Kabul', 'Petrol', 'Automatic', 15000, 'Modern design and great fuel economy.', 'https://images.pexels.com/photos/3752162/pexels-photo-3752162.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Kia Sportage', 'Kia', 'Sportage', 2022, 28000, 'Herat', 'Petrol', 'Automatic', 8000, 'Latest model, panoramic sunroof.', 'https://images.pexels.com/photos/358070/pexels-photo-358070.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Toyota Hilux', 'Toyota', 'Hilux', 2020, 35000, 'Kandahar', 'Diesel', 'Manual', 40000, 'Reliable workhorse, 4x4.', 'https://images.pexels.com/photos/1035108/pexels-photo-1035108.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Honda Civic', 'Honda', 'Civic', 2017, 15000, 'Mazar-i-Sharif', 'Petrol', 'Automatic', 60000, 'Sporty look, well maintained.', 'https://images.pexels.com/photos/1149137/pexels-photo-1149137.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Lexus RX350', 'Lexus', 'RX350', 2016, 28000, 'Kabul', 'Petrol', 'Automatic', 75000, 'Luxury SUV, smooth ride.', 'https://images.pexels.com/photos/116675/pexels-photo-116675.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Nissan Patrol', 'Nissan', 'Patrol', 2015, 42000, 'Jalalabad', 'Petrol', 'Automatic', 90000, 'Desert king, powerful V8 engine.', 'https://images.pexels.com/photos/1637859/pexels-photo-1637859.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Toyota Camry 2023', 'Toyota', 'Camry', 2023, 31000, 'Kabul', 'Hybrid', 'Automatic', 5000, 'Eco-friendly and premium comfort.', 'https://images.pexels.com/photos/210019/pexels-photo-210019.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['BMW X5', 'BMW', 'X5', 2018, 45000, 'Kabul', 'Petrol', 'Automatic', 55000, 'High performance and luxury features.', 'https://images.pexels.com/photos/1007410/pexels-photo-1007410.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Ford Mustang', 'Ford', 'Mustang', 2019, 38000, 'Herat', 'Petrol', 'Automatic', 20000, 'Iconic muscle car, head-turner.', 'https://images.pexels.com/photos/337909/pexels-photo-337909.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Volkswagen Golf', 'Volkswagen', 'Golf', 2017, 14000, 'Mazar-i-Sharif', 'Diesel', 'Manual', 85000, 'Compact and efficient daily driver.', 'https://images.pexels.com/photos/1149831/pexels-photo-1149831.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Toyota RAV4', 'Toyota', 'RAV4', 2021, 29000, 'Kabul', 'Hybrid', 'Automatic', 12000, 'Smart SUV for modern lifestyle.', 'https://images.pexels.com/photos/3156482/pexels-photo-3156482.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Mercedes-Benz G-Class', 'Mercedes-Benz', 'G-Wagon', 2020, 180000, 'Kabul', 'Petrol', 'Automatic', 15000, 'Luxury status symbol, armored glass.', 'https://images.pexels.com/photos/100656/pexels-photo-100656.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Hyundai Tucson', 'Hyundai', 'Tucson', 2022, 27500, 'Herat', 'Petrol', 'Automatic', 10000, 'Modern tech and spacious interior.', 'https://images.pexels.com/photos/3972755/pexels-photo-3972755.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Kia Sorento', 'Kia', 'Sorento', 2021, 32000, 'Kabul', 'Diesel', 'Automatic', 18000, '7-seater family SUV, great for long trips.', 'https://images.pexels.com/photos/1149137/pexels-photo-1149137.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Honda Accord', 'Honda', 'Accord', 2018, 19500, 'Mazar-i-Sharif', 'Petrol', 'Automatic', 45000, 'Reliable sedan with premium feel.', 'https://images.pexels.com/photos/3802510/pexels-photo-3802510.jpeg?auto=compress&cs=tinysrgb&w=800'],
+ ['Toyota 4Runner', 'Toyota', '4Runner', 2017, 34000, 'Kabul', 'Petrol', 'Automatic', 70000, 'Legendary reliability, off-road ready.', 'https://images.pexels.com/photos/1592384/pexels-photo-1592384.jpeg?auto=compress&cs=tinysrgb&w=800']
+ ];
+
+ $insert = $pdo->prepare("INSERT INTO cars (title, brand, model, year, price, location, fuel_type, transmission, mileage, description, image_url) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
+ foreach ($sampleCars as $car) {
+ $insert->execute($car);
+ }
+ echo "Database populated with 20 cars.\n";
+ }
+
+} catch (PDOException $e) {
+ die("Database Error: " . $e->getMessage());
+}
diff --git a/favorites.php b/favorites.php
new file mode 100644
index 0000000..d18ce7d
--- /dev/null
+++ b/favorites.php
@@ -0,0 +1,57 @@
+prepare("SELECT c.* FROM cars c JOIN favorites f ON c.id = f.car_id WHERE f.user_id = ?");
+$stmt->execute([$_SESSION['user_id']]);
+$favs = $stmt->fetchAll();
+?>
+
+