Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP date problem within Dreamweaver 5.5

New Here ,
Oct 19, 2011 Oct 19, 2011

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

TOPICS
Server side applications
679
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 19, 2011 Oct 19, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 25, 2011 Oct 25, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2011 Oct 25, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines