This topic is locked

Verify dates

3/14/2006 6:51:33 AM
PHPRunner General questions
D
diego author

Olá list,


ok my 2 functions to verify the first and final date of week works perfect
has another doubt.

as to verify in the hour to save if the initial date it cannot be bigger that the final date.

it dates2.
This is possible?

Thanks for all.

forgives me my bad english i from brazil.

Sergey Kornilov admin 3/14/2006

Diego,
you can do it using events.

Please see example code in Help for PHPRunner.

D
diego author 3/15/2006

I need this function on add page your code works perfect on edit page

on add page it not works for me

thanks

Sergey Kornilov admin 3/15/2006

Diego,
please clarify what doesn't work on the ADD page.

D
diego author 3/15/2006

I need,

as to verify in the hour to save if the initial date it cannot be bigger that the final date.

it´s on add page

your code on phprunner help works perfect on edit page i need it on add page
Thank´s amigo

Sergey Kornilov admin 3/16/2006

Diego,
please ensure that your event code looks like:

function BeforeAdd(&$values)

{

$str = substr($values["DataInicial"],1,strlen($values["DataInicial"])-2);

$arr = db2time($str);

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

$str = substr($values["DataFinal"],1,strlen($values["DataFinal"])-2);

$arr = db2time($str);

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

if ($end<$start)

{

echo "Error: start date bigger then end date";

return false;

}

else

return true;

}

D
diego author 3/16/2006

Thank´s amigo you is the best

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=8588&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />