RRC Church System - Production Ready Package

ONLINE DEPLOYMENT
- Read DEPLOYMENT.md before uploading.
- Hosting configuration is controlled by RRC_* environment variables; see .env.example.
- Point the domain/subdomain document root to the public folder whenever possible.
- Change the default administrator password immediately after the first login.

DATABASE IMPORT NOTE
- Your uploaded SQL backup has been merged into this ZIP.
- To avoid phpMyAdmin timeout, use: IMPORT_DATABASE_NO_TIMEOUT.bat
- Prepared SQL file: database/latest_import.sql
- Original uploaded SQL kept at: database/source_uploads/rrc_backup_20260306_115724.sql

RRC Church System - Update Pack (Photos + SMS API + Finance Charts + Attendance PDF)

1) Install on XAMPP
- Copy folder to: C:\xampp\htdocs\church_system
- Create DB: rrc_church
- Import: database\rrc_church.sql
- Open: http://localhost/church_system/public/

Default Login:
- Username: admin
- Password: Admin@12345

2) Upgrading an existing installation (keep your old data)
- Import/Run: database\upgrade.sql from phpMyAdmin (SQL tab)

3) Member Photo Upload
- Member registration/edit supports photo upload (JPG/PNG/WebP)
- Files saved to: public\uploads\members\

4) Pastor Photo Upload
- Admin -> Settings -> upload pastor photo
- Shows on login page

5) Bulk SMS (Vodacom) - REAL sending
- Admin -> Settings -> Fill:
  - Base URL / Endpoint
  - API Key / Token
  - Sender ID

The system sends:
POST {Base URL}
Headers:
  Authorization: Bearer {API Key}
  Content-Type: application/json

Body:
{
  "sender": "RRC",
  "message": "...",
  "recipients": ["2557xxxxxxx", ...]
}

If your Vodacom API uses a different payload/headers, send me the API docs and I will adjust.

6) Finance Charts
- Finance page shows Income vs Expenses chart (last 6 months) based on approved transactions.

7) Attendance PDF per service
- Attendance -> PDF button exports the service report.

Update notes - Offering Reports and Language Upgrade:
- The app auto-upgrades the database when it opens.
- New Finance offering sub-types added: Missions Fund Pledge and Monthly Bills.
- These two funds are separate: they are not tithed, not included in 10% calculation, and not used for expense deduction.
- If the auto-upgrade does not run, double-click UPDATE_DATABASE_OFFERING_TYPES.bat while XAMPP MySQL is running.

Update notes - Missions Pledge Fix:
- Missions Fund Pledge now saves one fixed pledge per member.
- When adding a pledge payment for another month, select the member and the saved pledge amount loads automatically.
- Monthly pledge reports now group all payments per member per month. If a member pays more than once in a month, the report shows one monthly total.
- Leaders are listed first in the Missions/Member Offering report.
- The app auto-upgrades the database when it opens. If needed, double-click UPDATE_DATABASE_MISSIONS_PLEDGE_FIX.bat while XAMPP MySQL is running.

Missions Fund Pledge Seed/Mbegu Update
- The app now supports a separate Seed/Mbegu field for Missions Fund Pledge transactions.
- The app auto-upgrades the database when opened. If needed, double-click UPDATE_DATABASE_MISSION_SEED_AMOUNT.bat while XAMPP MySQL is running.
- In Add Transaction, choose Offering > Missions Fund Pledge. The Amount field becomes Pledge Paid Amount, and Seed/Mbegu appears separately.

AUTO BACKUP UPDATE
- The app now creates a full SQL database backup automatically every 3 days.
- Backups are saved inside: church_system/backups
- The automatic backup runs when someone opens/uses the app after the 3-day interval has passed.
- You can also go to Tools and click "Save Backup to App Folder Now" to create a backup immediately.
