$dtsplit = explode($oForm->getFormFieldValue(FORM_NAME_DATE_FROM), "/");
$dtstamp = mktime(0,0,0,$dtsplit[1],$dtsplit[0],$dtsplit[2]);
if (($oForm->getFormFieldValue('DateMonths') != "") && ($oForm->getFormFieldValue('PolicyType') == "Gold")) {
$months = $oForm->getFormFieldValue('DateMonths');
settype($months, "int");
$seconds = $months * 30 * 24 * 60 * 60;
$newdate = date("d/m/Y", ($dtstamp + $seconds));
} elseif (($oForm->getFormFieldValue('PolicyType') == "Gold") && ($oForm->getFormFieldValue('DateMonths') == "")) {
$seconds = 60 * 24 * 60 * 60;
$newdate = date("d/m/Y", ($dtstamp + $seconds));
} elseif ($oForm->getFormFieldValue('PolicyType') == "Single") {
$newdate = $oForm->getFormFieldValue('DateTo');
} elseif ($oForm->getFormFieldValue('PolicyType') == "Classic") {
$seconds = 35 * 24 * 60 * 60;
$newdate = date("d/m/Y", ($dtstamp + $seconds));
}
$aHeaders = array(
'Schedule' => $oForm->getFormFieldValue('Schedule'),
'PolicyType' => $oForm->getFormFieldValue('PolicyType'),
'DateOfProposal' => date("d/m/Y"),
'PrincipalDOB' => $oForm->getFormFieldValue('PrincipalDOB'),
'FirstName' => $oForm->getFormFieldValue('Forenames'),
'Surname' => $oForm->getFormFieldValue('Surname'),
'Address' => $oForm->getFormFieldValue('DeliveryAddress'),
'Town' => false,
'County' => false,
'PostCode' => $oForm->getFormFieldValue('DeliveryPostCode'),
'Telephone' => $oForm->getFormFieldValue('ContactNumber'),
'Email' => $oForm->getFormFieldValue('CustomerEmail'),
'InsuranceFrom' => $oForm->getFormFieldValue(FORM_NAME_DATE_FROM),
'InsuranceTo' => $newdate,
'InsuranceToInMonths' => $oForm->getFormFieldValue('DateMonths'),
'60DayStandard' => $oForm->getFormFieldValue(FORM_NAME_DATE_STANDARD),
'YachtsmanArea' => $oForm->getFormFieldValue('YachtsmanArea'),
'MaterialFacts' => $oForm->getFormFieldValue('OtherInfo'),
'AgentCode' => $oForm->getFormFieldValue('AgentCode'),
'DatePaid' => false,
'Forenames' => false,
'voyref' => false,
'VoyageNumber' => $oForm->getFormFieldValue('VoyageNumber')
);