FORMULA

Questions and bug reports for current release of CKForms

FORMULA

Postby SPABO » Wed Mar 31, 2010 5:34 pm

I would like to knowe if it would be possible to include a formula in a form

The formula is based on comparing dates/times etc

It should calculate

Currente date/time with the dat choosen in a selectbox

Fieldname : Wedstrijddatum

Pls find the script
Code: Select all
function getTime($time)
{
$arr = explode("-", $time);
$time = mktime(0,0,0,$arr[1], $arr[0], $arr[2]);
return $time;
}


$date1 = getTime($_POST['Wedstrijddatum']);
$date2 = getTime(date("d-m-y"));

if((($date1-$date2))>28*3600*24) {
$ok = false;
        $error .= '- U bent te vroeg met inschrijven!.<br />';

   }

if((($date1-$date2))<6*3600*24) {
   $ok = false;
        $error .= '- U bent te laat met inschrijven!.<br />';
SPABO
 
Posts: 5
Joined: Wed Mar 31, 2010 5:27 pm
Top

Return to CKForms 1.3.x Support forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron