News:

Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

php 5.3.0

Started by Speedline Z, February 05, 2012, 06:56:30 PM

Previous topic - Next topic

Speedline Z

Any plans to upgrade plesk5 from php 5.2.17 to 5.3 ? .. I'd like to be able to use the datetime date_add() function if possible.

what im doing is
$mininductdate = new DateTime($initiationdate);
 $maxinductdate = new DateTime($initiationdate);
 $mininductdate->add(new DateInterval('P26D'));
 $maxinductdate->add(new DateInterval('P35D'));
 if($mininductdate < $inductiondate || $inductiondate > $maxinductdate)
 {
   printf('Submission failed: The Induction Date is not within 7 days of 30 days after Initiation date.<br>');
$indfail=1;
 }


The user provides the Initiation Date and Induction date.  The script checks to see if the induction date is 26 days to 35 days after the initiation date.

admin

There are no plans to upgrade the current systems at this time.

Is this something stored in a database table?  You can always use the SQL dateadd function if so.

Quote from: Speedline Z on February 05, 2012, 06:56:30 PM
Any plans to upgrade plesk5 from php 5.2.17 to 5.3 ? .. I'd like to be able to use the datetime date_add() function if possible.

what im doing is
$mininductdate = new DateTime($initiationdate);
 $maxinductdate = new DateTime($initiationdate);
 $mininductdate->add(new DateInterval('P26D'));
 $maxinductdate->add(new DateInterval('P35D'));
 if($mininductdate < $inductiondate || $inductiondate > $maxinductdate)
 {
   printf('Submission failed: The Induction Date is not within 7 days of 30 days after Initiation date.<br>');
$indfail=1;
 }


The user provides the Initiation Date and Induction date.  The script checks to see if the induction date is 26 days to 35 days after the initiation date.

Speedline Z

#2
No.  the information is supplied by the user, and the page error checks to make sure the dates are valid before submitting them to the database.

I'll poke around and see if i can find another way to validate the dates...

EDIT: i found a solution


          $mininductdate = new DateTime($initiationdate);
  $maxinductdate = new DateTime($initiationdate);
  $checkinductdate = new DateTime($inductiondate);
  $mininductdate->modify('+26 days');
  $maxinductdate->modify('+35 days');
  if($mininductdate > $checkinductdate || $checkinductdate > $maxinductdate)
  {
    printf('Submission failed: The Induction Date is not within 7 days of 30 days after Initiation date.<br>');
$indfail=1;
  }


This works correctly.