Renamed function _split_date, added average age calculation to summary report

This commit is contained in:
2013-10-02 15:29:25 +10:00
parent e135ef9883
commit bb5dc7322e
3 changed files with 54 additions and 33 deletions

View File

@@ -796,12 +796,8 @@ function _booking_validate($node, &$form_state) {
if (strlen(trim($email)) > 0 && !_valid_email_address($email))
form_set_error('booking_email', t('You must enter a valid e-mail address. Please ensure you typed your email address correctly.'));
//calculate DOB limit as defined by configuration
$max_dob_matches = _split_date(variable_get('booking_max_dob','0'));
$max_dob_check= mktime(12, 0, 0, $max_dob_matches[2], $max_dob_matches[3], $max_dob_matches[1]);
//if DOB on form is more recent than DOB limit, display validation error
if ($dob_check > $max_dob_check)
if ($dob_check > _booking_max_dob_ts())
form_set_error('booking_dob', t('Unfortunately you are too young to attend !event.',
array('!event' => variable_get('booking_event_name','this event'))));