================================================================================
  STUDENT SELF-REGISTRATION - DEPLOYMENT CHECKLIST
================================================================================

WHAT IT DOES:
-------------
Students can register themselves WITHOUT admin help!

✓ School-specific URLs (register_student.php?school=KINE)
✓ Multi-step registration form (4 steps)
✓ Email verification
✓ Payment integration (MoMo/Card)
✓ Auto-account creation
✓ Auto-generate username & password
✓ Email/SMS credentials
✓ Parent account creation
✓ Moodle auto-enrollment (optional)
✓ Admin monitoring dashboard

================================================================================
DEPLOYMENT (30 MINUTES):
================================================================================

STEP 1: RUN SQL SCRIPTS (phpMyAdmin)
================================================================================

Login: https://test.melanegroup.com:2083/phpMyAdmin
Database: melane_multi_tenant_skoloi
Tab: SQL

SQL 1: Student Applications Table
----------------------------------
File: database/migrations/create_student_applications_table.sql
Copy, Paste, Go
Expected: 2 tables created (student_applications, student_application_subjects)

SQL 2: School Grades Table
---------------------------
File: database/migrations/create_school_grades_table.sql
Copy, Paste, Go
Expected: school_grades table created

SQL 3: Add Primary Grades
--------------------------
File: database/seeds/add_primary_grades.sql
Copy, Paste, Go
Expected: 4 rows inserted (Grade 4-7)

SQL 4: Add Primary Subjects
----------------------------
File: database/seeds/primary_school_subjects_g4_g7.sql
Copy, Paste, Go
Expected: 48 subjects created

================================================================================
STEP 2: UPLOAD FILES TO cPANEL
================================================================================

cPanel File Manager: Multi-Tanent/

UPLOAD TO ROOT (Multi-Tanent/):
-------------------------------
1. register_student.php - Main registration form
2. verify_registration.php - Email verification
3. payment_for_application.php - Payment processing
4. registration_complete.php - Success page

UPLOAD TO includes/:
--------------------
5. includes/student_account_creator.php - Account creation logic

UPLOAD TO admin/:
-----------------
6. admin/manage_grades.php - Grade selection interface
7. admin/configure_subjects.php - (Already updated, re-upload)

CREATE FOLDER & UPLOAD:
-----------------------
8. Create folder: admin/applications/
9. Upload: admin/applications/list.php - View applications

================================================================================
STEP 3: CONFIGURE YOUR SCHOOL
================================================================================

3.1. SELECT YOUR GRADES
-----------------------
URL: admin/manage_grades.php

Select the grades your school offers:

Example - Combined School:
  ✓ Grade 7
  ✓ Form 1
  ✓ Form 2
  ✓ Form 3

Click: Save Configuration


3.2. CONFIGURE SUBJECTS
------------------------
URL: admin/configure_subjects.php

For each grade:
  - Click grade card
  - Select available subjects
  - Click "Update Subjects"


3.3. ENABLE SELF-REGISTRATION (if not already)
-----------------------------------------------
URL: admin/settings.php

Settings to add (if missing):
  student_self_registration = 1
  subject_fee = 350
  currency_symbol = E
  school_email = info@yourschool.com

================================================================================
STEP 4: SHARE YOUR REGISTRATION LINK
================================================================================

YOUR SCHOOL'S UNIQUE LINK:

https://test.melanegroup.com/Multi-Tanent/register_student.php?school=YOUR_CODE

Replace YOUR_CODE with your academy_reference (e.g., KINE, SCH002, etc.)

SHARE VIA:
----------
✓ School website - Add "Register Now" button
✓ Facebook/Instagram - Post with link
✓ WhatsApp groups - Share in parent groups
✓ Email newsletters - Send to prospective students
✓ SMS campaigns - Text link to parents
✓ QR Codes - Print on posters/flyers
✓ School notice board - Display QR code

EXAMPLE QR CODE TEXT:
---------------------
"Scan to Register for KINE Academy"
https://test.melanegroup.com/Multi-Tanent/register_student.php?school=KINE

================================================================================
STEP 5: TEST THE SYSTEM
================================================================================

TEST 1: Complete Registration Flow
-----------------------------------
1. Visit: register_student.php?school=YOUR_CODE
2. Fill all 4 steps
3. Submit
4. Check email for verification
5. Click verification link
6. Complete payment
7. Receive credentials
8. Login with generated username/password
9. Verify subjects enrolled
10. Check parent can login

Expected: All steps work smoothly!


TEST 2: Admin Monitoring
-------------------------
1. Go to: admin/applications/list.php
2. See your test application
3. Check status: Completed
4. Verify payment recorded
5. Check student created

