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
| $articles = explode ("/", $_COOKIE['pbwebdevis']); //On explose le cookie
$result = count($articles); //On compte combien il y a d'articles
echo "<br />";
echo "<table>\n";
echo "<tr>\n";
echo '<td id="tableCheck"></td><td id="tableReference">Référence</td><td id="tableNom">Nom</td><td id="tablePrix">Prix</td>';
echo "</tr>\n";
$i=0;
for ($i = 0; $i < $result; $i++) //Boucle pour afficher le contenu du cookie/devis
{
$art = substr($articles[$i], 1, 6);
//Requete sql pour afficher les informations de chaque article ajouté dans le panier
$sql_article = "SELECT Ref_Constructeur, Nom_Produit, Prix_Vente_Euro FROM Produit WHERE Ref_Constructeur='".$art."'";
echo $sql_article;
echo "<br />";
echo $art;
echo "<br />";
$envoi_article = sqlsrv_query($connection, $sql_article);
$article = sqlsrv_fetch_array( $envoi_article, SQLSRV_FETCH_ASSOC);
echo "<tr>";
echo "<td><input type=\"checkbox\" name=\"sup\" /></td>";
echo "<td>".$article['Nom_Produit']."</td>";
echo "<td>".round($article['Prix_Vente_Euro'], 2)." €</td>";
echo "</tr>";
}
echo "</table>"; |