|
|
|
@ -2,6 +2,9 @@
|
|
|
|
|
session_start();
|
|
|
|
|
|
|
|
|
|
require "config.php";
|
|
|
|
|
require "PHPMailer/PHPMailer.php";
|
|
|
|
|
require "PHPMailer/SMTP.php";
|
|
|
|
|
require "PHPMailer/Exception.php";
|
|
|
|
|
|
|
|
|
|
#$CONVERT_CMD = "/usr/bin/pdftk";
|
|
|
|
|
|
|
|
|
@ -405,8 +408,33 @@ $cmd .= " cat output $resultnam.pdf";
|
|
|
|
|
exec ($cmd);
|
|
|
|
|
#var_dump($_POST);
|
|
|
|
|
|
|
|
|
|
#echo "CMD: $cmd<br>";
|
|
|
|
|
#die;
|
|
|
|
|
$file = "$resultnam.pdf";
|
|
|
|
|
|
|
|
|
|
if ($_POST['sendmail']=='yes'){
|
|
|
|
|
$subj = "Kostenerstattungsantrag ueber".calcSum()." EUR";
|
|
|
|
|
|
|
|
|
|
$mail = new PHPMailer\PHPMailer\PHPMailer();
|
|
|
|
|
$mail->IsSMTP();
|
|
|
|
|
$mail->setFrom("noc@wikimedia.de");
|
|
|
|
|
$mail->Subject = $subj;
|
|
|
|
|
$mail->Body = "Kostenerstattungsantragi ...";
|
|
|
|
|
$mail->AddAddress("tube@surfpoeten.de");
|
|
|
|
|
$mail->AddAttachment( $file , 'antrag.pdf' );
|
|
|
|
|
|
|
|
|
|
$mail->Host = $mailHost; // Specify main and backup server
|
|
|
|
|
$mail->Port = $mailPort; // Set the SMTP port
|
|
|
|
|
$mail->SMTPAuth = $mailSMTPAuth;
|
|
|
|
|
$mail->Username = $mailUsername;
|
|
|
|
|
$mail->Password = $mailPassword;
|
|
|
|
|
$mail->SMTPSecure = $mailSMTPSecure; // Enable encryption, 'ssl' also accepted
|
|
|
|
|
$rc = $mail->send();
|
|
|
|
|
if (!$rc) {
|
|
|
|
|
echo 'Mailer Error: ' . $mail->ErrorInfo;
|
|
|
|
|
}
|
|
|
|
|
echo "Dein Antrag wurde versendet";
|
|
|
|
|
|
|
|
|
|
die;
|
|
|
|
|
}
|
|
|
|
|
$file = "$resultnam.pdf";
|
|
|
|
|
header('Content-Disposition: attachment; filename="'. basename($file) . '"');
|
|
|
|
|
header('Content-Length: ' . filesize($file));
|
|
|
|
|