| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
-
- require_once('../common/ImtMail.php');
-
- $method = $_GET['method'];
- $pdfName = $_GET['name'];
- $userId = $_GET['id'];
- $lang = $_GET['lang'];
- if (isset($_GET['mail']))
- $mailParam = $_GET['mail'];
-
- $ff=fopen("pdfDownloadStats.txt", "a+");
- fprintf($ff, "id=%s\n", $userId);
- fclose($ff);
-
- if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] ))
- {
- // get bytearray
- $pdf = $GLOBALS["HTTP_RAW_POST_DATA"];
-
- if (isset($mailParam) && $mailParam)
- {
- $subject = "IntimaMedia.com : IMT pdf";
-
- if ($lang == 'fr')
- $message = "<HTML><HEAD></HEAD><BODY>Bonjour<br/><br/>Vous venez de recevoir un rapport pdf en provenance de l'application IntimaMedia.com.<br/><br/>Cordialement.</BODY></HTML>";
- else
- $message = "<HTML><HEAD></HEAD><BODY>Hello<br/><br/>Please, find in attachment a IMT pdf report.<br/><br/>Best regards.</BODY></HTML>";
-
- $emails = explode(';', $mailParam);
- for ($i=0; $i<sizeof($emails); $i++)
- {
- if ($emails[$i])
- ImtMail::sendMail($emails[$i], "support@intimamedia.com", "support@intimamedia.com", $subject, $message, $lang, "imt.pdf", "application/pdf", $pdf);
- }
- }
-
- // add headers for download dialog-box
- header('Content-Type: application/pdf');
- header('Content-Length: '.strlen($pdf)+1);
- header('Content-disposition:'.$method.'; filename="'.$pdfName.'"');
- echo $pdf;
-
- }
- else
- echo 'An error occured.';
- ?>
|