$row_get_termin[datum_form]
| Nr. | Name | Sitzplatz | Anwesend |
| $lfdnr | $row1[nachname], $row1[vorname] | $platz |
| A | B | C | D | E | F | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| A1 |
Klavier $A1A |
$A1B | $A1C | $A1D | $A1E | $A1F | ||||
| K1 | $K1A | $K1B | $K1C | $K1D | $K1E | $K1F | K1 | |||
| K2 | $K2A | $K2B | $K2C | $K2D | $K2E | $K2F | K2 | |||
| K3 | $K3A | $K3B | $K3C | $K3D | $K3E | $K3F | K3 | |||
| K4 | $K4A | $K4B | $K4C | $K4D | $K4E | $K4F | K4 | |||
| K5 | $K5A | $K5B | $K5C | $K5D | $K5E | $K5F | K5 | |||
| K6 | $K6A | $K6B | $K6C | $K6D | $K6E | $K6F | K6 | |||
| K7 | $K7A | $K7B | $K7C | $K7D | $K7E | $K7F | K7 | |||
| K8 | $K8A | $K8B | $K8C | $K8D | $K8E | $K8F | K8 | |||
| K9 | $K9A | $K9B | $K9C | $K9D | $K9E | $K9F | K9 | |||
| $K10D | $K10E | $K10F | K10 | |||||||
| K10 | $K10A | $K10B | $K10C | |||||||
| D1 | $D1E | D1 | ||||||||
| M1 | $M1A | $M1B | $M1C | |||||||
| F1 | $F1A | $F1B | $F1C | |||||||
| E1 | $E1A | $E1B | $E1C | $E1D | $E1E | $E1F | E1 | |||
| E2 | $E2A | $E2B | $E2C | $E2D | $E2E | $E2F | E2 | |||
| E3 | $E3A | $E3B | $E3C | $E3D | $E3E | $E3F | E3 | |||
| E4 | $E4A | $E4B | $E4C | $E4D | $E4E | $E4F | E4 | |||
| E5 | $E5A | $E5B | $E5C | |||||||
| $E5D | $E5E | $E5F | E5 | |||||||
| A | B | C | D | E | F |
|
Sonntagschule $sonntagschule |
Vorsonntagschule $vorsonntagschule |
|
A1 = Altarraum K1-10 = Kirchenschiffreihen D1 = Diakon |
M1 = Mutter/Kind F1 = Foyer E1-5 Empore |
";
#echo $buffer;
#echo "";
#exit;
$mpdf->WriteHTML($buffer);
#echo "Mailsend: ".$_POST['mailsend'];
#exit;
// Output a PDF file directly to the browser
if($_POST['mailsend'] != '1'){
$smarty->assign('mailwindow', '0');
$mpdf->Output($row_get_termin['datum_output'].'_Gottesdienstteilnehmer.pdf', D);
}else{
$smarty->assign('mailwindow', '1');
$mpdf->Output('./pdfs/'.$row_get_termin['datum_output'].'_Gottesdienstteilnehmer.pdf', F);
$to = get_parameter(5); // addresses to email pdf to
$from = "NAK Beutelsbach "; // address message is sent from
$subject = "Liste der Gottesdienstteilnehmer am ".$row_get_termin['datum_form']; // email subject
$body = "
Liste der Gottesdienstteilnehmer
Guten Tag!
im Anhang finden Sie die Teilnehmerliste des Gottesdienstes am: $row_get_termin[datum_form]
Diese Mail wurde automatisch generiert!
Antworten Sie daher nicht auf diese Mail
Vielen Dank
";
$pdfLocation = "./pdfs/".$row_get_termin['datum_output']."_Gottesdienstteilnehmer.pdf"; // file location
$pdfName = $row_get_termin['datum_output']."_Gottesdienstteilnehmer.pdf"; // pdf file name recipient will get
$filetype = "application/pdf"; // type
// create headers and mime boundry
$eol = PHP_EOL;
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers = "From: $from$eol" .
"MIME-Version: 1.0$eol" .
"Content-Type: multipart/mixed;$eol" .
" boundary=\"$mime_boundary\"";
// add html message body
$message = "--$mime_boundary$eol" .
"Content-Type: text/html; charset=\"iso-8859-1\"$eol" .
"Content-Transfer-Encoding: 7bit$eol$eol" .
$body . $eol;
// fetch pdf
$file = fopen($pdfLocation, 'rb');
$data = fread($file, filesize($pdfLocation));
fclose($file);
$pdf = chunk_split(base64_encode($data));
// attach pdf to email
$message .= "--$mime_boundary$eol" .
"Content-Type: $filetype;$eol" .
" name=\"$pdfName\"$eol" .
"Content-Disposition: attachment;$eol" .
" filename=\"$pdfName\"$eol" .
"Content-Transfer-Encoding: base64$eol$eol" .
$pdf . $eol .
"--$mime_boundary--";
// Send the email
if(mail($to, $subject, $message, $headers)) {
$smarty->assign('message', 'Die Mail wurde versendet!');
}
else {
$smarty->assign('message', 'Die Mail wurde nicht versendet!');
}
unlink($pdfLocation);
}
}
$smarty->assign('action', "$action");
$smarty->display("$template/admin/$templatename");
?>