diff options
Diffstat (limited to 'src/functions.php')
-rw-r--r-- | src/functions.php | 19 |
1 files changed, 18 insertions, 1 deletions
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 | |||
35 | return($result); | 35 | return($result); |
36 | } | 36 | } |
37 | 37 | ||
38 | function getLatexFromTemplate(string $template) | 38 | function makeFolder(string $path) |
39 | { | ||
40 | if(!file_exists($path)) | ||
41 | { | ||
42 | mkdir($path); | ||
43 | chmod($path, 0755); | ||
44 | } | ||
45 | } | ||
46 | |||
47 | function makeLatexAndPdfDocument($file_name, $template, Clients $Client, Prestations $Presta = null, $Details = null) // $Details peut être de type DevisFactures ou Locations | ||
48 | { | ||
49 | //~ $data = ; // tableau associatif avec des données des différents objets | ||
50 | $latex = getLatexFromTemplate($template, $data); | ||
51 | file_put_contents($latex_path . $file_name, $latex); // injection des variables & écriture du fichier | ||
52 | latexToPdf($latex_path, $file_name, $pdf_path); | ||
53 | } | ||
54 | |||
55 | function getLatexFromTemplate(string $template, $data) | ||
39 | { | 56 | { |
40 | // variables à injecter | 57 | // variables à injecter |
41 | $nom_client = "M. Duchmol"; | 58 | $nom_client = "M. Duchmol"; |