1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| <?php session_start(); ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<title>Grossiste</title>
</head>
<body>
<header>
<h1>Grossiste</h1>
<h2>En pharmacie</h2>
</header>
<nav>
<ul>
<li><a href="index.php">Accueil</a></li>
<li><a href="membres.php">Mon compte</a></li>
<li><a href="produit.php">Produits</a></li>
<li> <?php echo $_SESSION['pseudo']; ?> </li>
<li><a href="deconnexion.php">Se deconnecter</a></li>
</ul>
</nav>
<div class="bordure">
</div>
<section>
<article></article>
<div></div>
<?php
try {
$bdd = new PDO('mysql:host=localhost;dbname=base;charset=utf8', 'root', '', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
}
catch (Exception $e){
die('erreur :'.$e->getMessage());
}
$reponse = $bdd->query('SELECT * FROM produit');
?>
<table>
<tbody>
<?php
include "traitement.php";
while ($donnees = $reponse->fetch()){
?>
<tr>
<td><?php echo $donnees['nom']; ?></td>
<td><?php echo $donnees['prix']; ?></td>
<td><?php echo $donnees['quantite']; ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><form action="panier.php" method = "POST"><input type="hidden" name="id_produit" value="<?php echo $donnees['id'];?>"/> <INPUT TYPE="submit" NAME="panier" VALUE=" Ajouter "> </form></td>
<td><form action="traitement.php" method = "POST"><input type="hidden" name="qtt" value="<?php echo $donnees['id'];?>"/> <INPUT TYPE="submit" NAME="quantite" VALUE=" +1 "> </form></td>
</tr>
<?php
}
?>
<a href="panier.php">Panier</a>
</tbody>
</table>
</body>
</html> |