STATE OF CRIME — Dashboard MVP (PHP + MySQL + AJAX)

What this is:
- Login / Register / Lost password (placeholder)
- Post-login dashboard layout (header + left menu + right live stats panel)
- Live status updates via AJAX (api/player_status.php)
- Dashboard feed (recent activity + announcements) via AJAX (api/dashboard_feed.php)
- Simple starter pages for all menu links

SETUP (Quick)
1) Upload this folder to your web root.
2) Create a MySQL database + user.
3) Edit config.php with DB name/user/pass.
4) Run schema.sql in phpMyAdmin.
5) Visit /register.php and create an account.
6) Login at /login.php and you should be taken to the dashboard.

Notes
- This is an MVP scaffold. Next steps are to implement:
  - Crimes logic + logs (activity_log)
  - Messaging UI + compose
  - Admin panel & settings table
  - Password reset email flow

Security
- Passwords are hashed with password_hash()
- APIs require a logged-in session



CRIMES SYSTEM (NEW)
- Run schema.sql again (it is safe; uses IF NOT EXISTS) to create crimes tables and seed starter crimes.
- Go to /crimes.php while logged in.
- Click "Commit Crime" to roll success/failure:
  - Success gives money + points and logs activity.
  - Failure reduces health and logs activity.
- Cooldowns are tracked per crime per user.


RANK/POINTS SUCCESS MODIFIERS + JAIL TIMERS (NEW)
- Crime success chance is now: base_rate + rank_bonus + points_bonus
  - points_bonus = +1% per 25 points (cap +10%)
  - effective chance is capped between 5% and 95%
- On failure, crimes can send you to jail depending on each crime's jail_chance/jail_seconds.
- While in jail, committing crimes is disabled and the right status panel shows a timer.

IMPORTANT
- Run schema.sql again to apply the new columns (rank_bonus, jail_until, crime jail settings).
  (If your host blocks ALTER TABLE when it already exists, run the ALTER parts manually in phpMyAdmin.)



JAIL PAGE + HOSPITAL TIMERS + UPGRADES + CAR THEFT (NEW)
- Run schema.sql again to add:
  - hospital_until (user_stats)
  - upgrades + user_upgrades
  - car_thefts + cooldown table
- New pages:
  - /jail.php (bribe or bust-out)
  - /hospital.php (pay doctor to leave)
  - /upgrades.php (buy Street Smarts / Driver Skill)
  - /car_theft.php (fully working car theft system)



QUALITY OF LIFE (NEW)
- Auto-redirect: if you're in jail/hospital and click Crimes/Car Theft/Organised Crime, you'll be redirected to the relevant page.
- Jail/Hospital actions now work via AJAX (buttons do not need full page reload).
  - Endpoints: /api/jail_action.php and /api/hospital_action.php

ORGANISED CRIME (MVP)
- Run schema.sql again to create organised crime tables + seed jobs.
- Visit /organised_crime.php and join a crew.
- When crew is full, a countdown starts and the job resolves automatically (resolved on page refresh/poll).
- Rewards/points are split across members; failure may send members to jail/hospital.
- Cooldowns apply per organised crime per user.


PLAYERS ONLINE + PROFILES (NEW)
- Run schema.sql again to add users.last_active + users.bio.
- The game pings /api/ping.php every ~25 seconds to keep you "online".
- Players Online page: /players_online.php
- Click a player to view their profile: /profile.php?u=ID
- You can edit your own bio on your profile.


MESSAGING (NEW)
- Import schema.sql (fresh) to create the messages table.
- Inbox: /inbox.php
- Compose: /compose.php
- Read: /read_message.php?id=123
