From 209c0b93c529356a094d7133a717e8f6ee6d90c6 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 16 Jan 2023 03:33:06 +0100 Subject: =?UTF-8?q?Config=20&=20config.ini,=20data=20folder,=20partie=20la?= =?UTF-8?q?tex=20bient=C3=B4t=20finie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/functions.php') diff --git a/src/functions.php b/src/functions.php index 0ec280f..b8779e8 100644 --- a/src/functions.php +++ b/src/functions.php @@ -35,7 +35,24 @@ function rechercheClient(string $input, Clients $Client): array return($result); } -function getLatexFromTemplate(string $template) +function makeFolder(string $path) +{ + if(!file_exists($path)) + { + mkdir($path); + chmod($path, 0755); + } +} + +function makeLatexAndPdfDocument($file_name, $template, Clients $Client, Prestations $Presta = null, $Details = null) // $Details peut être de type DevisFactures ou Locations +{ + //~ $data = ; // tableau associatif avec des données des différents objets + $latex = getLatexFromTemplate($template, $data); + file_put_contents($latex_path . $file_name, $latex); // injection des variables & écriture du fichier + latexToPdf($latex_path, $file_name, $pdf_path); +} + +function getLatexFromTemplate(string $template, $data) { // variables à injecter $nom_client = "M. Duchmol"; -- cgit v1.2.3