Panier d'achat pour la vente de pieces

Fermé
samirouche Messages postés 1 Date d'inscription mercredi 12 juin 2013 Statut Membre Dernière intervention 12 juin 2013 - Modifié par irongege le 16/06/2013 à 22:03
samiapirou Messages postés 112 Date d'inscription dimanche 16 juin 2013 Statut Membre Dernière intervention 11 novembre 2015 - 16 juin 2013 à 22:01
salut je voudrais faire un panier d'achat pour la vente de pieces en ligne et j'ai fait 3 programme suivant mais le problème c'est que aucune donnée n'apparit dans la base de donné donc voici les pgrmme: le premier s'appelel panier.php::::::<?php
session_start();
if(isset($_SESSION['log_cli'])){
?>

<?php

include_once("fonction_panier.php");

$erreur = false;

$action = (isset($_POST['action'])? $_POST['action']: (isset($_GET['action'])? $_GET['action']:null )) ;
if($action !== null)
{
if(!in_array($action,array('ajout', 'suppression', 'refresh', 'valider')))
$erreur=true;

//récuperation des variables en POST ou GET
$id = (isset($_POST['id'])? $_POST['id']: (isset($_GET['id'])? $_GET['id']:null )) ;
$l = (isset($_POST['l'])? $_POST['l']: (isset($_GET['l'])? $_GET['l']:null )) ;
$p = (isset($_POST['p'])? $_POST['p']: (isset($_GET['p'])? $_GET['p']:null )) ;
$q = (isset($_POST['q'])? $_POST['q']: (isset($_GET['q'])? $_GET['q']:null )) ;

//Suppression des espaces verticaux
$l = preg_replace('#\v#', '',$l);
//On verifie que $p soit un float
$p = floatval($p);

//On traite $q qui peut etre un entier simple ou un tableau d'entier

if (is_array($q)){
$QteArticle = array();
$i=0;
foreach ($q as $contenu){
$QteArticle[$i++] = intval($contenu);
}
}
else
$q = intval($q);

}

if (!$erreur){
switch($action){
Case "ajout":
ajouterArticle($id,$l,$q,$p);
break;

Case "suppression":
supprimerArticle($l);
break;

Case "refresh" :
for ($i = 0 ; $i < count($QteArticle) ; $i++)
{
modifierQTeArticle($_SESSION['panier']['libellePiece'][$i],round($QteArticle[$i]));
}
break;
Case "valider":
validercommande($id);
break;
svp
Default:
break;
}
}

echo '<?xml version="1.0" encoding="utf-8"?>';?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<style type="text/css">
<!--
body {
background-repeat: repeat-x;
background-image: url(image/fond_degrader.jpg);
}
.Style1 {
font-size: x-large;
font-style: italic;
font-weight: bold;
}
#centre {
width: 850px;
margin: auto;
margin-top:15px;
text-align: left;
border-style: solid solid none solid;
border-color: #564EA3;
border-width: 1px;
background: #ffffff;

-moz-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-webkit-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-khtml-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
}

#r {
background-image: url(image/9609580-multicolore-banniere-ondee-vif-avec-des-etoiles.jpg);
width: 850px;
-moz-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-webkit-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-khtml-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
}
#ok {
overflow:scroll;
height:508px;
border-style: solid solid none solid;
border-color: #677D92;
border-width: 2px;
margin-top:0px;
/* Haurizental/Vertical (H-Gauche H-Droite B-Droite B-Gauche)*/
-moz-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-webkit-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-khtml-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
}
#sam {

border-style: solid solid none solid;
border-color: #677D92;
border-width: 2px;
background:#ffffff;
/* Haurizental/Vertical (H-Gauche H-Droite B-Droite B-Gauche)*/
-moz-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-webkit-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-khtml-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
}

#g img{
/* Haurizental/Vertical (H-Gauche H-Droite B-Droite B-Gauche)*/
-moz-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-webkit-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-khtml-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
}
.Style2 {
font-size: 36px;
font-style: italic;
font-weight: bold;
}

