Unverified Commit 82a3949c authored by Guinness's avatar Guinness

Fix receipt.pdf being outdated + fix paths.

parent 213037a8
......@@ -408,7 +408,7 @@ class Perso extends Controller
$db = $f3->get('DB');
$id = $params['id'];
$command = "pdftk ";
$args = " ./receipt.pdf fill_form tmp/".$id.".xfdf output tmp/".$id.".pdf flatten dont_ask";
$args = " ./receipt.pdf fill_form ../tmp/".$id.".xfdf output ../tmp/".$id.".pdf flatten dont_ask";
$logger->write($command . " " .$args);
// Vérification que le don appartient bien à l'utilisateur connecté
......@@ -472,7 +472,7 @@ class Perso extends Controller
</field>
</fields>
</xfdf>';
$fp = fopen("tmp/".$id.".xfdf", "w");
$fp = fopen("../tmp/".$id.".xfdf", "w");
if ($fp) {
fputs($fp, $content);
fclose($fp);
......@@ -483,12 +483,12 @@ class Perso extends Controller
exec($command.$args, $output);
// Suppression du fichier datas
unlink("tmp/".$id.".xfdf");
unlink("../tmp/".$id.".xfdf");
// Renvoi du fichier pdf au client
$fp = fopen("tmp/".$id.".pdf", "rb");
$fp = fopen("../tmp/".$id.".pdf", "rb");
if ($fp) {
$fsize = filesize("tmp/".$id.".pdf");
$fsize = filesize("../tmp/".$id.".pdf");
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=\"".$id.".pdf\"");
header("Content-Length: $fsize");
......@@ -502,7 +502,7 @@ class Perso extends Controller
}
// Suppression du fichier reçu
unlink("tmp/".$id.".pdf");
unlink("../tmp/".$id.".pdf");
die();
}
......
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment