Contents

 
Home
PHPRunner 6.0 manual
Prev Page Next Page
 
 

Check if start date is earlier than end date

 

On the Edit page verify that the start date is earlier than the end date. Use the following code in the Edit page: Before record updated event.

yellowbulbNote: Change the values listed in red to match your specific needs.

//split into an array (year,month,day,hour,minute,second)

$arr = db2time($values["start_date"]);

  //convert to datetime

$start = mktime($arr[3],$arr[4],$arr[5],$arr[1],$arr[2],$arr[0]);

 

  //split into an array (year,month,day,hour,minute,second)

$arr = db2time($values["end_date"]);

$end = mktime($arr[3],$arr[4],$arr[5],$arr[1],$arr[2],$arr[0]);

if ($end<$start)

{

  $message = "Error";

  return false;

}

else

{

  return true;

}

Converted from CHM to HTML with chm2web Standard 2.85 (unicode)