BARANGAY PEACE AND INCIDENT MANAGEMENT SYSTEM

SETUP (XAMPP)
1. Install XAMPP and open the XAMPP Control Panel.
2. Start Apache and MySQL. This project is configured for Apache HTTP port 8080.
3. Keep this folder at C:\xampp\htdocs\BPIVMS.
4. Open http://localhost:8080/phpmyadmin.
5. Select Import, choose sql/barangay_db.sql, and click Go.
6. Open http://localhost:8080/BPIVMS/login.php.

STARTING WITH NGROK
1. Install ngrok from https://ngrok.com/download.
2. Authenticate it once with: ngrok config add-authtoken YOUR_TOKEN
3. Place ngrok.exe in this folder or add ngrok to the Windows PATH.
4. Double-click start.bat. Apache, MySQL, and ngrok will start in separate windows.
5. Open the public https URL displayed in the ngrok window, then add /BPIVMS/login.php.
6. Double-click end.bat when finished to stop ngrok, Apache, and MySQL.

The public URL changes each time ngrok starts unless a reserved domain is configured.
Do not expose this development application publicly without changing the default
password and reviewing its security configuration.

FIRST LOGIN
Username: admin
Password: admin123

Change the default password immediately through Change password. Administrators can
create staff accounts from Users, deactivate accounts, and review the Audit log.
Staff can record and edit records, but only administrators can approve, release,
reject, or delete protected records.

DATABASE SETTINGS
XAMPP normally uses the settings already in config.php: host localhost, database
barangay_db, username root, and an empty password. If your MySQL root account has a
password, update DB_PASS in config.php.

MAIN MODULES
- Incidents: searchable blotter reports, status history, printing, and CSV export.
- Transactions: barangay service requests, approval workflow, and printable records.
- Watch schedule: tanod assignments, attendance, conflict checking, and rosters.
- Attendance: date-range reports and scheduled-hour totals.
- Puroks: administrator-managed list used by the watch-shift and volunteer forms.
- Users and Audit log: administrator account control and activity history.

TROUBLESHOOTING
- If the browser cannot connect, confirm Apache is running and use port 8080.
- If the database connection fails, confirm MySQL is running and DB_PASS is correct.
- Do not open PHP files with file://. PHP pages must be opened through Apache.
