Skip to main content
Participant
October 19, 2011
Question

PHP date problem within Dreamweaver 5.5

  • October 19, 2011
  • 1 reply
  • 678 views

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

This topic has been closed for replies.

1 reply

Participating Frequently
October 20, 2011

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.

neoxeon1Author
Participant
October 25, 2011

Is there a way of doing this programmatically? Say using php.

Participating Frequently
October 25, 2011

Something has to kick off the script right? That's why you need a scheduled cron job.