-->
</style></head>

<body><div id="centre"><div id="r">
<table width="848" border="0">
<tr>
<td width="842" height="112"><div align="center" class="Style2">DBS AUTO </div></td>
</tr>
</table></div>
<table width="840" border="0">
<tr>
<td width="209" height="410"><div id="sam"><table width="205" height="505" border="0">
<tr>
<td width="199" height="55"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload2.macromedia.com/get/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="199" height="35">
<param name="BGCOLOR" value="" />
<param name="movie" value="button15.swf" />
<param name="quality" value="high" />
<embed src="button15.swf" quality="high" pluginspage="https://get.adobe.com/flashplayer/" type="application/x-shockwave-flash" width="199" height="35" ></embed>
</object></td>
</tr>
<tr>
<td height="53"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload2.macromedia.com/get/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="199" height="35">
<param name="BGCOLOR" value="" />
<param name="movie" value="button19.swf" />
<param name="quality" value="high" />
<embed src="button19.swf" quality="high" pluginspage="https://get.adobe.com/flashplayer/" type="application/x-shockwave-flash" width="199" height="35" ></embed>
</object></td>
</tr>
<tr>
<td height="64"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload2.macromedia.com/get/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="199" height="35">
<param name="BGCOLOR" value="" />
<param name="movie" value="button83.swf" />
<param name="quality" value="high" />
<embed src="button83.swf" quality="high" pluginspage="https://get.adobe.com/flashplayer/" type="application/x-shockwave-flash" width="199" height="35" ></embed>
</object></td>
</tr>
<tr>
<td height="49"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload2.macromedia.com/get/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="199" height="35">
<param name="movie" value="button96.swf" />
<param name="quality" value="high" />
<embed src="button96.swf" quality="high" pluginspage="https://get.adobe.com/flashplayer/" type="application/x-shockwave-flash" width="199" height="35" ></embed>
</object></td>
</tr>
<tr>
<td height="66"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload2.macromedia.com/get/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="199" height="35">
<param name="movie" value="button105.swf" />
<param name="quality" value="high" />
<embed src="button105.swf" quality="high" pluginspage="https://get.adobe.com/flashplayer/" type="application/x-shockwave-flash" width="199" height="35" ></embed>
</object></td>
</tr>
<tr>
<td height="52"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload2.macromedia.com/get/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="199" height="35">
<param name="movie" value="button85.swf" />
<param name="quality" value="high" />
<embed src="button85.swf" quality="high" pluginspage="https://get.adobe.com/flashplayer/" type="application/x-shockwave-flash" width="199" height="35" ></embed>
</object></td>
</tr>
<tr>
<td height="69"> </td>
</tr>
<tr>
<td height="21"> </td>
</tr>
</table>
</div></td>
<td width="621"><div id="ok"><table width="613" height="528" border="0">
<tr>
<td width="607" height="77"><div align="center" class="Style1">
Votre panier
<p> </p>
</div></td>
</tr>
<tr>
<td height="256"><form id="form1" name="form1" method="post" action="panier.php">
<table width="573" border="0">
<tr>
<td width="100" height="21">Libellé</td>
<td width="83">Quantité</td>

<td width="104">Prix unitaire </td>
<td width="241">Action</td>
</tr>


