diff options
| author | polo <ordipolo@gmx.fr> | 2023-01-16 03:33:06 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2023-01-16 03:33:06 +0100 |
| commit | 209c0b93c529356a094d7133a717e8f6ee6d90c6 (patch) | |
| tree | b8dac8968501fe4e0bba8dc98b80d0eb43770ecb /src/functions.php | |
| parent | 945af9fda5146405ab9903d4d268bcb2fe95da25 (diff) | |
| download | AppliGestionPHP-209c0b93c529356a094d7133a717e8f6ee6d90c6.tar.gz AppliGestionPHP-209c0b93c529356a094d7133a717e8f6ee6d90c6.tar.bz2 AppliGestionPHP-209c0b93c529356a094d7133a717e8f6ee6d90c6.zip | |
Config & config.ini, data folder, partie latex bientôt finie
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"; |
