This is a PHP script that needs to run nightly on the server via a CHRON job. It should look up boot camp registrations in a MySQL database, pulling only those with a specific field marked with a 1, indicating recurring membership.
It should also look up (same query, different query?) the soonest upcoming 4-week boot camp from another table (camp dates), and compare the start date of that camp (which is in the camp dates table) to the current date.
If the date the script is run is exactly 7 days before the start of the new camp, it should insert a new registration for that camp and client (mirroring the original) into the registrations table.
It should also then increment by 1 a field storing the amount of camps that registration has paid for.
Finally, it should take the amount of money in the paid column of the recurring registration and divide it by the number of camps the registration has paid for, and put this amount into the paid column of the new registration being inserted.