<?php
if (creationPanier())
{
$nbArticles=count($_SESSION['panier']['libellePiece']);
if ($nbArticles <= 0)
echo "<tr><td></br></br>Votre panier est vide </ td></tr>";
else
{
for ($i=0 ;$i < $nbArticles ; $i++)
{
echo "<tr>";
echo "<td>".htmlspecialchars($_SESSION['panier']['libellePiece'][$i])."</ td>";
echo "<td><input type=\"text\" size=\"4\" name=\"q[]\" value=\"".htmlspecialchars($_SESSION['panier']['qtePiece'][$i])."\"/></td>";
echo "<td>".htmlspecialchars($_SESSION['panier']['prixPiece'][$i])."</td>";
echo "<td><div id='aj_panier'><a href=\"".htmlspecialchars("panier.php?action=suppression&l=".rawurlencode($_SESSION['panier']['libellePiece'][$i]))."\">Supprimer</a></div></td>";
echo "</tr>";
}

echo "<tr><td colspan=\"2\"> </td>";
echo "<td colspan=\"2\">";
echo "</br>";
echo "Total : ".MontantGlobal();
echo "</td></tr>";
echo "<tr><td colspan=\"4\">";
echo "<input type=\"submit\" id='raf' value=\"Rafraichir\"/>";
echo "<input type=\"hidden\" name=\"action\" value=\"refresh\"/></td>";
echo "</td></tr>";
echo "<tr><td colspan=\"4\" align=center>";
echo "</br></br> <a href='commande_clt.php' text-decoration='none'>Commander</a>";
echo "</td></tr>";
}
}
?>



<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td><p> </p>
<p> </p></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td height="21"><p> </p> </td>
</tr>
</table>
</div></td>
</tr>
</table></div>
</body>
</html>
<?php
}else{header("Location: authentification_client.php");}
?>


l'autre panier_fonction.php :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::



<?php

function creationPanier(){
if (!isset($_SESSION['panier'])){
$_SESSION['panier']=array();
$_SESSION['panier']['ident'] = array();
$_SESSION['panier']['libellePiece'] = array();
$_SESSION['panier']['qtePiece'] = array();
$_SESSION['panier']['prixPiece'] = array();
$_SESSION['panier']['verrou'] = false;
}
return true;
}

function ajouterArticle($ident,$libellePiece,$qtePiece,$prixPiece){

//Si le panier existe
if (creationPanier() && !isVerrouille())
{
//Si le produit existe déjà on ajoute seulement la quantité
$positionPiece = array_search($libellePiece, $_SESSION['panier']['libellePiece']);

if ($positionProduit !== false)
{
$_SESSION['panier']['qtePiece'][$positionPiece] += $qtePiece ;
}
else
{
//Sinon on ajoute le produit
array_push( $_SESSION['panier']['ident'],$ident);
array_push( $_SESSION['panier']['libelleProduit'],$libellePiece);
array_push( $_SESSION['panier']['qteProduit'],$qtePiece);
array_push( $_SESSION['panier']['prixProduit'],$prixPiece);
}
}
else
echo "Un problème est survenu veuillez contacter l'administrateur du site.";
}

function modifierQTeArticle($libellePiece,$qtePiece){
//Si le panier éxiste
if (creationPanier() && !isVerrouille())
{
//Si la quantité est positive on modifie sinon on supprime l'article
if ($qtePiece > 0)
{
//Recharche du produit dans le panier
$positionPiece = array_search($libellePiece, $_SESSION['panier']['libellePiece']);

if ($positionPiece !== false)
{
$_SESSION['panier']['qtePiece'][$positionPiece] = $qtePiece ;
}
}
else
supprimerArticle($libellePiece);
}
else
echo "Un problème est survenu veuillez contacter l'administrateur du site.";
}

function supprimerArticle($libellePiece){
//Si le panier existe
if (creationPanier() && !isVerrouille())
{
//Nous allons passer par un panier temporaire
$tmp=array();
$tmp['ident'] = array();
$tmp['libellePiece'] = array();
$tmp['qtePiece'] = array();
$tmp['prixPiece'] = array();
$tmp['verrou'] = $_SESSION['panier']['verrou'];

for($i = 0; $i < count($_SESSION['panier']['libellePiece']); $i++)
{
if ($_SESSION['panier']['libellePiece'][$i] !== $libellePiece)
{
array_push( $tmp['ident'],$_SESSION['panier']['ident'][$i]);
array_push( $tmp['libellePiece'],$_SESSION['panier']['libellePiece'][$i]);
array_push( $tmp['qtePiece'],$_SESSION['panier']['qtePiece'][$i]);
array_push( $tmp['prixPiece'],$_SESSION['panier']['prixPiece'][$i]);
}

}
//On remplace le panier en session par notre panier temporaire à jour
$_SESSION['panier'] = $tmp;
//On efface notre panier temporaire
unset($tmp);
}
else
echo "Un problème est survenu veuillez contacter l'administrateur du site.";
}

