commit 4c71fb59b47c45908780c9d4bc7fd81ffeb58081
Author: Timothée Huneau
Date: Tue Apr 11 19:11:26 2023 +0200
Initial commit
Création de tous les dossiers et fichiers avec mise à part des constantes
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0f5d354
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+local/*
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..df5f114
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1 @@
+ErrorDocument 404 https://cuisine.timotheehuneau.fr/index.php?erreur=404
diff --git a/asides/aAccueil.php b/asides/aAccueil.php
new file mode 100644
index 0000000..4974261
--- /dev/null
+++ b/asides/aAccueil.php
@@ -0,0 +1,141 @@
+
\ No newline at end of file
diff --git a/asides/aRecette.php b/asides/aRecette.php
new file mode 100644
index 0000000..01cea75
--- /dev/null
+++ b/asides/aRecette.php
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/asides/void.php b/asides/void.php
new file mode 100644
index 0000000..151998d
--- /dev/null
+++ b/asides/void.php
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/contenus/closed_lock.svg b/contenus/closed_lock.svg
new file mode 100644
index 0000000..80ad3e3
--- /dev/null
+++ b/contenus/closed_lock.svg
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/contenus/croix.svg b/contenus/croix.svg
new file mode 100644
index 0000000..3f11ea1
--- /dev/null
+++ b/contenus/croix.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/contenus/icone.svg b/contenus/icone.svg
new file mode 100644
index 0000000..2527c50
--- /dev/null
+++ b/contenus/icone.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/contenus/open_lock.svg b/contenus/open_lock.svg
new file mode 100644
index 0000000..8846797
--- /dev/null
+++ b/contenus/open_lock.svg
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/controleurs/cAccueil.php b/controleurs/cAccueil.php
new file mode 100644
index 0000000..0abdbef
--- /dev/null
+++ b/controleurs/cAccueil.php
@@ -0,0 +1,115 @@
+ $demande){
+ switch($demande){
+ case 1:
+ $clauseIngredientsRequis .= " AND ingredient = $id";
+ break;
+
+ case -1:
+ $clauseIngredientsInterdits .= " OR ingredient = $id";
+ break;
+
+ default:
+ break;
+ }
+ }
+ $clauseIngredientsRequis = "AND r.id IN (SELECT recette FROM RecetteIngredient WHERE 1=1 $clauseIngredientsRequis)";
+ $clauseIngredientsInterdits = "r.id NOT IN (SELECT recette FROM RecetteIngredient WHERE 0=1 $clauseIngredientsInterdits)";
+ $whereClause .= $clauseIngredientsInterdits . $clauseIngredientsRequis;
+
+
+ $clauseUstensilesAutorises = '';
+ foreach($_POST['ustensile'] as $id => $demande){
+ if($demande){
+ $clauseUstensilesAutorises .= " OR ustensile = $id";
+ }
+ }
+ $clauseUstensilesAutorises = " AND r.id NOT IN (SELECT recette FROM RecetteUstensile WHERE 0=1 $clauseUstensilesAutorises)";
+ $whereClause .= $clauseUstensilesAutorises;
+
+ $clauseGenre = ' AND (1=0 ';
+ if(isset($_POST['genre'])){
+ foreach($_POST['genre'] as $id => $demande){
+ $clauseGenre .= " OR genre = $id";
+ }
+ }
+ $whereClause .= $clauseGenre . ')';
+}else{
+ unset($_SESSION['tri']);
+}
+
+$requeteListeRecettes = "
+SELECT r.id idRecette, r.nom nom, r.tempsTotal duree, g.nom genre, g.id idGenre
+FROM Recette r JOIN Genre g ON g.id = r.genre
+WHERE $whereClause
+ORDER BY $typeOrdreListe $sensOrdreListe;
+";
+
+//echo $requeteListeRecettes;
+
+$resultatListeRecettes = mysqli_query($c, $requeteListeRecettes);
+if ($resultatListeRecettes){
+ $listeRecettes = [];
+ while ($recette = mysqli_fetch_assoc($resultatListeRecettes)){
+ $idRecette = $recette['idRecette'];
+ $listeRecettes[$idRecette] = [];
+ foreach ($recette as $clef => $info){
+ if ($clef != 'idRecette'){
+ if($clef == 'duree'){$info = calculeTexteFromMinutes($info);}
+ $listeRecettes[$idRecette][$clef] = $info;
+ }
+ }
+ }
+}
+
+//recuperation des ingredients
+$requeteListeIngredient = "SELECT nom, id FROM Ingredient ORDER BY nom;";
+$resultatListeIngredient = mysqli_query($c, $requeteListeIngredient);
+$listeIngredient = [];
+while ($infoIngredient = mysqli_fetch_assoc($resultatListeIngredient)){
+ $listeIngredient[$infoIngredient['id']] = $infoIngredient;
+}
+
+//recuperation des ustensiles
+$requeteListeUstensile = "SELECT nom, id FROM Ustensile ORDER BY nom;";
+$resultatListeUstensile = mysqli_query($c, $requeteListeUstensile);
+$listeUstensile = [];
+while ($infoUstensile = mysqli_fetch_assoc($resultatListeUstensile)){
+ $listeUstensile[$infoUstensile['id']] = $infoUstensile;
+}
+
+//recuperation des modes de preparation
+$requeteListePreparation = "SELECT nom, id FROM Preparation ORDER BY nom;";
+$resultatListePreparation = mysqli_query($c, $requeteListePreparation);
+$listePreparation = [];
+while ($infoPreparation = mysqli_fetch_assoc($resultatListePreparation)){
+ $listePreparation[] = $infoPreparation;
+}
+
+//recuperation des genre de recette
+$listeGenre = recupereGenres($c);
+
+deconnectBD($c);
+?>
\ No newline at end of file
diff --git a/controleurs/cAjouterElement.php b/controleurs/cAjouterElement.php
new file mode 100644
index 0000000..de17dff
--- /dev/null
+++ b/controleurs/cAjouterElement.php
@@ -0,0 +1,58 @@
+
\ No newline at end of file
diff --git a/controleurs/cConnexion.php b/controleurs/cConnexion.php
new file mode 100644
index 0000000..49b5ebe
--- /dev/null
+++ b/controleurs/cConnexion.php
@@ -0,0 +1,23 @@
+
\ No newline at end of file
diff --git a/controleurs/cElement.php b/controleurs/cElement.php
new file mode 100644
index 0000000..f2c6ae8
--- /dev/null
+++ b/controleurs/cElement.php
@@ -0,0 +1,74 @@
+ $dispo){
+ $paireColonneValeur .= $mois . ' = ' . $dispo . ', ';
+ }
+ }
+ $paireColonneValeur .= "nom = '$nomNvl' ";
+ $reqNvl = "UPDATE $table SET $paireColonneValeur WHERE id = $idElement;";
+ mysqli_query($c, $reqNvl);
+ }
+
+ $requeteId = "SELECT * FROM $table WHERE id=$idElement;";
+ $resultatId = mysqli_query($c, $requeteId);
+ $infoElement = mysqli_fetch_assoc($resultatId);
+ $pageExiste = ($infoElement) ? true : false ;
+ $titrePartDeux = $infoElement['nom'];
+
+ }
+}
+
+$titrePage = $titrePartUn . ' : ' . $titrePartDeux;
+
+$_SESSION['tableDernierElemVu'] = $table;
+$_SESSION['typeDernierElemVu'] = $type;
+$_SESSION['idDernierElemVu'] = $idElement;
+
+deconnectBD($c);
+?>
\ No newline at end of file
diff --git a/controleurs/cPersonnes.php b/controleurs/cPersonnes.php
new file mode 100644
index 0000000..faa1990
--- /dev/null
+++ b/controleurs/cPersonnes.php
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/controleurs/cRecette.php b/controleurs/cRecette.php
new file mode 100644
index 0000000..b8fd1fa
--- /dev/null
+++ b/controleurs/cRecette.php
@@ -0,0 +1,197 @@
+ $ustensile){
+ $infosRecette['ustensile'][$id]['commentaire'] = ecritureVersLecture($ustensile['commentaire']);
+ }
+ }
+
+ $infosRecette['preparation'] = [];
+ if(isset($_POST['preparation'])){
+ foreach($_POST['preparation'] as $id => $preparation){
+ $infosRecette['preparation'][$id]['duree'] = calculeMinutesFromTexte($preparation['duree']);
+ $infosRecette['preparation'][$id]['temp'] = $preparation['temp'];
+ }
+ }
+
+ $infosRecette['ingredient'] = [];
+ if(isset($_POST['ingredient'])){
+ foreach($_POST['ingredient'] as $id => $ingredient){
+ $infosRecette['ingredient'][$id]['quantite'] = $ingredient['quantite'];
+ $infosRecette['ingredient'][$id]['unite'] = $ingredient['unite'];
+ }
+ }
+
+
+ $infosRecette['reutilise'] = [];
+ if(isset($_POST['reutilise'])){
+ foreach($_POST['reutilise'] as $id => $elem){
+ $infosRecette['reutilise'][$id] = $id;
+ }
+ }
+
+
+
+ $infosRecette['nom'] = $_POST['nom'];
+ $infosRecette['nbPortion'] = $_POST['nbPortion'];
+ $infosRecette['unitePortion'] = $_POST['unitePortion'];
+ $infosRecette['tempsTotal'] = $_POST['tempsTotal'];
+ $infosRecette['genre'] = $_POST['genre'];
+ $infosRecette['realisation'] = $_POST['procedure'];
+
+ $idRecette = insererRecette($infosRecette, $infosRecette['ingredient'], $infosRecette['ustensile'], $infosRecette['preparation'], $infosRecette['reutilise'], $idRecette);
+
+ }
+
+ //on recupere toutes les infos sur la recette sélectionnée.
+ //(elles ont p-ê été modifiés juste avant, mais dans le doute ...)
+ $requeteRecette =
+ "SELECT r.nom, r.id idRecette, r.nbPortion portions, u.nom unite, r.realisation, u.id idU, r.tempsTotal tempsTotal, g.nom genre
+ FROM Recette r JOIN Unite u ON r.unitePortion = u.id JOIN Genre g ON r.genre = g.id
+ WHERE r.id = $idRecette
+ ORDER BY nom;
+ ";
+ $requeteIngredient =
+ "SELECT ri.ingredient idIngredient, i.nom nom, ri.quantite quantite, u.nom unite, u.id idU
+ FROM Ingredient i JOIN RecetteIngredient ri ON i.id = ri.ingredient JOIN Unite u ON ri.unite = u.id
+ WHERE ri.recette = $idRecette
+ ORDER BY nom;
+ ";
+ $requeteUstensile = "
+ SELECT ru.ustensile idUstensile, u.nom nom, ru.commentaire commentaire
+ FROM Ustensile u JOIN RecetteUstensile ru ON u.id = ru.ustensile
+ WHERE ru.recette = $idRecette
+ ORDER BY nom;
+ ";
+ $requetePreparation = "
+ SELECT rp.preparation idPreparation, p.nom nom, rp.duree duree, rp.temperature temperature
+ FROM Preparation p JOIN RecettePreparation rp ON p.id = rp.preparation
+ WHERE rp.recette = $idRecette
+ ORDER BY nom;
+ ";
+ $requeteGenre = "
+ SELECT g.id idGenre, g.nom nom
+ FROM Genre g JOIN Recette r ON g.id = r.genre
+ WHERE r.id = $idRecette;
+ ";
+ $requeteReutilise = "
+ SELECT reu.utilisee id, rec.nom nom
+ FROM Reutilise reu JOIN Recette rec ON reu.utilisee = rec.id
+ WHERE reu.utilisant = $idRecette
+ ORDER BY nom;
+ ";
+
+ $resultatRecette = mysqli_query($c, $requeteRecette);
+ $resultatIngredient = mysqli_query($c, $requeteIngredient);
+ $resultatUstensile = mysqli_query($c, $requeteUstensile);
+ $resultatPreparation = mysqli_query($c, $requetePreparation);
+ $resultatGenre = mysqli_query($c, $requeteGenre);
+ $resultatReutilise = mysqli_query($c, $requeteReutilise);
+
+ $infoRecette = mysqli_fetch_assoc($resultatRecette);
+ $infoRecette['tempsTotal'] = calculeTexteFromMinutes($infoRecette['tempsTotal']);
+
+ $nomGenre = mysqli_fetch_assoc($resultatGenre)['nom'];
+
+ $listeIngredientsRecette = [];
+ while ($ingredient = mysqli_fetch_assoc($resultatIngredient)){
+ $listeIngredientsRecette[$ingredient['idIngredient']] = [];
+ $listeIngredientsRecette[$ingredient['idIngredient']]['nom'] = $ingredient['nom'];
+ $listeIngredientsRecette[$ingredient['idIngredient']]['quantite'] = $ingredient['quantite'];
+ $listeIngredientsRecette[$ingredient['idIngredient']]['unite'] = $ingredient['unite'];
+ $listeIngredientsRecette[$ingredient['idIngredient']]['idU'] = $ingredient['idU'];
+ }
+
+ $listeUstensilesRecette = [];
+ while ($ustensile = mysqli_fetch_assoc($resultatUstensile)){
+ $listeUstensilesRecette[$ustensile['idUstensile']] = [];
+ $listeUstensilesRecette[$ustensile['idUstensile']]['nom'] = $ustensile['nom'];
+ $listeUstensilesRecette[$ustensile['idUstensile']]['commentaire'] = $ustensile['commentaire'];
+ }
+
+ $listePreparationsRecette = [];
+ while ($preparation = mysqli_fetch_assoc($resultatPreparation)){
+ $listePreparationsRecette[$preparation['idPreparation']] = [];
+ $listePreparationsRecette[$preparation['idPreparation']]['nom'] = $preparation['nom'];
+ $listePreparationsRecette[$preparation['idPreparation']]['duree'] = calculeTexteFromMinutes($preparation['duree']);
+ $listePreparationsRecette[$preparation['idPreparation']]['temperature'] = $preparation['temperature'];
+ }
+
+ $listeReutiliseRecette = [];
+ while ($recette = mysqli_fetch_assoc($resultatReutilise)){
+ $listeReutiliseRecette[$recette['id']] = $recette;
+ }
+
+
+
+ //selon les cas, on peut avoir différentes action à faire
+ switch($pageExiste){
+ case 1:
+ $infoRecette['realisation'] = ecritureVersLecture($infoRecette['realisation']);
+ foreach($listeUstensilesRecette as $ustensile){
+ $ustensile['commentaire'] = ecritureVersLecture($ustensile['commentaire']);
+ }
+ break;
+
+ case 2:
+ $infoRecette['realisation'] = lectureVersEcriture($infoRecette['realisation']);
+ foreach($listeUstensilesRecette as $id => $ustensile){
+ $listeUstensilesRecette[$id]['commentaire'] = lectureVersEcriture($listeUstensilesRecette[$id]['commentaire']);
+ }
+ case -1:
+ $listeUnite = recupereUnites($c);
+ $listeGenre = recupereGenres($c);
+ break;
+ }
+}
+
+deconnectBD($c);
+
+?>
\ No newline at end of file
diff --git a/controleurs/cStatistiques.php b/controleurs/cStatistiques.php
new file mode 100644
index 0000000..3dda7e1
--- /dev/null
+++ b/controleurs/cStatistiques.php
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/controleurs/cSupprimerElement.php b/controleurs/cSupprimerElement.php
new file mode 100644
index 0000000..3b5495f
--- /dev/null
+++ b/controleurs/cSupprimerElement.php
@@ -0,0 +1,31 @@
+
\ No newline at end of file
diff --git a/controleurs/cSupprimerRecette.php b/controleurs/cSupprimerRecette.php
new file mode 100644
index 0000000..333f3a8
--- /dev/null
+++ b/controleurs/cSupprimerRecette.php
@@ -0,0 +1,36 @@
+
\ No newline at end of file
diff --git a/controleurs/cTests.php b/controleurs/cTests.php
new file mode 100644
index 0000000..c604b61
--- /dev/null
+++ b/controleurs/cTests.php
@@ -0,0 +1,11 @@
+";
+ $ret = calculeTexteFromMinutes($_POST['textTest']);
+
+ print_r($ret);
+ echo "";
+}
+
+?>
\ No newline at end of file
diff --git a/controleurs/void.php b/controleurs/void.php
new file mode 100644
index 0000000..e69de29
diff --git a/inc/fonctions.php b/inc/fonctions.php
new file mode 100644
index 0000000..6db97fe
--- /dev/null
+++ b/inc/fonctions.php
@@ -0,0 +1,70 @@
+ 'Oe',
+ '#œ#' => 'oe',
+ '#Æ#' => 'Ae',
+ '#æ#' => 'ae',
+ '#[^a-zàâäéèêëîïôöùûüÿçñA-ZÀÂÄÉÈÊËÎÏÔÖÙÛÜŸÇÑ ,\'-]#' => '',
+ '#^[ ,-]+#' => '',
+ '#[ ]+$#' => '',
+ '#\'#' => '\\\''
+ ];
+ foreach ($transformations as $reEtape => $remplacement){
+ $entree = preg_replace($reEtape, $remplacement, $entree);
+ }
+
+ $entree = mb_strtoupper(mb_substr($entree, 0, 1)) . mb_substr($entree, 1);
+ return $entree;
+}
+
+function calculeMinutesFromTexte($texteDuree){
+ $texteDuree = preg_replace("/ /", "", $texteDuree);
+
+ preg_match("#(?:([0-9]*) ?j(?:our\(s\)|our|ours)?)? ?(?:([0-9]*) ?h(?:eure\(s\)|eure|eures)?)? ?(?:([0-9]*) ?min(?:ute\(s\)|ute|utes)?)?#", $texteDuree, $matches) ;
+
+ $dureeMinutes = 0;
+
+ foreach($matches as $clef => $duree){
+ if ($clef == 1 and $duree != NULL){$dureeMinutes += 1440*$duree;}
+ if ($clef == 2 and $duree != NULL){$dureeMinutes += 60*$duree;}
+ if ($clef == 3){$dureeMinutes += intval($duree);}
+ }
+
+ return $dureeMinutes;
+}
+
+function calculeTexteFromMinutes($minute){
+
+ $restant = $minute;
+ $texteMinutes = '';
+ $tempsJours = intdiv($restant,1440);
+ $texteMinutes .= ($tempsJours) != 0 ? $tempsJours . ' jour(s) ' : '';
+ $restant = $restant % 1440;
+ $tempsHeures = intdiv($restant,60);
+ $texteMinutes .= ($tempsHeures) != 0 ? $tempsHeures . ' heure(s) ' : '';
+ $restant = $restant % 60;
+ $texteMinutes .= ($restant) != 0 ? $restant . ' minute(s)' : '';
+
+
+ return $texteMinutes;
+}
+
+function lectureVersEcriture($texte){
+ $texte = preg_replace("# #","##",$texte);
+ $texte = preg_replace("#
#","\n",$texte);
+ $texte = preg_replace("#⌀#","#diam",$texte);
+ return $texte;
+}
+function ecritureVersLecture($texte){
+ $texte = preg_replace("/##/"," ",$texte);
+ $texte = preg_replace("/\n/","
",$texte);
+ $texte = preg_replace("/#diam/","⌀",$texte);
+ return $texte;
+}
+
+function echappementBDD($texte){ //echappe tous les caractères pour que la chaînes soit acceptable dasn une requete SQL
+ $texte = preg_replace("/'/","\'",$texte);
+ return $texte;
+}
+?>
\ No newline at end of file
diff --git a/inc/modele.php b/inc/modele.php
new file mode 100644
index 0000000..c5d83b9
--- /dev/null
+++ b/inc/modele.php
@@ -0,0 +1,240 @@
+console.log('Echec de la connexion la base');";
+ exit();
+ }
+ mysqli_set_charset($connexion,'utf8');
+ return $connexion;
+}
+
+// dconnexion de la BD
+function deconnectBD($connexion) {
+ mysqli_close($connexion);
+}
+
+function getAllIngredients(){
+ $c = seConnecter();
+ $requete = "
+ SELECT *
+ FROM Ingredient
+ ORDER BY nom;
+ ";
+ $resultatIngredients = mysqli_query($c, $requete);
+ $listeIngredients = [];
+ while($ingredient = mysqli_fetch_assoc($resultatIngredients)){
+ $listeIngredients[$ingredient['id']] = $ingredient;
+ }
+
+ deconnectBD($c);
+ return $listeIngredients;
+}
+
+function getAllUstensiles(){
+ $c = seConnecter();
+ $requete = "
+ SELECT *
+ FROM Ustensile
+ ORDER BY nom;
+ ";
+ $resultatUstensiles = mysqli_query($c, $requete);
+ $listeUstensiles = [];
+ while($ustensile = mysqli_fetch_assoc($resultatUstensiles)){
+ $listeUstensiles[$ustensile['id']] = $ustensile;
+ }
+
+ deconnectBD($c);
+ return $listeUstensiles;
+}
+
+function getAllPreparations(){
+ $c = seConnecter();
+ $requete = "
+ SELECT *
+ FROM Preparation
+ ORDER BY nom;
+ ";
+ $resultatPreparations = mysqli_query($c, $requete);
+ $listePreparations = [];
+ while($preparation = mysqli_fetch_assoc($resultatPreparations)){
+ $listePreparations[$preparation['id']] = $preparation;
+ }
+
+ deconnectBD($c);
+ return $listePreparations;
+}
+
+function getAllRecettes(){
+ $c = seConnecter();
+ $requete = "
+ SELECT *
+ FROM Recette
+ ORDER BY nom;
+ ";
+ $resultatRecettes = mysqli_query($c, $requete);
+ $listeRecettes = [];
+ while($recette = mysqli_fetch_assoc($resultatRecettes)){
+ $listeRecettes[$recette['id']] = $recette;
+ }
+
+ deconnectBD($c);
+ return $listeRecettes;
+}
+
+function recupereGenres($c){
+ $requete = "
+ SELECT *
+ FROM Genre
+ ;";
+ $resultatGenre = mysqli_query($c,$requete);
+ $listeGenres = [];
+
+ while ($genre = mysqli_fetch_assoc($resultatGenre)){
+ $listeGenres[$genre['id']] = $genre['nom'];
+ }
+
+ return $listeGenres;
+}
+
+function recupereUnites($c){
+ $requete = "
+ SELECT *
+ FROM Unite
+ ;";
+ $resultatUnite = mysqli_query($c,$requete);
+ $listeUnites = [];
+
+ while ($unite = mysqli_fetch_assoc($resultatUnite)){
+ $listeUnites[$unite['id']] = $unite['nom'];
+ }
+ return $listeUnites;
+}
+
+// modification vaut false si on effectue une cration de recette et l'id de la recette modifier sinon
+// les listes d'ingrdients, de prparation et d'ustensile sont des tableaux de tableaux indexs sur les id des lments utiliss.
+function insererRecette($infosRecette, $listeIngredients, $listeUstensile, $listePreparation, $listeReutilise, $modification){
+ $c = seConnecter();
+ try {
+ mysqli_begin_transaction($c);
+
+ $nom = echappementBDD($infosRecette['nom']);
+ $tempsTotal = calculeMinutesFromTexte($infosRecette['tempsTotal']);
+ $genre = $infosRecette['genre'];
+ $unitePortion = $infosRecette['unitePortion'];
+ $nbPortion = $infosRecette['nbPortion'];
+ $realisation = echappementBDD(ecritureVersLecture($infosRecette['realisation']));
+
+ if($modification){
+ $idRecette = $modification;
+ $requetePrincipale = "
+ UPDATE Recette
+ SET
+ nom = '$nom',
+ tempsTotal = $tempsTotal,
+ genre = $genre,
+ unitePortion = $unitePortion,
+ nbPortion = $nbPortion,
+ realisation = '$realisation'
+ WHERE id = $idRecette;
+ ";
+ mysqli_query($c, $requetePrincipale);
+
+ $requeteSupprIngredients = "DELETE FROM RecetteIngredient WHERE recette = $idRecette;";
+ mysqli_query($c, $requeteSupprIngredients);
+
+ $requeteSupprUstensiles = "DELETE FROM RecetteUstensile WHERE recette = $idRecette;";
+ mysqli_query($c, $requeteSupprUstensiles);
+
+ $requeteSupprPreparations = "DELETE FROM RecettePreparation WHERE recette = $idRecette;";
+ mysqli_query($c, $requeteSupprPreparations);
+
+ $requeteSupprReutilises = "DELETE FROM Reutilise WHERE utilisant = $idRecette;";
+ mysqli_query($c, $requeteSupprReutilises);
+
+ }else{
+ $requetePrincipale = "
+ INSERT INTO Recette (nom, tempsTotal, genre, unitePortion, nbPortion, realisation)
+ VALUES (
+ '$nom',
+ $tempsTotal,
+ $genre,
+ $unitePortion,
+ $nbPortion,
+ '$realisation'
+ );";
+ mysqli_query($c, $requetePrincipale);
+ $idRecette = mysqli_insert_id($c);
+ }
+
+ foreach($listeIngredients as $id => $ingredient){
+ $quantite = $ingredient['quantite'];
+ $unite = $ingredient['unite'];
+ $requete = "
+ INSERT INTO RecetteIngredient (ingredient, recette, quantite, unite)
+ VALUES (
+ $id,
+ $idRecette,
+ $quantite,
+ $unite
+ )
+ ;";
+ mysqli_query($c, $requete);
+ }
+
+ foreach($listeUstensile as $id => $ustensile){
+ $commentaire = mysqli_real_escape_string($c, $ustensile['commentaire']);
+ $requete = "
+ INSERT INTO RecetteUstensile (ustensile, recette, commentaire)
+ VALUES (
+ $id,
+ $idRecette,
+ '$commentaire'
+ )
+ ;";
+ mysqli_query($c, $requete);
+ }
+
+ foreach($listePreparation as $id => $preparation){
+ $duree = $preparation['duree'];
+ $temperature = $preparation['temp'];
+ $requete = "
+ INSERT INTO RecettePreparation (preparation, recette, duree, temperature)
+ VALUES (
+ $id,
+ $idRecette,
+ '$duree',
+ '$temperature'
+ )
+ ;";
+ mysqli_query($c, $requete);
+ }
+
+ foreach($listeReutilise as $id => $utilisee){
+ $requete = "
+ INSERT INTO Reutilise (utilisee, utilisant)
+ VALUES (
+ $id,
+ $idRecette
+ )
+ ;";
+ mysqli_query($c, $requete);
+ }
+ mysqli_commit($c);
+ }
+ catch (Exception $e){
+ mysqli_query('ROLLBACK');
+ $echec = true;
+ }
+
+ return $idRecette;
+}
+
+
+?>
diff --git a/inc/routes.php b/inc/routes.php
new file mode 100644
index 0000000..defdb19
--- /dev/null
+++ b/inc/routes.php
@@ -0,0 +1,83 @@
+ array(
+ 'controleur' => 'cAccueil',
+ 'vue' => 'vAccueil',
+ 'nom' => 'Accueil',
+ 'aside' => 'aAccueil',
+ 'script' => 'sAccueil'
+ ),
+
+ 'ajouterRecette' => array(
+ 'controleur' => 'cAjouterRecette',
+ 'vue' => 'vAjouterRecette',
+ 'nom' => 'Ajouter une recette',
+ 'aside' => 'aAjouterRecette',
+ 'script' => 'void'
+ ),
+
+ 'ajouterElement' => array(
+ 'controleur' => 'cAjouterElement',
+ 'vue' => 'vAjouterElement',
+ 'nom' => 'Ajouter des éléments',
+ 'aside' => 'void',
+ 'script' => 'void'
+ ),
+
+ 'statistiques' => array(
+ 'controleur' => 'cStatistiques',
+ 'vue' => 'vStatistiques',
+ 'nom' => 'Statistiques',
+ 'aside' => 'void',
+ 'script' => 'void'
+ ),
+
+ 'recette' => array(
+ 'controleur' => 'cRecette',
+ 'vue' => 'vRecette',
+ 'nom' => 'Recette',
+ 'aside' => 'aRecette',
+ 'script' => 'sRecette'
+ ),
+
+ 'supprimerRecette' => array(
+ 'controleur' => 'cSupprimerRecette',
+ 'vue' => 'vSupprimerRecette',
+ 'nom' => 'Suppresion d\'une recette',
+ 'aside' => 'void',
+ 'script' => 'void'
+ ),
+
+ 'supprimerElement' => array(
+ 'controleur' => 'cSupprimerElement',
+ 'vue' => 'vSupprimerElement',
+ 'nom' => 'Suppresion d\'un élément',
+ 'aside' => 'void',
+ 'script' => 'void'
+ ),
+
+ 'element' => array(
+ 'controleur' => 'cElement',
+ 'vue' => 'vElement',
+ 'nom' => '',
+ 'aside' => 'void',
+ 'script' => 'void'
+ ),
+
+ 'connexion' => array(
+ 'controleur' => 'cConnexion',
+ 'vue' => 'vConnexion',
+ 'nom' => 'Connexion',
+ 'aside' => 'void',
+ 'script' => 'void'
+ ),
+
+ 'test' => array(
+ 'controleur' => 'cTests',
+ 'vue' => 'vTests',
+ 'nom' => 'Tests',
+ 'aside' => 'void',
+ 'script' => 'void'
+ )
+ );
+?>
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..ad65c0c
--- /dev/null
+++ b/index.php
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+ = $titrePage ?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scripts/fonctions.js b/scripts/fonctions.js
new file mode 100644
index 0000000..4ed9146
--- /dev/null
+++ b/scripts/fonctions.js
@@ -0,0 +1,13 @@
+export var setEventSample = function(iRechercheIngredients, ldIngredients){
+ iRechercheIngredients.addEventListener('input', function (el, index, table){
+ Array.from(ldIngredients).forEach(function(el, index, ldIngredients){
+
+ if(RegExp("div-.*" + this.value, 'i').test(el.getAttribute('nom'))){
+ el.classList.remove('sample');
+ }
+ else{
+ el.classList.add("sample");
+ }
+ }, iRechercheIngredients);
+ });
+};
\ No newline at end of file
diff --git a/scripts/sAccueil.js b/scripts/sAccueil.js
new file mode 100644
index 0000000..647136a
--- /dev/null
+++ b/scripts/sAccueil.js
@@ -0,0 +1,9 @@
+import * as fonc from "./fonctions.js";
+
+window.onload = function(){
+ var iRechercheIngredients = document.getElementById('rechercheIngredients');
+ var ldIngredients = document.getElementsByClassName('divIngredient');
+
+ fonc.setEventSample(iRechercheIngredients, ldIngredients);
+
+}
\ No newline at end of file
diff --git a/scripts/sRecette.js b/scripts/sRecette.js
new file mode 100644
index 0000000..4dea939
--- /dev/null
+++ b/scripts/sRecette.js
@@ -0,0 +1,129 @@
+import * as fonc from "./fonctions.js";
+
+window.onload = function(){
+
+ var iRechercheIngredients = document.getElementById('rechercheIngredients');
+ var ldIngredients = document.getElementsByClassName('divIngredient');
+
+ fonc.setEventSample(iRechercheIngredients, ldIngredients);
+
+
+ var aCheckboxes = document.querySelectorAll('aside input.cb');
+ var liListeIngredients = document.getElementById('listeIngredients');
+ var liListeUstensiles = document.getElementById('listeUstensiles');
+ var liListePreparations = document.getElementById('listePreparations');
+ var ancreNoeudsReutilise = document.getElementById('ancreNoeudsReutilise');
+ if (liListeIngredients){
+ var sampleIngredient = document.getElementById('sampleIngredient');
+ var sampleUstensile = document.getElementById('sampleUstensile');
+ var samplePreparation = document.getElementById('samplePreparation');
+ for (var cb of aCheckboxes){
+ cb.onchange = function(){
+ if(this.checked){
+ this.parentNode.setAttribute('class', 'important')
+
+ }else{
+ this.parentNode.removeAttribute('class');
+ }
+
+ switch(this.className){
+ case 'autorise cb ingredient':
+ var id = this.getAttribute('idIngredient')
+ if (this.checked){
+ var nvlIngredient = sampleIngredient.cloneNode(true);
+ nvlIngredient.removeAttribute('class');
+ nvlIngredient.setAttribute('id', 'ingredient' + id);
+
+ var nomIngredient = this.getAttribute('nom') + ' : ';
+ var label = nvlIngredient.firstElementChild;
+ label.appendChild(document.createTextNode(nomIngredient));
+ label.setAttribute('for', 'ingredient' + id);
+
+ var input = label.nextElementSibling;
+ input.setAttribute('id', 'ingredient' + id);
+ input.setAttribute('name', 'ingredient[' + id + '][quantite]');
+ input.setAttribute('required', '');
+
+ var selectElem = input.nextElementSibling;
+ selectElem.setAttribute('name', 'ingredient[' + id + '][unite]');
+ selectElem.setAttribute('required', '');
+
+ liListeIngredients.appendChild(nvlIngredient);
+ }else{
+ document.getElementById('ingredient' + id).remove();
+ }
+ break;
+
+ case 'autorise cb ustensile':
+
+ var id = this.getAttribute('idUstensile')
+ if(this.checked){
+ var nvlUstensile = sampleUstensile.cloneNode(true);
+ nvlUstensile.removeAttribute('class');
+ nvlUstensile.setAttribute('id', 'ustensile' + id);
+
+ var nomUstensile = this.getAttribute('nom') + ' : ';
+ var label = nvlUstensile.firstElementChild;
+ label.appendChild(document.createTextNode(nomUstensile));
+ label.setAttribute('for', 'ustensile' + id);
+
+ var input = label.nextElementSibling;
+ input.setAttribute('name', 'ustensile[' + id + '][commentaire]');
+
+ liListeUstensiles.appendChild(nvlUstensile);
+ }else{
+ document.getElementById('ustensile' + id).remove();
+ }
+ break;
+
+ case 'autorise cb preparation':
+
+ var id = this.getAttribute('idPreparation')
+ if(this.checked){
+ var nvlPreparation = samplePreparation.cloneNode(true);
+ nvlPreparation.removeAttribute('class');
+ nvlPreparation.setAttribute('id', 'preparation' + id);
+
+ var nomPreparation = this.getAttribute('nom') + ' : ';
+ var label = nvlPreparation.firstElementChild;
+ label.appendChild(document.createTextNode(nomPreparation));
+
+ var inputDuree = label.nextElementSibling;
+ inputDuree.setAttribute('name', 'preparation[' + id + '][duree]');
+ inputDuree.setAttribute('required', true);
+
+ var inputTemp = label.nextElementSibling.nextElementSibling;
+ inputTemp.setAttribute('name', 'preparation[' + id + '][temp]');
+ inputTemp.setAttribute('required', true);
+
+ liListePreparations.appendChild(nvlPreparation);
+ }else{
+ document.getElementById('preparation' + id).remove();
+ }
+ break;
+
+ case 'autorise cb reutilise':
+
+ var id = this.getAttribute('idRecette');
+ if(this.checked){
+ var nvlInputReutilise = document.createElement('input');
+ nvlInputReutilise.setAttribute('name','reutilise[' + id + ']');
+ nvlInputReutilise.setAttribute('value', true);
+ nvlInputReutilise.setAttribute('type', 'hidden');
+
+ var nvlSpan = document.createElement('span');
+ nvlSpan.setAttribute('id', 'reutilise' + id);
+ var nvlText1 = document.createTextNode(this.getAttribute('nom') + String.fromCharCode(0x0020,0x00B7,0x0020));
+ nvlSpan.appendChild(nvlInputReutilise);
+ nvlSpan.appendChild(nvlText1);
+
+ ancreNoeudsReutilise.appendChild(nvlSpan);
+ }else{
+ document.getElementById('reutilise' + id).remove();
+ }
+
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/scripts/void.js b/scripts/void.js
new file mode 100644
index 0000000..e69de29
diff --git a/static/entete.php b/static/entete.php
new file mode 100644
index 0000000..74fddee
--- /dev/null
+++ b/static/entete.php
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/static/footer.php b/static/footer.php
new file mode 100644
index 0000000..ce1484e
--- /dev/null
+++ b/static/footer.php
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/static/menu.php b/static/menu.php
new file mode 100644
index 0000000..bbfaf54
--- /dev/null
+++ b/static/menu.php
@@ -0,0 +1,16 @@
+
+ Accueil
+ Ajouter une recette
+ Les éléments déjà présents
+ Statistiques
+
+
+ = !$_SESSION['auth'] ? 'Se connecter' : 'Se déconnecter'?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..0778eee
--- /dev/null
+++ b/style.css
@@ -0,0 +1,478 @@
+:root {
+ --couleur-principale: #d8d8f8;
+ --couleur-vert-1: #d8f0b0;
+ --couleur-rouge-1: #f0c8b0;
+ --couleur-gris-1: #f8f8f8;
+ --couleur-gris-2: #efefef;
+ --couleur-gris-3: #404040;
+ --couleur-gris-4: #242450;
+ --char-oui: '\2726';
+ --char-non: '\2727';
+ --char-fleche-droite: '\27a4';
+ --largeur-minimale: 50em;
+}
+
+body{
+ background-color: var(--couleur-gris-1);
+ color: var(--couleur-gris-4);
+ margin: 0px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+}
+h1{
+ font-size: 3em;
+}
+h2{
+ font-size: 2em;
+}
+h3{
+ font-size: 1.5em;
+}
+p{
+ font-size : 1em;
+}
+#central{
+ width: 100%;
+ display: flex;
+ flex-direction: row;
+ align-items: start;
+ justify-content: start;
+}
+
+#principal{
+ border: 1px var(--couleur-gris-4) solid;
+ border-top: none;
+ border-bottom: none;
+ padding: 10px;
+ background-color: var(--couleur-gris-2);
+
+ margin: 0%;
+ margin-top: 1%;
+ padding: 3%;
+
+ display: flex;
+ flex-direction: column;
+ flex-wrap: wrap;
+ align-items: left;
+
+ position: relative;
+ width: 40%;
+}
+
+nav, aside, #principal{
+ margin-left: 1%;
+}
+header, nav, footer, aside form{
+ margin: 0%;
+ padding: 3%;
+
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+ align-items: center;
+}
+nav, aside form{
+ flex-direction: column;
+ align-items: stretch;
+ justify-content: flex-end;
+}
+aside form{
+ width: 100%;
+}
+nav, aside{
+ width: 20%;
+ background-color: inherit;
+ border: none;
+}
+aside{
+ margin-left: 3%;
+}
+header, footer{
+ width: 100%;
+ padding: 0%;
+ background-color: var(--couleur-gris-2);
+}
+
+footer{
+ margin-top: 1%;
+}
+
+a{
+ color: var(--couleur-gris-3);
+}
+a:hover{
+ color : var(--couleur-principale);
+ background-color: var(--couleur-gris-3);
+}
+footer *, nav a, header a{
+ background-color: var(--couleur-principale);
+ margin: 1%;
+ padding: 1%;
+ border-radius: 20px;
+ font-size : 1em;
+ display: inline-flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ align-items: baseline;
+ justify-content: center;
+ transition: all 0.5s;
+}
+footer a:hover, nav a:hover, aside a:hover, header a:hover{
+ background-color: var(--couleur-gris-3);
+ border-radius: 0px;
+}
+
+header h1{
+ width: 100%;
+ margin: 0px;
+ padding: 0px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+header a{
+ text-align: center;
+ margin: 0%;
+ padding: 0%;
+
+ min-width: auto;
+ width: 60%;
+ height: 3ex;
+ border-radius: 2em;
+ transition: all 1s;
+}
+header a:hover{
+ width: 100%;
+ border-radius: 0px;
+}
+
+div.principaleAside, aside .button{
+ display:flex;
+ flex-direction: column;
+ align-items: flex-end;
+ background-color: var(--couleur-gris-2);
+ margin: 1%;
+ padding: 1%;
+ border-radius: 20px;
+ transition: all 0.5s;
+}
+
+div.principaleAside div {
+ margin: 0.5em;
+}
+
+aside .button{
+ border: none;
+ font-size: 1.2em;
+ font-family: serif;
+ font-weight: bold;
+ padding: 3ex;
+}
+div.principaleAside:hover, aside .button:hover{
+ border-radius: 0px;
+}
+#asideGenre {
+ align-items: center;
+}
+
+
+aside .button:hover {
+ background-color: var(--couleur-gris-3);
+ color: var(--couleur-principale);
+}
+
+label.petitLabel:hover {
+ text-decoration: underline;
+}
+
+aside > label, aside > form > label {
+ font-size: 2em;
+ align-self: flex-start;
+}
+
+form ul{
+ list-style-type: none;
+}
+
+div.recetteInfos{
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+}
+
+div.recette{
+ border: 1px var(--couleur-gris-4) solid;
+ border-left: none;
+ border-right: none;
+ margin: 0px;
+ margin-bottom: -1px;
+ padding: 1%;
+ height: 100%;
+
+ display: flex;
+ flex-direction: column;
+}
+
+div.recette:hover{
+ background-color: var(--couleur-principale);
+}
+div.recette a{
+ align-self: flex-start;
+ padding: 0%;
+ margin: 0%;
+ width: 99%;
+ border-radius: 20px;
+ transition: all 1s;
+}
+div.recette a:hover{
+ border-radius: 0px;
+}
+.recette a h3{
+ margin: 1%;
+}
+
+/*Gestion des input (au niveau du aside)*/
+
+input[type="radio"]{
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+ margin: 0px;
+}
+
+input[type="radio"]::after, input[type="checkbox"].choixTri::before{
+ border: none;
+ border-radius: 0.5ex;
+ color: var(--couleur-gris-3);
+ font-weight: bold;
+ font-size: 2em;
+ position: relative;
+ top: 0.4ex;
+
+ content: var(--char-non);
+
+ transition: all 0.2s;
+}
+
+input[type="radio"]:hover::after, input[type="checkbox"].choixTri:hover::before{
+ color: var(--couleur-gris-1);
+ border-radius: 0px;
+}
+
+input[type="radio"]:checked::after{
+ content: var(--char-oui);
+}
+
+input[type="radio"].autorise::after, input[type="checkbox"].choixTri.ustensile::before{
+ background-color: var(--couleur-principale);
+}
+input[type="radio"].interdit::after{
+ background-color: var(--couleur-rouge-1);
+ margin: 0px;
+}
+input[type="radio"].requis::after, input[type="checkbox"].choixTri.genre::before {
+ background-color: var(--couleur-vert-1);
+}
+
+span.choixTri {
+ width: 0px;
+ margin: 0px;
+}
+
+input[type="checkbox"].choixTri {
+ appearance: none;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+}
+
+
+input[type="checkbox"].choixTri.genre:checked::before, input[type="checkbox"].choixTri.ustensile:not(:checked)::before{
+ content: var(--char-oui);
+}
+
+input[type="checkbox"].choixTri.genre:not(:checked)::before, input[type="checkbox"].choixTri.ustensile:checked::before{
+ background-color: var(--couleur-rouge-1);
+}
+
+.centre{
+ text-align: center;
+}
+
+/*Gestion des dropdowns*/
+
+input[type="checkbox"].cb{
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+}
+
+input[type="checkbox"].cb + label::before,
+input[type="checkbox"].cb + label::after {
+ font-size: 1em;
+ padding: 0.2ex;
+}
+
+input[type="checkbox"].cb:not(:checked) + label::before,
+input[type="checkbox"].cb:not(:checked) + label::after{
+ content: var(--char-non);
+}
+
+input[type="checkbox"].cb:checked + label::before,
+input[type="checkbox"].cb:checked + label::after{
+ content: var(--char-oui);
+}
+
+input[type="checkbox"].dropdown {
+ -webkit-appearance: none;
+ appearance: none;
+}
+
+input[type="checkbox"].dropdown + label::before{
+ transition: all 0.2s;
+ display: inline-block;
+ content: ' ' var(--char-fleche-droite) ' ';
+}
+
+input[type="checkbox"].dropdown + label:hover::before{
+ color: var(--couleur-principale);
+}
+
+input[type="checkbox"].dropdown:checked + label::before {
+ transform: rotate(0.25turn);
+}
+
+input[type="checkbox"].dropdown:checked + * + div {
+ animation-duration: 0.2s;
+ animation-name: montrer;
+}
+
+input[type="checkbox"].dropdown:not(:checked) + * + div {
+ opacity: 0;
+ display: none;
+}
+
+@keyframes montrer {
+ 0%{
+ opacity: 0;
+ }
+ 100%{
+ opacity: 1;
+ }
+}
+
+#modifs{
+ align-self: flex-end;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+}
+
+#modifs>*{
+ border-radius: 1em;
+ transition: all 0.5s;
+}
+
+#edition, #suppression, #important {
+ padding: 0.5em;
+ text-decoration: underline;
+ border: none;
+ margin: 0px;
+ font-family: serif;
+ font-size: 1em;
+}
+
+#edition {
+ background-color: var(--couleur-vert-1);
+
+}
+
+#edition:hover {
+ color: var(--couleur-vert-1);
+ background-color: var(--couleur-gris-3);
+}
+
+#suppression {
+ background-color: var(--couleur-rouge-1);
+}
+
+#suppression:hover {
+ color: var(--couleur-rouge-1);
+ background-color: var(--couleur-gris-3);
+}
+
+#important{
+ background-color: var(--couleur-principale);
+}
+
+#important:hover {
+ color: var(--couleur-principale);
+ background-color: var(--couleur-gris-3);
+}
+
+.important {
+ color: var(--couleur-principale);
+ background-color: var(--couleur-gris-3);
+}
+div:hover > span.important{
+ color: var(--couleur-gris-3);
+ background-color: var(--couleur-principale);
+}
+
+
+.lock img, .unlock img{
+ border-radius: 1em;
+ height: 1em;
+}
+.lock img{
+ background-color: var(--couleur-vert-1);
+}
+.unlock img{
+ background-color: var(--couleur-rouge-1);
+}
+
+select{
+ border: none;
+}
+textarea{
+ width: 100%;
+}
+
+.sample{
+ display: none;
+}
+
+@media (max-width: 75em){
+ #central {
+ flex-direction: column;
+ align-items: center;
+ }
+
+ #principal{
+ width: 90%;
+ }
+
+
+ nav, footer{
+ flex-direction: row;
+ justify-content: center;
+ flex-wrap: wrap;
+ }
+ aside form{
+ width: 100%;
+ }
+ nav, aside{
+ width: 90%;
+ }
+
+ header a {
+ width: 100%;
+ }
+
+ div.recetteInfos{
+ display: flex;
+ flex-direction: column;
+ }
+}
diff --git a/vues/pageManquante.php b/vues/pageManquante.php
new file mode 100644
index 0000000..75d0c24
--- /dev/null
+++ b/vues/pageManquante.php
@@ -0,0 +1,3 @@
+
+La page recherchée n'existe pas (encore ?). Vous pouvez retourner à l'accueil
+
\ No newline at end of file
diff --git a/vues/vAccueil.php b/vues/vAccueil.php
new file mode 100644
index 0000000..02c7725
--- /dev/null
+++ b/vues/vAccueil.php
@@ -0,0 +1,18 @@
+
+
+ Bienvenue dans le classeur de recettes familiales !
+
+ = empty($listeRecettes) ? "Il n'y a pas de recette correspondant à ces critères ! Vous pouvez néanmoins en ajouter ..." : "" ?>
+ $recette): ?>
+
+
+
+ = !isset($listeRecettes) ? "Petit problème interne ..." : "" ?>
+
+
\ No newline at end of file
diff --git a/vues/vAjouterElement.php b/vues/vAjouterElement.php
new file mode 100644
index 0000000..f4d64b2
--- /dev/null
+++ b/vues/vAjouterElement.php
@@ -0,0 +1,60 @@
+
+ Liste des ingrédients existants :
+
+
+
+ Ajouter un ingrédient :
+
+
+
+ Liste des ustensiles existants :
+
+
+
+ Ajouter un ustensile :
+
+
+
+ Liste des unités existantes :
+
+
+
+ Ajouter une unité :
+
+
+
\ No newline at end of file
diff --git a/vues/vConnexion.php b/vues/vConnexion.php
new file mode 100644
index 0000000..f4b05e7
--- /dev/null
+++ b/vues/vConnexion.php
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+ Vous êtes connecté.e !
+
+
+
+ Echec de la connexion ... Vous pouvez rééssayer .
+
+
+
\ No newline at end of file
diff --git a/vues/vElement.php b/vues/vElement.php
new file mode 100644
index 0000000..8a3a81c
--- /dev/null
+++ b/vues/vElement.php
@@ -0,0 +1,38 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vues/vRecette.php b/vues/vRecette.php
new file mode 100644
index 0000000..22c01fc
--- /dev/null
+++ b/vues/vRecette.php
@@ -0,0 +1,318 @@
+
+
+
+
+
+
+
+
+
+ = $infoRecette['nom'] ?>
+ Pour = $infoRecette['portions'] . " " . $infoRecette['unite'] ?>
+
+ Réalisation : = $infoRecette['tempsTotal'] ?>
+
+ Genre : = $infoRecette['genre'] ?>
+
+ Ingrédient(s) :
+
+ $infos): ?>
+
+ = $infos['nom'] . " : " . $infos['quantite'] . " " . $infos['unite'] ?>
+
+
+
+
+ Ustensile(s) :
+
+ $infos): ?>
+
+ = $infos['nom'] . ($infos['commentaire'] ? (" : " . $infos['commentaire']) : "") ?>
+
+
+
+
+ Mode(s) de préparation :
+
+ $infos): ?>
+
+ = $infos['nom'] . " : " . $infos['duree'] . ($infos['temperature'] == '-' ? '' :" à " . $infos['temperature']) ?>
+
+
+
+
+ Procédure :
+
+ = $infoRecette['realisation'] ?>
+
+
+ Recette(s) liée(s) :
+
+
+ =SEPARATEUR?>
+
+ = $infos['nom'] ?>
+ =SEPARATEUR?>
+
+ Aucune
+
+
+
+
+
+
+
+
+
+
+Vous devez être connecté pour faire ça ! Vous pouvez le faire ici .
+
+
+
+
+
+
Attention ! La suppression d'une recette est définitive. Voulez vous continuer ?
+
+
+
+
+
+
+ Non, en fait
+
+
+
+
+Vous devez être connecté pour faire ça ! Vous pouvez le faire ici .
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vues/vStatistiques.php b/vues/vStatistiques.php
new file mode 100644
index 0000000..8c8b4e0
--- /dev/null
+++ b/vues/vStatistiques.php
@@ -0,0 +1,3 @@
+
+ Il y a actuellement =$nbRecettes?> recettes enregistrée(s).
+
\ No newline at end of file
diff --git a/vues/vSupprimerElement.php b/vues/vSupprimerElement.php
new file mode 100644
index 0000000..c3187c6
--- /dev/null
+++ b/vues/vSupprimerElement.php
@@ -0,0 +1,10 @@
+
+
+
+La suppresion s'est bien déroulée.
+
+L'élément n'a pas pû être supprimé
+Vérifiez qu'il existe (encore) et qu'il n'est utilisé dans aucune recette.
+
+Vous pouvez retourner à l'accueil ou à la liste des ingrédients
+
\ No newline at end of file
diff --git a/vues/vSupprimerRecette.php b/vues/vSupprimerRecette.php
new file mode 100644
index 0000000..031fa83
--- /dev/null
+++ b/vues/vSupprimerRecette.php
@@ -0,0 +1,10 @@
+
+
+
+La suppresion s'est bien déroulée.
+
+La recette n'a pas pû être supprimée
+Vérifiez qu'elle existe (encore) et qu'elle n'est utilisée nul part ailleur.
+
+Vous pouvez retourner à l'accueil ou à la liste des ingrédients
+
\ No newline at end of file
diff --git a/vues/vTests.php b/vues/vTests.php
new file mode 100644
index 0000000..953e870
--- /dev/null
+++ b/vues/vTests.php
@@ -0,0 +1,7 @@
+
\ No newline at end of file