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
| <?php
class Panier{
private $id_client;
private $type;
function Panier( $id_client_cst, $connexion_cst){
$this-> id_client=$id_client_cst;
$this-> connexion=$connexion_cst;
}
public function listerPanierQueryESS($id_client){
$q = "SELECT Panier.id_client AS id_clientpan, Panier.login AS loginpan, Panier.id_article AS id_articlepan,
Panier.type AS typepan, Panier.quantite AS quantitepan, Article.prix AS prixart FROM Panier INNER JOIN Article ON
Panier.id_article = Article.id where Panier.id_client='".$id_client."'";
$result = mysql_query($q, $this->connexion) or die(mysql_error());
//$var = mysql_fetch_object ($result);
return mysql_fetch_object ($result);
}
}
?>
<?php
$stk = new Panier($id_client, $c);
$result2=$stk->listerPanierQueryESS($id_client);
while( $result2){
$id_client =$result2-> id_clientpan ;
$login=$result2-> loginpan;
$id_article=$result2-> id_articlepan;
$type=$result2-> typepan;
echo" <tr>
<td>".$id_client."</td>
<td>".$login."</td>
<td>". $id_article."</td>
<td>".$type."</td>
</tr>";
}
?> |
Partager