Validate Email + Birthday by Form
Set an default, is not set or is false - for entries in the CMS via httpPost git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3406 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
0534a887cf
commit
bea8145faf
8 changed files with 36 additions and 11 deletions
|
|
@ -898,11 +898,16 @@ class TravelBooking
|
|||
for ($i = 0; $i < count($travelers); ++$i)
|
||||
{
|
||||
$traveler = $travelers[$i];
|
||||
|
||||
$birthdate = $traveler->getBirthDate();
|
||||
if(!strtotime($birthdate)){
|
||||
$birthdate = '01.01.1900';
|
||||
}
|
||||
$participants[''. ($i+1)] = [
|
||||
'gender' => $traveler->getSex(),
|
||||
'first_name' => $traveler->getFirstName(),
|
||||
'last_name' => $traveler->getLastName(),
|
||||
'birthday' => $traveler->getBirthDate()
|
||||
'birthday' => $birthdate,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -930,6 +935,9 @@ class TravelBooking
|
|||
$traveler->setSex(intval($participant['gender']));
|
||||
$traveler->setFirstName($participant['first_name']);
|
||||
$traveler->setLastName($participant['last_name']);
|
||||
if(!strtotime($participant['birthday'])){
|
||||
$participant['birthday'] = '01.01.1900';
|
||||
}
|
||||
$traveler->setBirthDate(\DateTime::createFromFormat('d.m.Y', $participant['birthday']));
|
||||
$ret[] = $traveler;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue