====================================================
 FAMILY WEEK 2026 — COUPLE PROGRAMME
 Registration System · Deployment Guide
====================================================

FILES IN THIS PACKAGE
─────────────────────
  index.html   — Public registration form
  process.php  — Form submission handler
  admin.php    — Password-protected admin dashboard
  config.php   — Database & settings configuration
  README.txt   — This file

====================================================
 STEP 1: CREATE A MYSQL DATABASE (cPanel)
====================================================

1. Log into your cPanel.
2. Go to: Databases → MySQL Databases
3. Under "Create New Database", type a name e.g.:
      familyweek
   Then click [Create Database].

4. Under "MySQL Users" → "Add New User":
      Username: fw_admin
      Password: [choose a strong password]
   Click [Create User].

5. Under "Add User To Database":
      Select the user and the database you just created.
   Click [Add]. When the privileges screen appears, tick
   [ALL PRIVILEGES] and click [Make Changes].

6. Note down:
      Database name:   cpanelusername_familyweek
      Database user:   cpanelusername_fw_admin
      Password:        [what you set]
      Host:            localhost

====================================================
 STEP 2: CONFIGURE config.php
====================================================

Open config.php and update these lines:

  define('DB_NAME', 'cpanelusername_familyweek');
  define('DB_USER', 'cpanelusername_fw_admin');
  define('DB_PASS', 'your_password_here');

Also update:

  define('ADMIN_PASSWORD', 'ChooseAStrongPassword!');
  define('CHURCH_NAME', 'Your Church Name');

The database TABLE is created automatically on first
form submission — you do not need to run any SQL.

====================================================
 STEP 3: UPLOAD TO cPanel
====================================================

1. In cPanel, open File Manager.
2. Navigate to: public_html
   (or a subfolder, e.g. public_html/family-week/)
3. Upload ALL files from this package:
      index.html
      process.php
      admin.php
      config.php

If placing in a subfolder, the URLs become:
  Form:  https://yourdomain.com/family-week/
  Admin: https://yourdomain.com/family-week/admin.php

====================================================
 STEP 4: TEST
====================================================

1. Visit your form URL and submit a test entry.
2. Visit admin.php and log in with ADMIN_PASSWORD.
3. Confirm the test entry appears in the dashboard.
4. Use the [Export CSV] button to download all records.
5. Delete the test entry from the admin panel.

====================================================
 ADMIN PANEL FEATURES
====================================================

  • Password protected login
  • Live registrant count & days-to-event counter
  • Search by name, email, or phone
  • Paginated table (25 per page)
  • One-click CSV export (for Excel)
  • Delete individual records
  • Direct link to the registration form

====================================================
 SECURITY NOTES
====================================================

• Change ADMIN_PASSWORD to something strong before
  going live. Never use the default value.
• config.php does NOT need to be publicly accessible.
  It is included server-side only.
• The form prevents duplicate email registrations.
• All inputs are sanitized before database insertion.

====================================================
 SUPPORT
====================================================

If you encounter any issues:
  • Check that PHP 7.4+ is active on your hosting.
  • Confirm the database credentials are correct.
  • Ensure the cPanel user has MySQL privileges.

====================================================