function MontantGlobal(){
$total=0;
for($i = 0; $i < count($_SESSION['panier']['libellePiece']); $i++)
{
$total += $_SESSION['panier']['qtePiece'][$i] * $_SESSION['panier']['prixPiece'][$i];
}
return $total;
}

function supprimePanier(){
unset($_SESSION['panier']);
}

function isVerrouille(){
if (isset($_SESSION['panier']) && $_SESSION['panier']['verrou'])
return true;
else
return false;
}

function compterArticles()
{
if (isset($_SESSION['panier']))
return count($_SESSION['panier']['libellePiece']);
else
return 0;

}

function validercommande($ident)
{
$connection = mysql_connect("localhost","root","");
if ( ! $connection )
die ("connection impossible");

//On sélectionne la BDD
$mabasededonnee="bdd";
mysql_select_db($mabasededonnee) or die ("pas de connection");


if (creationPanier())
{
isVerrouille();

$montant=MontantGlobal();
$client=$_SESSION['id_cli'];

$req ="INSERT INTO commande (num_com,date_com,montant_com,id_client,valid_cmd) VALUES ('',curdate(),'$montant','$client','0')";
mysql_query($req,$connection);


$az=mysql_query("SELECT * FROM commande ");
$k=0;
while ($k<mysql_num_rows($az))
{
$zz=mysql_fetch_row($az);
$num_comm=$zz[0];
$k=$k+1;
}


for($i = 0; $i < count($_SESSION['panier']['libellePiece']); $i++)
{
$num_piece= $_SESSION['panier']['ident'][$i];
$qtt_piece= $_SESSION['panier']['qtePiece'][$i];

$requete ="INSERT INTO commande_piece (id_piece,num_p,num_cmd,qtt) VALUES ('','$num_piece','$num_comm','$qtt_piece')";
mysql_query($requete,$connection);
}

mysql_close($connection);
supprimePanier();

header("Location: commande_clt.php") ;
}

}

?>
ce dernier programme dont lequel va affiché les commandes:::::::::::::








<?php
session_start();
if(isset($_SESSION['log_cli'])){
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<style type="text/css">
<!--
body {
background-repeat: repeat-x;
background-image: url(image/fond_degrader.jpg);
}
.Style1 {
font-size: x-large;
font-style: italic;
font-weight: bold;
}
#centre {
width: 850px;
margin: auto;
margin-top:15px;
text-align: left;
border-style: solid solid none solid;
border-color: #564EA3;
border-width: 1px;
background: #ffffff;

-moz-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-webkit-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-khtml-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
}

#r {
background-image: url(image/9609580-multicolore-banniere-ondee-vif-avec-des-etoiles.jpg);
width: 850px;
-moz-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-webkit-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-khtml-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
}
#ok {
border-style: solid solid none solid;
border-color: #677D92;
border-width: 2px;
margin-top:0px;
/* Haurizental/Vertical (H-Gauche H-Droite B-Droite B-Gauche)*/
-moz-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-webkit-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-khtml-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
}
#sam {

border-style: solid solid none solid;
border-color: #677D92;
border-width: 2px;
background:#ffffff;
/* Haurizental/Vertical (H-Gauche H-Droite B-Droite B-Gauche)*/
-moz-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-webkit-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
-khtml-border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
border-radius: 15px 15px 0px 0px / 15px 15px 0px 0px;
}

