Générateur de G1BILLETS Utilisable en ligne de commande (ou sur un site web)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
847 B

<?php
$mytime = new Datetime("now");
$timestamp = $mytime->format('U').rand();
// CREATE 6 G1BILLETS in /tmp/g1billet/$timestamp
$page = shell_exec(dirname(__FILE__)."/G1BILLETS.sh '".$_REQUEST['montant']."' '".$timestamp."' '".$_REQUEST['style']."'");
$attachment_location = "/tmp/g1billet/".$timestamp.".pdf";
if (file_exists($attachment_location)) {
header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
header("Cache-Control: public"); // needed for internet explorer
header("Content-Type: application/pdf");
header("Content-Transfer-Encoding: Binary");
header("Content-Length:".filesize($attachment_location));
header("Content-Disposition: attachment; filename=".$timestamp.".pdf");
readfile($attachment_location);
unlink("/tmp/g1billet/".$timestamp.".pdf");
die();
} else {
die("Error: File not found.");
}
?>