# PHP 8.2 Plain Version (Admin Dashboard)

This folder contains a **normal PHP 8.2** conversion of the admin side of the investment script.

## Folder

`admindash`

## What is included

- Plain PHP front controller routing (`public/index.php`)
- No Laravel dependency
- Existing CSS/JS assets preserved:
  - `public/dash`
  - `public/temp`
  - `public/css`
  - `public/js`
  - `public/photos`
- Admin flow:
  - Login / logout
  - Dashboard statistics
  - Investment plans management
  - User management
  - Deposits and withdrawals management
  - Managers/admin accounts management
  - System settings and payment methods
  - Admin profile and password update

## Legacy route compatibility

This conversion keeps aliases for common old Laravel admin URLs, for example:

- `/Admincryptlogin/login` -> `/login`
- `/admin/dashboard` -> `/dashboard`
- `/dashboard/manageusers` -> `/dashboard/users`
- `/dashboard/mdeposits` -> `/dashboard/deposits`
- `/dashboard/mwithdrawals` -> `/dashboard/withdrawals`
- `/dashboard/edit-plan/{id}` -> `/dashboard/plans/{id}/edit`
- `/dashboard/user-details/{id}` -> `/dashboard/users/{id}`

## Run (PHP 8.2)

1. Open terminal in this folder:
   - `cd admindash`
2. Optional: create local `.env` from `.env.example`
3. Start server:
   - `php -S 127.0.0.1:8081 -t public`
4. Open:
   - `http://127.0.0.1:8081`

## Database

This app uses your existing MySQL tables (`admins`, `users`, `settings`, `plans`, `deposits`, `withdrawals`, `wdmethods`, transaction table).

It auto-detects schema differences like:

- `tp__transactions` vs `tp_transactions`
- available columns before insert/update operations

## Notes

- CSRF protection, session auth, flash messages, and password hashing are included.
- Some very advanced Laravel-only admin modules (CRM, KYC workflows, frontend CMS, import/export, 2FA middleware stack) are not fully replicated in this plain-PHP rewrite.

