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
| //Code PHP :
<?php
$reqCat = odbc_do($connexion, "SELECT * FROM produits");
$afficheCat = odbc_fetch_array($reqCat);
$verif=odbc_do($connexion, "SELECT * FROM panier where id_membre = '" . $_SESSION["id_user"] . "'");
$verifPanier=odbc_fetch_array($verif);
echo"
<table width='70%' cellspacing='0' cellpadding='2' align='center'>"; //border='black'
while ($afficheCat != FALSE)
{
$idPanierProd=$verifPanier['id_prod'];
$numProd = $afficheCat['numProd'];
$nomProd = $afficheCat ['nomProd'];
$prixProd = $afficheCat ['prixProd'];
$imageProd = $afficheCat ['imageProd'];
echo"
<tr bgcolor='#FF77CC'>
<td width='17%'><b>nom du produit</b></td>
<td>$nomProd</td>
<td><img>$imageProd</img></td>
<td rowspan='2'>";if ($idPanierProd!=$numProd) { echo "<a href=\"index2.php?affiche=ajoutpanier&id=$numProd\">ajouter au panier</a>" ;} else {echo "article déja ajouté";} echo"</td> </tr>
<tr>
<td><b>Prix</b></td>
<td>$prixProd ?</td>
</tr>
<tr><td><br></td></tr>
";
$verifPanier=odbc_fetch_array($verif);
$afficheCat = odbc_fetch_array($reqCat);
}
?>
//FIN DU CODE |
Partager