Refactorisation passage à SLQite3 (début)
Pages faites : - accueil - statistiques - ajouterElement
This commit is contained in:
parent
c3ab5baad7
commit
90be5dd519
17 changed files with 1224 additions and 412 deletions
|
@ -1,8 +1,8 @@
|
|||
<section id="principal">
|
||||
<h2>Liste des ingrédients existants :</h2>
|
||||
<ul>
|
||||
<?php foreach($listeIngredient as $ingredient): ?>
|
||||
<li><a href="index.php?page=element&type=ingredient&id=<?=$ingredient[0]?>"><?=$ingredient[1]?></a> (<?=$ingredient[2]?>)</li>
|
||||
<?php foreach($listeIngredient as $id => $ingredient): ?>
|
||||
<a href="index.php?page=element&type=ingredient&id=<?=$ingredient['id']?>"><li><?=$ingredient['nom']?> (nbrecettes)</li></a>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
|||
<p>Ajouter un ingrédient :</p>
|
||||
<form method="POST" action="index.php?page=ajouterElement">
|
||||
<label for="nomIngredient">Nom :</label>
|
||||
<input type="text" name="nomIngredient" pattern="<?=PATTERN_CHAMPS_NOM?>" title="<?=DESC_CHAMPS_NOM?>" required />
|
||||
<input type="text" name="nomIngredient" title="<?=DESC_CHAMPS_NOM?>" required />
|
||||
<br/>
|
||||
<p>Disponibilité :</p>
|
||||
<?php foreach (lANNEE as $mois):?>
|
||||
|
@ -27,7 +27,7 @@
|
|||
<h2>Liste des ustensiles existants :</h2>
|
||||
<ul>
|
||||
<?php foreach($listeUstensile as $ustensile): ?>
|
||||
<li><a href="index.php?page=element&type=ustensile&id=<?=$ustensile[1]?>"><?=$ustensile[0]?></a></li>
|
||||
<a href="index.php?page=element&type=ustensile&id=<?=$ustensile['id']?>"><li><?=$ustensile['nom']?></li></a>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
<p>Ajouter un ustensile :</p>
|
||||
<form method="POST" action="index.php?page=ajouterElement">
|
||||
<label for="nomUstensile">Nom :</label>
|
||||
<input type="text" name="nomUstensile" pattern="<?=PATTERN_CHAMPS_NOM?>" title="<?=DESC_CHAMPS_NOM?>" required />
|
||||
<input type="text" name="nomUstensile" title="<?=DESC_CHAMPS_NOM?>" required />
|
||||
<br/>
|
||||
<input type="submit" value="Ajouter l'ustensile"/>
|
||||
</form>
|
||||
|
@ -44,7 +44,7 @@
|
|||
<h2>Liste des unités existantes :</h2>
|
||||
<ul>
|
||||
<?php foreach($listeUnite as $unite): ?>
|
||||
<li><a href="index.php?page=element&type=unite&id=<?=$unite[1]?>"><?=$unite[0]?></a></li>
|
||||
<a href="index.php?page=element&type=unite&id=<?=$unite['id']?>"><li><?=$unite['nom']?></li></a>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
<h3>Ingrédient(s) :</h3>
|
||||
<ul>
|
||||
<?php foreach ($listeIngredientsRecette as $id => $infos): ?>
|
||||
<?php foreach ($listeIngredientRecette as $id => $infos): ?>
|
||||
<li id="ingredient<?=D.$id?>">
|
||||
<?= $infos['nom'] . " : " . $infos['quantite'] . " " . $infos['unite'] ?>
|
||||
</li>
|
||||
|
@ -28,7 +28,7 @@
|
|||
|
||||
<h3>Ustensile(s) :</h3>
|
||||
<ul>
|
||||
<?php foreach ($listeUstensilesRecette as $id => $infos): ?>
|
||||
<?php foreach ($listeUstensileRecette as $id => $infos): ?>
|
||||
<li id="ustensile<?=D.$id?>">
|
||||
<?= $infos['nom'] . ($infos['commentaire'] ? (" : " . $infos['commentaire']) : "") ?>
|
||||
</li>
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
<h3>Mode(s) de préparation :</h3>
|
||||
<ul>
|
||||
<?php foreach ($listePreparationsRecette as $id => $infos): ?>
|
||||
<?php foreach ($listePreparationRecette as $id => $infos): ?>
|
||||
<li id="preparation<?=D.$id?>">
|
||||
<?= $infos['nom'] . " : " . $infos['duree'] . ($infos['temperature'] == '-' ? '' :" à " . $infos['temperature']) ?>
|
||||
</li>
|
||||
|
@ -82,7 +82,6 @@
|
|||
<input
|
||||
type="text"
|
||||
name="nom"
|
||||
pattern="<?= PATTERN_CHAMPS_NOM ?>"
|
||||
placeholder="Nom de la recette"
|
||||
<?php if($pageExiste == 2): ?>
|
||||
value="<?= $infoRecette['nom'] ?>"
|
||||
|
@ -95,7 +94,6 @@
|
|||
<input
|
||||
type="text"
|
||||
name="nbPortion"
|
||||
pattern="<?=PATTERN_CHAMPS_QUANTITE?>"
|
||||
title="<?=DESC_CHAMPS_QUANTITE?>"
|
||||
placeholder="Quantité"
|
||||
<?php if($pageExiste == 2): ?>
|
||||
|
@ -106,9 +104,9 @@
|
|||
/>
|
||||
<select name="unitePortion" required>
|
||||
<option disabled selected value="NULL"><span>Unité</span></option>
|
||||
<?php foreach ($listeUnite as $id => $nom): ?>
|
||||
<?php foreach ($listeUnite as $id => $unite): ?>
|
||||
<option value="<?=$id?>" <?= ($pageExiste == 2 and $infoRecette['idU'] == $id) ? 'selected' : '' ?>>
|
||||
<?=$nom?>
|
||||
<?=$unite['nom']?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
|
@ -117,7 +115,6 @@
|
|||
<input
|
||||
type="text"
|
||||
name="tempsTotal"
|
||||
pattern="<?=PATTERN_CHAMPS_DUREE?>"
|
||||
title="<?=DESC_CHAMPS_DUREE?>"
|
||||
placeholder="Durée total de réalisation"
|
||||
<?php if($pageExiste == 2): ?>
|
||||
|
@ -130,7 +127,7 @@
|
|||
<select required name="genre">
|
||||
<option disabled selected>Genre</option>
|
||||
<?php foreach($listeGenre as $id => $genre): ?>
|
||||
<option value="<?=$id?>" <?= ($pageExiste == 2 and $infoRecette['genre'] == $genre) ? 'selected' : '' ?> ><?=$genre?></option>
|
||||
<option value="<?=$id?>" <?= ($pageExiste == 2 and $infoRecette['genre'] == $genre['nom']) ? 'selected' : '' ?> ><?=$genre['nom']?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
|
||||
|
@ -141,7 +138,6 @@
|
|||
<label></label>
|
||||
<input
|
||||
type="text"
|
||||
pattern="<?=PATTERN_CHAMPS_QUANTITE?>"
|
||||
title="<?=DESC_CHAMPS_QUANTITE?>"
|
||||
placeholder="Quantité"
|
||||
/>
|
||||
|
@ -155,14 +151,13 @@
|
|||
</select>
|
||||
</li>
|
||||
<?php if($pageExiste == 2): ?>
|
||||
<?php foreach($listeIngredientsRecette as $idI => $ingredient): ?>
|
||||
<?php foreach($listeIngredientRecette as $idI => $ingredient): ?>
|
||||
<li id="ingredient<?= $idI ?>">
|
||||
<label for="ingredient[<?= $idI ?>]"><?=$ingredient['nom']?></label>
|
||||
:
|
||||
<input
|
||||
type="text"
|
||||
name="ingredient[<?= $idI?>][quantite]"
|
||||
pattern="<?=PATTERN_CHAMPS_QUANTITE?>"
|
||||
title="<?=DESC_CHAMPS_QUANTITE?>"
|
||||
value="<?= $ingredient['quantite'] ?>"
|
||||
placeholder="Quantité"
|
||||
|
@ -172,8 +167,8 @@
|
|||
<option disabled selected value="NULL"><span>Unité</span></option>
|
||||
<?php foreach ($listeUnite as $idU => $unite): ?>
|
||||
<option value="<?=$idU?>"
|
||||
<?= $listeIngredientsRecette[$idI]['idU'] == $idU ? 'selected' : '' ?>>
|
||||
<?=$unite?>
|
||||
<?= $listeIngredientRecette[$idI]['idU'] == $idU ? 'selected' : '' ?>>
|
||||
<?=$unite['nom']?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
|
@ -189,20 +184,18 @@
|
|||
<label></label>
|
||||
<input
|
||||
type="text"
|
||||
pattern="<?=PATTERN_CHAMPS_COMM?>"
|
||||
title="<?=DESC_CHAMPS_COMM?>"
|
||||
placeholder="Decription (éventuelle)"
|
||||
/>
|
||||
</li>
|
||||
<?php if($pageExiste == 2): ?>
|
||||
<?php foreach($listeUstensilesRecette as $id => $ustensile): ?>
|
||||
<?php foreach($listeUstensileRecette as $id => $ustensile): ?>
|
||||
<li id="ustensile<?=$id?>">
|
||||
<label for="ustensile<?=D.$id?>"><?=$ustensile['nom']?></label>
|
||||
:
|
||||
<input
|
||||
type="text"
|
||||
name="ustensile[<?=$id?>][commentaire]"
|
||||
pattern="<?=PATTERN_CHAMPS_COMM?>"
|
||||
title="<?=DESC_CHAMPS_COMM?>"
|
||||
placeholder="Description (éventuelle)"
|
||||
value="<?= $ustensile['commentaire'] ?>"
|
||||
|
@ -219,18 +212,16 @@
|
|||
pendant
|
||||
<input
|
||||
type="text"
|
||||
pattern="<?=PATTERN_CHAMPS_DUREE?>"
|
||||
title="<?=DESC_CHAMPS_DUREE?>"
|
||||
/>
|
||||
minutes, à
|
||||
<input
|
||||
type="text"
|
||||
pattern="<?=PATTERN_CHAMPS_TEMP?>"
|
||||
title="<?=DESC_CHAMPS_TEMP?>"
|
||||
/>
|
||||
</li>
|
||||
<?php if($pageExiste == 2): ?>
|
||||
<?php foreach($listePreparationsRecette as $id => $preparation): ?>
|
||||
<?php foreach($listePreparationRecette as $id => $preparation): ?>
|
||||
<li id="preparation<?=$id?>">
|
||||
<label><?=$preparation['nom']?></label>
|
||||
pendant
|
||||
|
@ -239,7 +230,6 @@
|
|||
required
|
||||
value="<?= $preparation['duree'] ?>"
|
||||
name="preparation[<?=$id?>][duree]"
|
||||
pattern="<?=PATTERN_CHAMPS_DUREE?>"
|
||||
title="<?=DESC_CHAMPS_DUREE?>"
|
||||
/>
|
||||
minutes, à
|
||||
|
@ -248,7 +238,6 @@
|
|||
required
|
||||
value="<?= $preparation['temperature'] ?>"
|
||||
name="preparation[<?=$id?>][temp]"
|
||||
pattern="<?=PATTERN_CHAMPS_TEMP?>"
|
||||
title="<?=DESC_CHAMPS_TEMP?>"
|
||||
/>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue