cuisine/vues/vAjouterElement.php
Timothée Huneau 90be5dd519 Refactorisation passage à SLQite3 (début)
Pages faites :
- accueil
- statistiques
- ajouterElement
2025-02-23 23:56:23 +01:00

60 lines
No EOL
1.9 KiB
PHP

<section id="principal">
<h2>Liste des ingrédients existants :</h2>
<ul>
<?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>
<?php if($_SESSION['auth']): ?>
<p>Ajouter un ingrédient :</p>
<form method="POST" action="index.php?page=ajouterElement">
<label for="nomIngredient">Nom :</label>
<input type="text" name="nomIngredient" title="<?=DESC_CHAMPS_NOM?>" required />
<br/>
<p>Disponibilité :</p>
<?php foreach (lANNEE as $mois):?>
&#x00B7
<input type="checkbox" name="<?=$mois?>" id="<?=$mois?>" checked="true"/>
<label for="<?=$mois?>"><?=$mois?></label>
<?php endforeach ?>
&#x00B7
<br/>
<input type="submit" value="Ajouter l'ingrédient"/>
</form>
<?php endif ?>
<h2>Liste des ustensiles existants :</h2>
<ul>
<?php foreach($listeUstensile as $ustensile): ?>
<a href="index.php?page=element&type=ustensile&id=<?=$ustensile['id']?>"><li><?=$ustensile['nom']?></li></a>
<?php endforeach ?>
</ul>
<?php if($_SESSION['auth']): ?>
<p>Ajouter un ustensile :</p>
<form method="POST" action="index.php?page=ajouterElement">
<label for="nomUstensile">Nom :</label>
<input type="text" name="nomUstensile" title="<?=DESC_CHAMPS_NOM?>" required />
<br/>
<input type="submit" value="Ajouter l'ustensile"/>
</form>
<?php endif ?>
<h2>Liste des unités existantes :</h2>
<ul>
<?php foreach($listeUnite as $unite): ?>
<a href="index.php?page=element&type=unite&id=<?=$unite['id']?>"><li><?=$unite['nom']?></li></a>
<?php endforeach ?>
</ul>
<?php if($_SESSION['auth']): ?>
<p>Ajouter une unité :</p>
<form method="POST" action="index.php?page=ajouterElement">
<label for="nomUnite">Symbole :</label>
<input type="text" name="nomUnite" required />
<br/>
<input type="submit" value="Ajouter l'unité"/>
</form>
<?php endif ?>
</section>