#g img{
/* Haurizental/Vertical (H-Gauche H-Droite B-Droite B-Gauche)*/
-moz-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-webkit-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
-khtml-border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
border-radius: 15px 15px 15px 15px / 15px 15px 15px 15px;
}
.Style2 {
font-size: 36px;
font-style: italic;
font-weight: bold;
}
.Style3 {font-size: 18px}

-->
</style></head>

<body><div id="centre"><div id="r">
<table width="849" border="0">
<tr>
<td width="843" height="112"><div align="center" class="Style2">DBS AUTO </div></td>
</tr>
</table></div>
<table width="849" border="0">
<tr>
<td width="209"><div id="sam"><table width="205" height="585" border="0">
<tr>
<td width="199" height="42"> </td>
</tr>
<tr>
<td height="43"> </td>
</tr>
<tr>
<td height="43"> </td>
</tr>
<tr>
<td height="37"> </td>
</tr>
<tr>
<td height="43"> </td>
</tr>
<tr>
<td height="45"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="98"> </td>
</tr>
</table>
</div></td>
<td width="630"><div id="ok"><table width="625" height="585" border="0">
<tr>
<td height="29" colspan="2"><div align="center" class="Style1">
espace commande
</div></td>
</tr>
<tr>
<td height="180" colspan="2">
<p align="center" class="Style3">

<?php


//connexion a la base
$connection = mysql_connect("localhost","root","");
if ( ! $connection )
die ("connection impossible");

//On sélectionne la BDD
$mabasededonnee="bdd";
mysql_select_db($mabasededonnee) or die ("pas de connection");
$e=$_SESSION['id_cli'];


$req=mysql_query("SELECT * FROM commande where ((id_client='$e') && (valid_cmd='0'))") or die(mysql_error()) ;
$i=0;


while ($i<mysql_num_rows($req))
{
$ligne=mysql_fetch_row($req);
echo"
<table class='affich' align='center' cellspacing='1' >
<tr>
<td width=70%>
<b>Numéro commande :</b> ".$ligne[0]."
";$r=mysql_query("SELECT * FROM client WHERE id_client=".$ligne[0]."");
$li=mysql_fetch_row($r);
echo"
<br><b>Nom client : </b>".$li[1]."
<br><b>Prénom client : </b>".$li[2]."<br>

<br><b>Quantité X Prix U</b> | <b>Nom PIECE</b> <br><br>
";


$az=mysql_query("SELECT * FROM commande_piece WHERE num_commande=".$ligne[0]."");
$k=0;
while ($k<mysql_num_rows($az))
{
$zz=mysql_fetch_row($az);


$produit=mysql_query("SELECT * FROM piece WHERE num_piece=".$zz[1]."");


$pro=mysql_fetch_row($piece);
echo "(".$zz[3]." X ".$pro[4]." DA) -------- ".$pro[1]."<br>";

$k=$k+1;
};echo"

<br><b>Montant Total à payer : </b>".$ligne[2]." DA

</td>

<td align=center>
<div id='aj_panier'><a href=\"#\" onClick=\"confirme('".$ligne[0]."')\" >Annuler Commande</a>
</div>";
echo"</td></tr>
</table>";
echo"";
echo"<HR>";

$i=$i+1;

}

$req=mysql_query("SELECT * FROM commande WHERE ((id_client='$e') && (valid_cmd='1'))")or die(mysql_error());
$i=0;


