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 62 63 64 65 66 67 68 69 70 71 72 73
| <?php
session_start(); //demarrage de la session
try
{
// On se connecte à MySQL
$bdd = new PDO('mysql:host=localhost;dbname=CaveVin;charset=utf8', ' ', ' ');
}
catch(Exception $e)
{
// En cas d'erreur, on affiche un message et on arrête tout
die('Erreur : '.$e->getMessage());
}
$Pseudo=$_SESSION['email'];
echo ' Utilisateur : '; echo $Pseudo;
if (!isset($Pseudo))
{
header('Location: test1.php');
}
else
{
//if (isset($_SESSION['panier']))
//{ si il y a une comande dans le caddie alors on affiche un lien au caddie
//echo "<div align='right'><a href='panier4_3_test.php'><b>VOIR CADDIE</b></a></div><br><br>";
//}
//if(!isset($_GET['prod'])){// pas de variable dans l'url
?>
<html>
<form action="panier4_3_test1.php" method="post">
<H1 align="center">Boutique de vin en ligne ....</H1>
<table border="1" bgcolor="cccccc" align="center" width="75%">
<tr bgcolor='white'>
<td width=''>ID Vin</td>
<td width=''>Nom Vin</td>
<td width=''>Type Vin</td>
<td width=''>Description Vin</td>
<td width=''>Prix Vin</td>
<td width=''>Capacite Vin</td>
<td width=''>Quantité carton(s)</td>
<td width=''> </td>
</tr>
<?php
//$sql="Select idVin,nomVin,typeVin,descriptionVin,prixVin,capaciteVin,stockVin FROM Vin";
$sql = $bdd->query("SELECT* FROM Vin ");
//$sqlexe = execute($sql);
//$req=mysql_query($sql);
while ($data = $sql->fetch())
{//la boucle pour l'affichage des données.
?>
<tr><td><input*type="hidden"*name="ids[]"*value="<?=$data["idVin"]?>"*/>
</td><td><?php echo $data['nomVin']?>
</td><td><?php echo $data['typeVin'] ?>
</td><td><?php echo $data['descriptionVin']?>
</td><td><?php echo $data['prixVin']?>
</td><td><?php echo $data['capaciteVin']?>
</td><td><input type="text" name="xx" value="<?=$data['xx']?>" />
</td><td><input type="submit" name="Panier" value="Panier"></input></td></tr>
<?php
}
}
?>
</form>
<a href="deconnect.php">Déconnection</a>
</html> |
Partager