BGI HRMS Payroll & Attendance - Phase 6 ======================================= Purpose: Phase 6 is the final integration and maintenance layer for Phase 1 to Phase 5. It does not replace previous modules. It connects them with settings, role access, menu links, health checks, data integrity checks, backup logs, and maintenance cron. This patch adds: 1. HRMS Settings Center 2. Standard HRMS Menu Installer 3. Role Permission Matrix 4. All Phase Health Check 5. Data Integrity Scan 6. Backup / Maintenance Helper 7. Final Report Center 8. API Health Check Endpoint 9. Nightly Maintenance Cron 10. Responsive Phase 6 UI CSS Important files: - phase6_schema.sql - admin/hrms/_phase6_functions.php - admin/hrms/phase6_dashboard.php - admin/hrms/settings_center.php - admin/hrms/menu_installer.php - admin/hrms/role_permissions.php - admin/hrms/health_check.php - admin/hrms/data_integrity.php - admin/hrms/backup_restore.php - admin/hrms/final_report_center.php - api/hrms/health_check.php - cron/hrms_phase6_nightly_maintenance.php - assets/hrms/phase6.css Installation: 1. Phase 1 to Phase 5 should already be installed. 2. Take full file and database backup. 3. Import phase6_schema.sql in the database. 4. Upload the folders into your project root. 5. Open: admin/hrms/phase6_dashboard.php 6. Run Health Check. 7. Open Menu Installer and click Install / Refresh HRMS Menu. 8. Open Role Permissions and click Seed Default Role Permissions. 9. Open Settings Center and confirm payroll year, biometric mode and alerts. 10. Run Data Integrity Scan. Recommended cron: php cron/hrms_phase6_nightly_maintenance.php API health check: api/hrms/health_check.php Optional token: Add setting key hrms_api_health_token in hr_settings if you want token based API health check. Example URL: api/hrms/health_check.php?token=YOUR_TOKEN Production note: The backup helper creates a basic SQL backup for HRMS tables only. For full production backup always use cPanel/WHM backup or mysqldump also. Permission helper: Use this function at the top of sensitive pages if needed: require_once __DIR__ . '/_phase6_functions.php'; hrms_phase6_guard_permission('hrms_salary_process', 'edit'); Menu helper: The menu installer writes to hr_module_menu. If your existing ERP uses another table like admin_menu or role_menu, copy the SQL template shown on menu_installer.php.