Expected: Application visible, status correct!


TEST 3: Multi-Step Navigation
------------------------------
1. Start registration
2. Fill Step 1, click Next
3. Fill Step 2, click Next
4. Click Previous, verify data saved
5. Click Next multiple times
6. Submit

Expected: Navigation smooth, data persists!

================================================================================
EXPECTED RESULTS:
================================================================================

STUDENT EXPERIENCE:
-------------------
1. Opens school link
2. Fills form in 5 minutes
3. Receives email instantly
4. Clicks verify link
5. Pays in 2 minutes
6. Account created immediately
7. Receives credentials
8. Can login right away
9. Total time: ~10 minutes

ADMIN EXPERIENCE:
-----------------
1. Shares registration link
2. Students register themselves
3. Admin monitors dashboard
4. See applications in real-time
5. Accounts auto-created
6. NO MANUAL DATA ENTRY!
7. Time saved: Hours per day

================================================================================
MONITORING & ANALYTICS:
================================================================================

View Applications:
  admin/applications/list.php

See Statistics:
  - Total applications
  - Pending verification
  - Verified (awaiting payment)
  - Completed (accounts created)
  - Rejected

Filter by Status:
  - All
  - Submitted
  - Verified
  - Completed
  - Rejected

Export Data:
  - (Future) Download to Excel
  - (Future) Generate reports

================================================================================
ADVANCED FEATURES (Already Included):
================================================================================

✓ Multi-step form (better UX)
✓ Real-time subject loading (AJAX)
✓ Live fee calculation
✓ Progress indicator
✓ Form validation
✓ Email verification (prevents spam)
✓ Auto-username generation (YYYYMMDDNN)
✓ Auto-password generation (secure)
✓ Parent account creation
✓ Parent-student linking
✓ Moodle auto-enrollment
✓ SMS notifications
✓ Printable credentials page
✓ Copy to clipboard
✓ Mobile responsive

================================================================================
SCHOOL-SPECIFIC BRANDING:
================================================================================

Each school's registration page can have:

✓ Custom logo (from settings)
✓ Custom colors (primary & secondary)
✓ School name in header
✓ School-specific pricing
✓ Custom email templates
✓ School contact info

This creates a professional, branded experience!

================================================================================
MULTI-SCHOOL EXAMPLES:
================================================================================

KINE ACADEMY:
URL: register_student.php?school=KINE
Shows: KINE logo, colors, Grade 7 & Form 1-5
Fee: E350/subject

ST. MARY'S PRIMARY:
URL: register_student.php?school=STMARYS
Shows: St. Mary's logo, colors, Grade 4-7
Fee: E400/subject

CITY HIGH SCHOOL:
URL: register_student.php?school=CITY
Shows: City logo, colors, Form 1-5 only
Fee: E300/subject

Each completely independent!

================================================================================
FILES TO UPLOAD (9 FILES):
================================================================================

ROOT FOLDER (Multi-Tanent/):
1. register_student.php
2. verify_registration.php
3. payment_for_application.php
4. registration_complete.php

INCLUDES FOLDER (Multi-Tanent/includes/):
5. student_account_creator.php

ADMIN FOLDER (Multi-Tanent/admin/):
6. manage_grades.php
7. configure_subjects.php (updated)

ADMIN/APPLICATIONS FOLDER (create this folder):
8. Create: admin/applications/ (folder)
9. Upload: admin/applications/list.php

================================================================================
SQL SCRIPTS TO RUN (4 SCRIPTS):
================================================================================

1. database/migrations/create_student_applications_table.sql
2. database/migrations/create_school_grades_table.sql
3. database/seeds/add_primary_grades.sql
4. database/seeds/primary_school_subjects_g4_g7.sql

================================================================================
VERIFICATION:
================================================================================

After deployment, verify:

1. SQL Tables Exist:
   - student_applications ✓
   - student_application_subjects ✓
   - school_grades ✓
   - (48 subjects in subjects table)

2. Files Uploaded:
   - register_student.php accessible
   - Other 8 files uploaded

3. Registration Works:
   - Visit link
   - Submit form
   - Receive email
   - Complete payment
   - Get credentials

4. Admin Can Monitor:
   - See applications list
   - View statistics
   - Check statuses

================================================================================
YOUR REGISTRATION URL:
================================================================================

https://test.melanegroup.com/Multi-Tanent/register_student.php?school=KINE

Change "KINE" to your academy_reference

Share this link with prospective students!

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

READY TO DEPLOY!

Follow the steps above and students can register themselves!

No more manual data entry! 🎉

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

