# PHP 8.2 Plain Version (Investment Script)

This folder contains a **normal PHP 8.2** conversion of the core investment user flow from the Laravel project.

## Folder

`php82-investment-script`

## What is included

- Plain PHP front controller routing (`public/index.php`)
- No Laravel dependency
- Existing CSS/JS assets preserved (copied):
  - `public/dash`
  - `public/temp`
  - `public/css`
  - `public/js`
  - `public/photos`
- User investment flow:
  - Home / public pages (`/`, `/about`, `/faq`, `/contact`, `/plan`)
  - Register / login / logout
  - User dashboard
  - Account settings (`/dashboard/account-settings`)
  - Buy investment plan
  - Profit history (`/dashboard/profit-history`, `/dashboard/tradinghistory`)
  - Referral/downline page (`/dashboard/referrals`, `/dashboard/referuser`)
  - Deposit request
  - Withdrawal request
  - Transactions history
  - My plans
  - Referral capture (`/ref/{username}`)

## Run (PHP 8.2)

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

## Database

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

It auto-detects some schema differences (for example `active` vs `activate`, `tp__transactions` vs `tp_transactions`) to keep compatibility.

## Notes

- This conversion focuses on **core user investment usage flow**.
- Full Laravel admin/Jetstream-specific features were not migrated into this plain-PHP version.
- CSRF protection, session auth, flash messages, and password hashing are included.


