­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ # LeadCRM (PHP + MySQL) – Mobile-friendly, Arabic/English This is a **minimal but complete** MVP implementation of the Lead → Contact → Opportunity workflow you described, built in **plain PHP 8** (no framework) with: - **Bootstrap 5** responsive UI (mobile-first) + RTL when Arabic - **RBAC** (roles + permissions) - **Contacts unique by mobile** - **Leads** with first-view timestamp, locked updates until successful contact, qualification/disqualification - **Opportunities** created from qualified leads, branch scoping, assignment, locked updates until contacted - **Activity logs** for every important action - **SMS Outbox** queue (stores messages; integrate provider later) > This is an MVP scaffold. You can extend it with richer dashboards, more report exports, file uploads, etc. ## Requirements - PHP 8.1+ (PDO enabled) - MySQL 8+ - Web server (Apache/Nginx) OR PHP built-in server ## Setup 1) Create a MySQL database, e.g. `leadcrm` 2) Import schema: - `database/schema.sql` 3) Configure DB: - copy `app/config.sample.php` to `app/config.php` and edit credentials 4) Run local server: ```bash php -S 127.0.0.1:8000 -t public ``` 5) Open: - http://127.0.0.1:8000 ## Default accounts (password: `Password@123`) - Admin: `admin@example.com` - Marketing: `marketing@example.com` - Call Center Supervisor: `ccsup@example.com` - Call Center Agent: `ccagent@example.com` - Branch Manager (Riyadh): `brmgr@example.com` - Branch Agent (Riyadh): `bragent@example.com` - Sales Manager: `salesmgr@example.com` - GM Sales: `gmsales@example.com` ## Language Use the 🌐 button in the top navbar to switch EN/AR. Arabic UI uses RTL automatically. ## Notes - SMS is stored in `sms_outbox` as **queued**. Add a worker/cron later to send through your provider. - All critical actions log into `activity_logs`.