getEffectiveTournament(); } $tex = preg_replace("#{TOURNAMENT_NAME}#", $tournament->getName(), $tex); $tex = preg_replace("#{PLACE}#", $tournament->getPlace(), $tex); $tex = preg_replace("#{PRICE}#", $tournament->getPrice(), $tex); $tex = preg_replace("#{END_PAYMENT_DATE}#", strftime("%d %B", strtotime($tournament->getInscriptionDate())), $tex); $tex = preg_replace("#{YEAR}#", $YEAR, $tex); shell_exec("mkdir tmp"); file_put_contents("tmp/file.tex", $tex); shell_exec("pdflatex -synctex=1 -interaction=nonstopmode -shell-escape -output-directory=tmp tmp/file.tex"); header("Content-type: application/pdf"); readfile("tmp/file.pdf"); shell_exec("rm -rf tmp"); exit(0);