Enrollment

Enroll in the course 

This page will...

This is an example of how pages link to this page:
<a href="enroll.html?id=First902">Writing Audit Reports</a>
 

  1. Obtain course title from the id parameter
  2. Look up title in SQLite3 database table Courses
  3. Retrieve description (text) and status (number)
  4. If status=0, course is pending (not yet available); add 1 to number of people interested and exit enrollment
  5. If status=1, course is available; proceed with enrollment
  6. Allow user to resume course already started. Prompt for email address
  7. Look up email in SQLite3 db table Enrolled
  8. If found, check current date is <= expiry date. If not expired, look up current screen number for user's email in table Progress; return user to that screen & exit enrollment.
  9. If user's access has expired, continue with new enrollment.
  10. Wait (5 minutes) for user to enter first name, cell phone & press Submit
  11. If no response within 5 minutes, give error message and exit enrollment
  12. Generate One Time Passcode (OTP) & send to user's cell phone
  13. Wait (15 minutes) for user to submit correct OTP
  14. If no response within 15 minutes, give error message and exit enrollment
  15. Display price, based on title. If title[5]=9, price is $35 else price is $15
    nb: in JS arrays are 0-based, so [5] is 6th char
  16. Wait for user to press Checkout
  17. Start PayPal | Stripe process - unsure how to do this
    AdMark will set up each process at USD $350
  18. Wait (15 minutes) for user to complete payment for the course price
  19. If user leaves or payment declined, give error message and exit enrollment
  20. Update table Enrolled with email, title and expiry date (10 days hence);
    create entry in table Progress for user's email with course & start screen number (0% progress), and expiry date
  21. Send receipt to user's email with date, title and price

As user progresses through the course, update table Progress with current screen number.
When user completes the course, update table History with email, title, date; and delete record from table Progress. Send notice to user's email congratulating them on completing the course.
Periodically purge records from table Progress where today > expiry date.

Nice to have user dashboard from tables History and Progress.