From dedbe2f5cee33431c1299c7f0dbef4e247dc2447 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 19 Dec 2022 02:51:03 +0100 Subject: nouveau client main.php en cours --- src/functions.php | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) (limited to 'src/functions.php') diff --git a/src/functions.php b/src/functions.php index d67a05e..6ddbae0 100644 --- a/src/functions.php +++ b/src/functions.php @@ -1,11 +1,11 @@ get()); + if($entry !== '') + { + $tableau = explode('|', $entry); + if(count($tableau) === 4) + { + $Client->newRow($tableau); + return true; + } + else + { + echo "debug: mauvais tableau, il doit avoir 4 cases\n"; + return false; + } + } + else + { + echo "debug: pas de données saisies\n"; + return false; + } +} + +function getLatexFromTemplate(string $template) +{ + // variables à injecter + $nom_client = "M. Duchmol"; + + // on obtient la variable $latex avec ob_get_clean() + include('latex_templates/' . $template . '.php'); + + // on retourne le buffer + // normallement le code PHP inséré avec include est nettoyé en quittant la fonction + return($latex); +} + // compilation à partir d'un fichier .tex -function latexToPdf(string $fileName, string $latexPath, string $pdfPath) +function latexToPdf(string $latexPath, string $fileName, string $pdfPath) { $outputDir = ''; if($pdfPath !== '') -- cgit v1.2.3