# 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*