while ($i<mysql_num_rows($req))
{
$ligne=mysql_fetch_row($req);
echo"
<table class='affich' align='center' cellspacing='1' >
<tr>
<td width=70%>
<b>Numéro commande :</b> ".$ligne[0]."
";
$r=mysql_query("SELECT * FROM client WHERE id_client='$ligne[1]'");
$li=mysql_fetch_row($r);
echo"
<br><b>Nom client : </b>".$li[1]."
<br><b>Prénom client : </b>".$li[2]."<br>

<br><b>Quantité X Prix U</b> | <b>Nom Piece</b> <br><br>
";


$az=mysql_query("SELECT * FROM commande_piece WHERE num_commande=".$ligne[0]."");
$k=0;
while ($k<mysql_num_rows($az))
{
$zz=mysql_fetch_row($az);


$produit=mysql_query("selectt * FROM piece WHERE num_piece=".$zz[1]."");


$pro=mysql_fetch_row($piece);
echo "(".$zz[3]." X ".$pro[4]." DA) -------- ".$pro[1]."<br>";

$k=$k+1;
};echo"

<br><b>Montant Total à payer : </b>".$ligne[2]." DA

</td>
<td align=center>
<div id='commande_OK'><a>Commande Validée</a>
</div></td>
</tr>
</table>";
echo"";
echo"<HR>";

$i=$i+1;

}





$req=mysql_query("select * from commande where ((id_client='$e') && (valid_cmd='-1'))")or die(mysql_error());
$i=0;


while ($i<mysql_num_rows($req))
{
$ligne=mysql_fetch_row($req);
echo"
<table class='affich' align='center' cellspacing='1' >
<tr>
<td width=70%>
<b>Numéro commande :</b> ".$ligne[0]."
";$r=mysql_query("select * from client where id_client=".$ligne[1]."");
$li=mysql_fetch_row($r);
echo"
<br><b>Nom client : </b>".$li[1]."
<br><b>Prénom client : </b>".$li[2]."<br>

<br><b>Quantité X Prix U</b> | <b>Nom Produit</b> <br><br>
";


$az=mysql_query("select * from 'commande_piece' where num_cmd=".$ligne[0]."");
$k=0;
while ($k<mysql_num_rows($az))
{
$zz=mysql_fetch_row($az);


$produit=mysql_query("select * from piece where num_p=".$zz[1]."");


$pro=mysql_fetch_row($piece);
echo "(".$zz[3]." X ".$pro[4]." DA) -------- ".$pro[1]."<br>";

$k=$k+1;
};echo"

<br><b>Montant Total à payer : </b>".$ligne[2]." DA

</td>
<td>
<div id='commande_Non'><a>Commande Rejetée<br>
Veuillez contacter le vendeur</a>
</div>
</td></tr>
</table>";
echo"";
echo"<HR>";

$i=$i+1;

}




mysql_free_result($req);

mysql_close($connection); //Puis on se déconnecte
?>
</p>
</td>
</tr>
<tr>
<td height="-1" colspan="2"><p> </p>
</td>
</tr>
<tr>
<td width="241" height="0"> </td>
<td width="374"> </td>
</tr>
<tr>
<td width="241" height="2"> </td>
<td> </td>
</tr>
<tr>
<td width="241" height="5"> </td>
<td> </td>
</tr>
<tr>
<td width="241" height="13"> </td>
<td> </td>
</tr>
<tr>
<td width="241" height="61"> </td>
<td> </td>
</tr>
</table>
</div></td>
</tr>
</table></div>
</body>
</html>
<?php
}else{header("Location: authentification_client.php");}
?>
svp aider moi ..........Merci d'avance
A voir également:

1 réponse

blux Messages postés 26490 Date d'inscription dimanche 26 août 2001 Statut Modérateur Dernière intervention 18 novembre 2024 3 316
12 juin 2013 à 20:58
Salut,

et tu crois qu'on va corriger tout ça ?
Donne plus de précisions ou fais du débug...
2
telliak Messages postés 3667 Date d'inscription mercredi 20 septembre 2006 Statut Membre Dernière intervention 4 novembre 2024 876
12 juin 2013 à 21:05
Juste 750 lignes, sans aucun commentaire !
0
samiapirou Messages postés 112 Date d'inscription dimanche 16 juin 2013 Statut Membre Dernière intervention 11 novembre 2015 1
16 juin 2013 à 22:01
n'importe quoi
0