From 33623b0aa1f5e3346a38bcafc1573889afb87e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Huneau?= Date: Sat, 22 Mar 2025 16:53:35 +0100 Subject: [PATCH] =?UTF-8?q?M=C3=A0J=20ent=C3=AAte=20+=20mineures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controleurs/cElement.php | 12 ++++-------- db/cuisine.db | Bin 126976 -> 126976 bytes inc/modele.php | 8 +++++++- static/entete.php | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/controleurs/cElement.php b/controleurs/cElement.php index f2c6ae8..56bcd85 100644 --- a/controleurs/cElement.php +++ b/controleurs/cElement.php @@ -1,5 +1,4 @@ - \ No newline at end of file diff --git a/db/cuisine.db b/db/cuisine.db index 876a77526655da670f14a08035d6f1a3781332f9..f78001e1da83ecb18d9efdfc6a2330f9c9e42222 100644 GIT binary patch delta 78 zcmZp8z~1nHeS$ROl8G|Tj7v5qbm%jtZhomRZNMDOI%6_>!d52M8Ji6SZm~#7r1CS! Vb8>LPfg=nwZ%W<1DV5Q$3jok17R>+v delta 48 zcmV-00MGw`;0J)<2ap>9qmdj#0i&^Ch%W(Tv*|AzFaufzvXcj3wX-o0_5_2nWw)|r G0Zxj@EfVJd diff --git a/inc/modele.php b/inc/modele.php index c726311..dc03234 100644 --- a/inc/modele.php +++ b/inc/modele.php @@ -5,7 +5,7 @@ function getDB() {return new SQLite3("db/cuisine.db");} function getAssocFromQueryString($qs){ $db = getDB(); $stmt = $db->prepare($qs); - $result = $stmt->execute(); + $result = $stmt ? $stmt->execute() : false; $assocArray = []; while ($ligne = $result->fetchArray(SQLITE3_ASSOC)){ $assocArray[] = $ligne; @@ -185,6 +185,12 @@ function safePutUnite($nom){ return $db->exec($requete); } +function getElementWithElementId($idElement, $table){ + $requeteId = "SELECT * FROM $table WHERE id=$idElement;"; + $resultat = getAssocFromQueryString($requeteId); + return ($resultat ? $resultat[0] : false); +} + // modification vaut false si on effectue une création de recette et l'id de la recette à modifier sinon // les listes d'ingrédients, de préparation et d'ustensile sont des tableaux de tableaux indexés sur les id des éléments utilisés. function insererRecette($infosRecette, $listeIngredients, $listeUstensile, $listePreparation, $listeReutilise, $modification){ diff --git a/static/entete.php b/static/entete.php index 74fddee..7e9ad49 100644 --- a/static/entete.php +++ b/static/entete.php @@ -2,4 +2,5 @@

Cuisine et pâtisserie

+

Attention, ce site est en cours de refonte totale, il ne devrait pas être en production !

\ No newline at end of file