ini_set('display_errors', 0);
include('classes/fpdf/fpdf.php');
include('classes/fpdi/fpdi.php');
include('classes/phpmailer/class.phpmailer.php');
if ($_POST[action]=="handleform")
{
if ($_POST[q3]=="")
{
$error3 = 1;
}
if ($_POST[q4]=="")
{
$error4 = 1;
}
if ($_POST[q5])
{
if (!preg_match("/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i", $_POST[q5]))
{
$error5 = 1;
}
}
if (!$error3 && !$error4 && !$error5)
{
$q1 = stripslashes($_POST[q1]);
$q1 = iconv('UTF-8', 'windows-1252', $q1);
$q2 = stripslashes($_POST[q2]);
$q2 = iconv('UTF-8', 'windows-1252', $q2);
$q3 = stripslashes($_POST[q3]);
$q3 = iconv('UTF-8', 'windows-1252', $q3);
$q4 = stripslashes($_POST[q4]);
$q4 = iconv('UTF-8', 'windows-1252', $q4);
$q5 = stripslashes($_POST[q5]);
$q5 = iconv('UTF-8', 'windows-1252', $q5);
$q6 = stripslashes($_POST[q6]);
$q6 = iconv('UTF-8', 'windows-1252', $q6);
$q7 = stripslashes($_POST[q7]);
$q7 = iconv('UTF-8', 'windows-1252', $q7);
$q8 = stripslashes($_POST[q8]);
$q8 = iconv('UTF-8', 'windows-1252', $q8);
$q9 = stripslashes($_POST[q9]);
$q9 = iconv('UTF-8', 'windows-1252', $q9);
$q10 = stripslashes($_POST[q10]);
$q10 = iconv('UTF-8', 'windows-1252', $q10);
$q11 = stripslashes($_POST[q11]);
$q11 = iconv('UTF-8', 'windows-1252', $q11);
$q12 = stripslashes($_POST[q12]);
$q12 = iconv('UTF-8', 'windows-1252', $q12);
$q13 = stripslashes($_POST[q13]);
$q13 = iconv('UTF-8', 'windows-1252', $q13);
$q14 = stripslashes($_POST[q14]);
$q14 = iconv('UTF-8', 'windows-1252', $q14);
$q15 = stripslashes($_POST[q15]);
$q15 = iconv('UTF-8', 'windows-1252', $q15);
$q16 = stripslashes($_POST[q16]);
$q16 = iconv('UTF-8', 'windows-1252', $q16);
$q17 = stripslashes($_POST[q17]);
$q17 = iconv('UTF-8', 'windows-1252', $q17);
$q18 = stripslashes($_POST[q18]);
$q18 = iconv('UTF-8', 'windows-1252', $q18);
$pdf = new FPDI();
$source = "docs/storingen.pdf";
$pdf->setSourceFile($source);
$pdf->AddFont('Calibri','','calibri.php');
$pdf->SetFont('Calibri','','11');
$pdf->AddPage();
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 0, 0);
$x = 49;
$y = 41.5;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q1);
if ($q2!="dd/mm/jj")
{
$x = 149;
$y = 41.5;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q2);
}
$x = 49;
$y = 49.7;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q3);
$x = 149;
$y = 49.4;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q4);
$x = 49;
$y = 57.9;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q5);
$x = 72;
$y = 82.5;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q6);
$x = 149;
$y = 82.8;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q7);
if ($_POST[q8]=="man")
{
$x = 72;
$y = 90.4;
}
else
{
$x = 91;
$y = 90.4;
}
$pdf->SetXY($x, $y);
$pdf->Write(0, 'X');
if ($q9!="dd/mm/jj")
{
$x = 149;
$y = 90.4;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q9);
}
$x = 72;
$y = 102;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q10);
$x = 149;
$y = 101.9;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q11);
$x = 72;
$y = 109.2;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q12);
$x = 149;
$y = 109.1;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q13);
$x = 72;
$y = 121.4;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q14);
$x = 165.7;
$y = 121.1;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q15);
$x = 72;
$y = 128.6;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q16);
$x = 72;
$y = 135.9;
$pdf->SetXY($x, $y);
$pdf->Write(0, $q17);
$x = 13.5;
$y = 170.5;
$pdf->SetXY($x, $y);
$pdf->MultiCell('179', '5', $q18, '0', 'L');
if ($_POST[type]=="download")
{
$pdf->Output('storingen.pdf', 'D');
}
elseif ($_POST[type]=="send")
{
$pdf->Output('var/storingen.pdf', 'F');
$text = "";
$text .= "Beste ".$_POST[q3].",
";
$text .= "Bedankt voor het invullen van het storingsformulier op onze website.
";
$text .= "Met vriendelijke groet,
Loket Personenalarmering
";
$text .= "";
$mail = new PHPMailer(true);
$body = $text;
$body = preg_replace('/\\\\/','', $body);
//$mail->IsSMTP();
$mail->Host = "localhost";
$mail->AddReplyTo("info@loketpa.nl","Loket Personenalarmering");
$mail->From = "info@loketpa.nl";
$mail->FromName = "Loket Personenalarmering";
if ($_POST[q5])
{
$mail->addAddress($_POST[q5]);
$to = "storing@loketpa.nl";
$mail->AddBCC($to);
}
else
{
$to = "storing@loketpa.nl";
$mail->addAddress($to);
}
// $to = "bcc@connexx.nl";
// $mail->AddBCC($to);
$mail->AddAttachment('var/storingen.pdf', 'storingen.pdf');
$mail->Subject = "Storingsformulier $_POST[q6]";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->WordWrap = 80;
$mail->MsgHTML($body);
$mail->IsHTML(true);
$mail->Send();
$succes = 1;
}
}
}
?>
Loket Personenalarmering - Storingen
if ($succes=="1") {
?>
}
?>
| |
|
|
|
|
| |
|
if ($succes=="1")
{
?>
Het formulier is succesvol verstuurd! Wij zullen zo spoedig mogelijk uw storing verwerken en beantwoorden.
}
else
{
?>
}
?>
|
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|