SEC-08A · Section 8: Prayer Times Management✓ Fully Implemented
Mosque Prayer Time Zone Configuration & Daily/Monthly Display (/mosque-admin/prayer & /prayer-times)
How to select a mosque’s official JAKIM prayer time zone, trigger schedule synchronization, view daily and monthly prayer times, and distinguish external JAKIM e-Solat data from manual configuration.
Purpose of FunctionEnsure every registered mosque displays authoritative JAKIM e-Solat prayer times for its exact geographical zone.
PrerequisitesSigned in as `mosque_admin` for `/mosque-admin/prayer`; `/prayer-times` is publicly accessible.
Required User PermissionsMosque Scope: mosque.manage (/mosque-admin/prayer) | Public Access (/prayer-times)
1. Selecting & Updating the Mosque Prayer Time Zone (/mosque-admin/prayer)
Sign in as a Mosque Administrator and open /{lang}/mosque-admin/prayer.
Review the suggested official JAKIM zone for your mosque’s State and District.
Select the appropriate zone in the Official Prayer Zone dropdown (prayer_zone_id). The server validates that the selected zone belongs to the mosque’s state.
Click Save. The system updates mosques.prayer_zone_id and immediately synchronizes today’s and the current month’s schedules from JAKIM e-Solat.
2. Displaying Daily & Monthly Prayer Times (/prayer-times & Microsite)
Seven Daily Times: Displays Imsak, Subuh, Syuruk, Zohor, Asar, Maghrib, and Isyak along with Gregorian and Hijri dates.
Live Next-Prayer Highlight & Countdown:public/assets/js/prayer.js highlights the upcoming prayer card and runs a live countdown timer in Asia/Kuala_Lumpur time.
Monthly Schedule Table: Both /prayer-times and /mosque-admin/prayer display the full calendar month table.
3. External JAKIM e-Solat Data vs. Manual Configuration
Important Distinction: All prayer timestamps (Imsak through Isyak) and Hijri dates are retrieved exclusively from the official external JAKIM e-Solat API (https://www.e-solat.gov.my/). Mosque and platform administrators only configure the Official Zone Assignment (prayer_zone_id); manual entry or manual overriding of individual prayer times is intentionally prohibited.
Mosque Prayer Zone Configuration (/mosque-admin/prayer) and Daily/Monthly Prayer Schedule (/prayer-times).
Input Fields & Options Reference
Field / Action
Screen
Description
prayer_zone_id
/mosque-admin/prayer, /mosque-admin/profile
Verified JAKIM zone matching the mosque’s state.
action=sync
/mosque-admin/prayer
Triggers an immediate daily and monthly sync for the mosque’s assigned zone.
Expected Results: The mosque’s prayer zone is saved and official daily/monthly prayer times are rendered on the microsite and `/prayer-times`.
Important Notes & Data Boundaries: Every prayer sync operation records its status and HTTP code in `prayer_sync_logs`.
Common Errors & Troubleshooting
If saving a zone fails with a state mismatch error, ensure the mosque’s State in /mosque-admin/profile matches the state of the chosen JAKIM zone.
SEC-08B · Section 8: Prayer Times Management✓ Fully Implemented
Automatic Prayer Time Sync, JAKIM e-Solat Source & Troubleshooting (/admin/prayer-times)
Technical and operational guide to automatic prayer time synchronization, the /admin/prayer-times administration console, CLI prayer-sync command, and troubleshooting missing times or API failures.
Purpose of FunctionHelp Platform and Mosque Administrators keep prayer schedules up to date and diagnose synchronization or network errors.
PrerequisitesGlobal `mosques.manage` permission for `/admin/prayer-times` or server CLI access for `php database/manage.php prayer-sync`.
Required User PermissionsGlobal Scope: mosques.manage (/admin/prayer-times) or CLI prayer-sync
1. Official Prayer Time Source (JAKIM e-Solat)
Kariahku.com retrieves prayer times exclusively from the official JAKIM e-Solat endpoint:
Security & Validation: Enforces TLS certificate verification (`CURLOPT_SSL_VERIFYPEER = true`), a 12-second timeout, and strict `HH:MM` timestamp validation for all 7 prayer times before writing to `prayer_times`.
Automatic On-Demand Sync: Whenever a visitor opens `/prayer-times` or a mosque microsite and today’s schedule for that zone is not yet cached in `prayer_times`, `prayer_day_schedule()` automatically fetches today’s and the current month’s schedule from JAKIM e-Solat.
Platform Admin Console (/admin/prayer-times):
Open /{lang}/admin/prayer-times.
Click Sync All Active Zones to refresh all 60 verified JAKIM zones, or select an individual zone and click Sync Zone.
Scheduled CLI Command (Cron / Task Scheduler):
php database/manage.php prayer-sync
3. Troubleshooting Missing Prayer Times & API Failures
Case 1 — Mosque Has No Zone Assigned: The microsite displays a configuration notice. Remedy: Assign an official zone in /mosque-admin/prayer.
Case 2 — Temporary JAKIM e-Solat Outage: If live synchronization fails, `prayer_day_schedule()` falls back to the most recent cached schedule for that zone in `prayer_times` and displays an explicit Stale Schedule Warning indicating the cached date.
Case 3 — Inspecting Sync Failures: Open /admin/prayer-times and review the Recent Synchronization Logs table (`prayer_sync_logs`) to check the `http_code` and `error_message`.
Platform JAKIM e-Solat Prayer Time Synchronization Console & Sync Logs (/admin/prayer-times).
Input Fields & Options Reference
prayer_sync_logs Column
Description
period_type
Sync scope: today, month, or catalogue.
status
success or failed.
records_written
Number of daily rows inserted/updated in prayer_times.
http_code & error_message
HTTP status code returned by e-Solat and diagnostic error message.
Expected Results: Prayer schedules across all 60 official JAKIM zones remain synchronized and resilient against temporary upstream outages.
Important Notes & Data Boundaries: The 60 official JAKIM prayer zones are seeded via `database/seeds/006_prayer_zones.php`.
Common Errors & Troubleshooting
If CLI or web sync fails with a cURL SSL certificate error on Windows/XAMPP, verify that curl.cainfo in php.ini points to a valid cacert.pem bundle and that outbound HTTPS to www.e-solat.gov.my is permitted.