Copy link to clipboard
Copied
I have completed a customer record system that uses PHP and MySQL (within Dreamweaver 5.5), however i am having difficulty working out how to establish a warning system from the end of a contract.
1. The customer can have a contract of 1 - 5 years (int)
2. The contract start date and created date is stored in the database (date)
3. The notification needs to be 3 months (or 90 days) before the end of the contract.
4. a final balloon payment is required to be paid to finalise the contract or the customer can extend the contract.
5. an email notification becomes available 90 days b4 the end of contract (finally enabling a click of a link to send an email to discuss extending the contract, from the customers email details stored in the database)
6. once the email is sent there needs to be a flag that will say that the email does not need to be displayed anymore.
Does anyone have any suggestion how to go about doing this or even point me to articles that may help, as i have tried looking in various places (to no avail).
Many thanks
Al
Copy link to clipboard
Copied
You'll need to setup a cron job for this. Many shared hosting plans now come with crontab capabilities - I think
http://wiki.dreamhost.com/Run_php_from_cron
5. an email notification becomes available 90 days b4 the end of contract
The cron job will execute a PHP script that queries the database for records that fall within this date range and do not have the flag set. The script will then send emails.
6. once the email is sent there needs to be a flag that will say that the email does not need to be displayed anymore.
Once the emails are sucessfully sent, the script will run an update statement setting the flags to true.
Copy link to clipboard
Copied
Is there a way of doing this programmatically? Say using php.
Copy link to clipboard
Copied
Something has to kick off the script right? That's why you need a scheduled cron job.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more