# Safety Incident Reporting System (PHP + PDO + jQuery)

## 1) Requirements
- PHP 8.0+
- MySQL 5.7+ / MariaDB 10+
- Web server (Apache/Nginx) or `php -S`
- `file_uploads` enabled in php.ini

## 2) Setup
1. Create a database/schema (example: `safety_schema`)
2. Import schema:
   - Run `schema.sql` in your DB tool.
3. Update DB credentials in `config.php`:
   - host, port, name, user, pass

## 3) Run locally (quick)
From the project root:

```bash
php -S 127.0.0.1:8080 -t public
```

Then open:
- `http://127.0.0.1:8080/`

## 4) Demo accounts
This build ships with seed users (see `schema.sql`):
- Admin: `admin@example.com`
- End User: `user@example.com`

There is **no password/auth** in this conversion (to keep it plain PHP/JS).
Use the sidebar **demo switch** to swap session role.

## 5) Uploads
- Files are stored in `uploads/`
- Allowed: jpg, jpeg, png, webp, pdf
- Max size: 10MB (configurable in `config.php`)

## 6) Notes
- All data operations use PDO prepared statements.
- SQL joins are written in classic `FROM a, b WHERE a.id=b.id` style where possible.
