Recuperer information

cedgigi
Invité n'ayant pas de compte PHPfrance

06 juin 2005, 13:28

Bonjour a tous je suis debutant autant pour le forum que pour le php

Voila j'aurais voulus savoir s'il serait possible d'ameliorer se code.

Car sur la page commande je ne veut pas choisir la commande mais que sa affiche les informations directement c'est a dire le nom, prenom, le nombre d'article, le nom des articles etc...
<select name="commandeID" id="commandeID">
                <?php
do {  
?>
                <option value="<?php echo $row_rsSelectCommande['ID']?>"
				<?php if (!(strcmp($row_rsSelectCommande['ID'], $HTTP_GET_VARS['commandeID']))) 
				{echo "SELECTED";} ?>>
				N°<?php echo $row_rsSelectCommande['ID']?> 
				du <?php echo $row_rsSelectCommande['date']?></option>
                <?php
} while ($row_rsSelectCommande = mysql_fetch_assoc($rsSelectCommande));
  $rows = mysql_num_rows($rsSelectCommande);
  if($rows > 0) {
      mysql_data_seek($rsSelectCommande, 0);
	  $row_rsSelectCommande = mysql_fetch_assoc($rsSelectCommande);
  }
  
?>
              </select>

Administrateur PHPfrance
Administrateur PHPfrance | 430 Messages

06 juin 2005, 16:30

je comprend pas ta question : tu est en train de construire un select et tu demande que ca affiche nom, prenom, le nombre d'article, le nom des articles pour chaque commande (donc plusieurs lignes pour une commande ..)

Sinon voila comment améliorer ton code :
<select name="commandeID" id="commandeID">
<?php
while ($row_rsSelectCommande = mysql_fetch_assoc($rsSelectCommande)) {  
                echo '<option value="'.$row_rsSelectCommande['ID']'." ';
                if(!strcmp($row_rsSelectCommande['ID'], $_GET['commandeID']))
                   echo 'SELECTED';
                echo ' >';
                echo 'N° '.$row_rsSelectCommande['ID'];
                echo ' du '.$row_rsSelectCommande['date'].'</option>';
}  
?>
</select>
  • met ta condition d'arret en début : imagine qu'il n'y ai pas d'enregistrement
    en plus avec ta version tu insère un "option" blanc puisque tu n'as pas encore les données lors de la première itération
  • quand tu as peu de texte et beaucoup de variables php a afficher, c'est plus propre de mettre le texte dans les echo, ca évite d'ouvrir des blocs php en permanence => gain de place et performance
  • j'ai supprimé ton "$rows = mysql_num_rows...." parceque je n'en ai pas compris l'utilité

Invité
Invité n'ayant pas de compte PHPfrance

06 juin 2005, 16:57

merci cerber je ne m'attendais plus a une reponce

ben en faite c'est dur a expliquer il faudrais voir le site mes je ses pas si j'ai le droit bon tanpis je le met www.doseurs-moran.com pour remplir le formulaire vous mettais n'importe quoi dans nom ,prenom etc

Administrateur PHPfrance
Administrateur PHPfrance | 430 Messages

06 juin 2005, 17:10

dsl je peux pas faire ca maintenant, j'ai un accès très limité au net au travail (j'ai aprement négocié phpfrance), je verrais cas dans la soirée si j'ai le temps de passer sur mon ordi a la maison ...

CEDGIGI
Invité n'ayant pas de compte PHPfrance

06 juin 2005, 17:13

a oui j'ai une erreur sur le code que tu ma donnes la voila

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in c:\program files\easyphp1-7\www\siteboutiquemoran\panier\commande.php on line 346


Mais je suppose que c'est normal car quand on n'a pas tout le code de la page c'est tres dur mais moi je pense que sa ferait un peut long a afficher.

Administrateur PHPfrance
Administrateur PHPfrance | 430 Messages

06 juin 2005, 17:14

arf oui c'est là : j'ai merdé au dernier point :
echo '<option value="'.$row_rsSelectCommande['ID']'." ';
ce qui donne :
<select name="commandeID" id="commandeID">
<?php
while ($row_rsSelectCommande = mysql_fetch_assoc($rsSelectCommande)) {  
                echo '<option value="'.$row_rsSelectCommande['ID'].'" ';
                if(!strcmp($row_rsSelectCommande['ID'], $_GET['commandeID']))
                   echo 'SELECTED';
                echo ' >';
                echo 'N° '.$row_rsSelectCommande['ID'];
                echo ' du '.$row_rsSelectCommande['date'].'</option>';
}  
?>
</select>

cedgigi
Invité n'ayant pas de compte PHPfrance

06 juin 2005, 17:16

Merci cerber tu sais je ne demande pas de resoudre sa desuite moi sa dois faire 1 mois que je suis sur la finalisation de se site alors il me reste le chose les plus durs pour moi en tout cas a faire

Mais merci quand même

cedgigi
Invité n'ayant pas de compte PHPfrance

06 juin 2005, 17:52

Merci mais pour le nouveau code j'ai un autre erreur

notice : Undefined index : commandeID in c:\program files\easyphp1-7\www\site boutiquemoran\panier\commande.php on line 347 <N° 23 du 2004-12-20

C'est dur moi je ni pipe que dal

ViPHP
fab
ViPHP | 2657 Messages

06 juin 2005, 18:13

c'est laquelle ta ligne 347 ?
cette erreur veut dre que tu as tenté d'utilisé une variable qui n'a pas été définie précédement

cedgigi
Invité n'ayant pas de compte PHPfrance

06 juin 2005, 18:22

Salut fa

ma ligne 347 c'est celle la

if(!strcmp($row_rsSelectCommande['ID'], $_GET['commandeID']))

cedgigi
Invité n'ayant pas de compte PHPfrance

06 juin 2005, 18:32

Desolé fab pas fa décidement ce code va me faire tourner en bourique

Voila j'ai decide de mettre le code entier de ma page commande , en faite c'est une page qui recapipette tout les données entré par l'utilisateur avant alors c'est parti

A oui si vous voye le moyen de mettre de l'ordre dans tous sa je vous en serait tres reconnaissant.
<?php
session_start();
//test si client déjà identifié
if (!isset($HTTP_SESSION_VARS['statut'])||($HTTP_SESSION_VARS['statut'] != "client"))
?>
<?php
//init des variables 
if (!isset($HTTP_GET_VARS['commandeID'])) $HTTP_GET_VARS['commandeID']=0;
if (!isset($HTTP_SESSION_VARS['statut'])) $statut="NON IDENTIFIE";
else $statut=$HTTP_SESSION_VARS['statut'];
if (!isset($HTTP_SESSION_VARS['action'])) $action="";
else $action=$HTTP_SESSION_VARS['action'];
if (!isset($HTTP_SESSION_VARS['liste'])) $liste[]=array(0,1,0,"VIDE",0,0);//init de liste si VIDE
else $liste=$HTTP_SESSION_VARS['liste'];//recup de la liste de la session
if (!isset($HTTP_SESSION_VARS['total'])) $total=0;
else $total=$HTTP_SESSION_VARS['total'];
if (!isset($HTTP_SESSION_VARS['clientID'])) $clientID=0;
else $clientID=$HTTP_SESSION_VARS['clientID'];
?>
<?php require_once('../Connections/ConnexionBoutiqueMoran.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

if ((isset($_POST['commandeID'])) && ($_POST['commandeID'] != "")) {
  $deleteSQL = sprintf("DELETE FROM client WHERE ID=%s",
                       GetSQLValueString($_POST['commandeID'], "int"));

  mysql_select_db($database_ConnexionBoutiqueMoran, $ConnexionBoutiqueMoran);
  $Result1 = mysql_query($deleteSQL, $ConnexionBoutiqueMoran) or die(mysql_error());
}

if (($action=="enregistre")&&($statut== "client"))
	{
	mysql_select_db($database_ConnexionBoutiqueMoran, $ConnexionBoutiqueMoran);
	$insertCommande = "INSERT INTO commande (date, clientID, total) VALUES (NOW(),'$clientID', '$total')";
	$Result1 = mysql_query($insertCommande, $ConnexionBoutiqueMoran) or die(mysql_error()); 
	$commandeID=mysql_insert_id();//récupère l'identifiant client attibué 
	//recupération des articles et quantité et enregistrement dans la table listes
	  for ($i=0;$i<count($liste);$i++)
		{
		$artID=$liste[$i][0];
		$reference=$liste[$i][2];//récup de la réf de l'article dans le panier
		$nom=$liste[$i][3];
		$prixUnitaire=$liste[$i][4];
		$quantite=$liste[$i][1];//récup de la quantité de cet article dans le panier
		$prixArticle=$liste[$i][5];//récup du prix total de ces articles (nb * prix unitaire) dans le panier
		$insertListe = "INSERT INTO liste (commandeID,artID, reference, quantite, nom, prixUnitaire, prixArticle) VALUES ('$commandeID', 'artID','$reference', '$quantite','$nom', '$prixUnitaire','$prixArticle')";
		$Result2 = mysql_query($insertListe, $ConnexionBoutiqueMoran) or die(mysql_error()); 
		}
		
		 
	//destruction de la liste, du total et du drapeau action de la session et redirection vers commande.php
	session_unregister("liste");
	session_unregister("total");
	session_unregister("action");
	
	}//fin du if ($action="enregistre")
	
	$colname_rsSelectCommande = "1";
if (isset($_SESSION['clientID'])) {
  $colname_rsSelectCommande = (get_magic_quotes_gpc()) ? $_SESSION['clientID'] : addslashes($_SESSION['clientID']);
}
mysql_select_db($database_ConnexionBoutiqueMoran, $ConnexionBoutiqueMoran);
$query_rsSelectCommande = sprintf("SELECT ID, `date`, clientID FROM commande WHERE clientID = '%s' ORDER BY ID DESC", $colname_rsSelectCommande);
$rsSelectCommande = mysql_query($query_rsSelectCommande, $ConnexionBoutiqueMoran) or die(mysql_error());
$row_rsSelectCommande = mysql_fetch_assoc($rsSelectCommande);
$totalRows_rsSelectCommande = mysql_num_rows($rsSelectCommande);

$colname_rsListe = "0";
if (isset($HTTP_GET_VARS['commandeID'])) {
  $colname_rsListe = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['commandeID'] : addslashes($HTTP_GET_VARS['commandeID']);
}
mysql_select_db($database_ConnexionBoutiqueMoran, $ConnexionBoutiqueMoran);
$query_rsListe = sprintf("SELECT artID, reference, nom, prixUnitaire, quantite, prixArticle FROM liste WHERE commandeID = '%s' ORDER BY artID ASC", $colname_rsListe);
$rsListe = mysql_query($query_rsListe, $ConnexionBoutiqueMoran) or die(mysql_error());
$row_rsListe = mysql_fetch_assoc($rsListe);
$totalRows_rsListe = mysql_num_rows($rsListe);

$colname_rsCommande = "0";
if (isset($HTTP_GET_VARS['commandeID'])) {
  $colname_rsCommande = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['commandeID'] : addslashes($HTTP_GET_VARS['commandeID']);
}
mysql_select_db($database_ConnexionBoutiqueMoran, $ConnexionBoutiqueMoran);
$query_rsCommande = sprintf("SELECT commande.`date`, commande.total, client.nom,client.prenom,client.adresse,client.ville,client.cp,client.tel,client.email,commande.ID FROM commande,client WHERE commande.ID=%s AND commande.clientID=client.ID", $colname_rsCommande);
$rsCommande = mysql_query($query_rsCommande, $ConnexionBoutiqueMoran) or die(mysql_error());
$row_rsCommande = mysql_fetch_assoc($rsCommande);
$totalRows_rsCommande = mysql_num_rows($rsCommande);
?>
 <?php
	
	$adresse = "";
	$sujet = "Commande\n\n";
	$message = "{$row_rsCommande['prenom']} {$row_rsCommande['nom']} a imprimé le bon de commande\n\n";
	$message .='
	<html>
<head>

<title>Commande</title>
<style type="text/css">
<!--
.style1 {
	color: #0000CC;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<table width="574" border="0" cellspacing="0" cellpadding="0">
  <tr>
   <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
    <td colspan="2"><div align="center">
      <p> <span class="style1">BON DE COMMANDE  </span><br>
      </p>
    </div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="260">';
	$message .= "Commande n&deg: {$row_rsCommande['ID']}";  
	$message .='</td>
    <td width="205">';
	$message .= "du: {$row_rsCommande['date']}";
	$message .=' </td>
    <td width="333">';
	$message .="Mr/Md:  {$row_rsCommande['nom']}";
	$message .='</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">Nom:</div></td>
    <td><div align="center"></div>';
	$message .= "{$row_rsCommande['nom']}";
	$message .='</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">Prenom:</div></td>
    <td><div align="center"></div>';
	$message .= "{$row_rsCommande['prenom']}";
	$message .='</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">Adresse:</div></td>
    <td><div align="center"></div>';
	$message .= "{$row_rsCommande['adresse']}";
	$message .='</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">Ville:</div></td>
    <td><div align="center"></div>';
	$message .= "{$row_rsCommande['ville']}";
	$message .='</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">Code postal: </div></td>
    <td><div align="center"></div>';
	$message .= "{$row_rsCommande['cp']}";
	$message .='</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">T&eacute;l&eacute;phone:</div></td>
    <td><div align="center"></div>';
	$message .= "{$row_rsCommande['tel']}";
	$message .='</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center">Email:</div></td>
    <td><div align="center"></div>';
	$message .= "{$row_rsCommande['email']}";
	$message .='</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>

 
</table>
</body>
</html>
';
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: {$row_rsCommande['email']}\n";
if(isset($_GET['act']) && $_GET['act']=="AFFICHER")
   
	mail ($adresse, $sujet, $message,$headers);
	 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>CommandeMoran</title>
<style> @media print {.ignorer {display: none;}} </style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style1 {
	color: #000066;
	font-weight: bold;
}
.style3 {color: #0000CC}
.ignorer {
}
.style4 {color: #FF0000}
.style6 {color: #000099}
.ignorer1 {display: none;}
.ignorer1 {}
.style7 {
	font-size: 24;
	font-weight: bold;
}
.style9 {color: #FF0000; font-weight: bold; }
.style10 {color: #0000FF}
.style12 {
	font-size: 12px;
	color: #FF0000;
}
-->
</style>
</head>

<body onLoad="MM_preloadImages('../images/bout%20accueil2.jpg','../images/bout%20panier2.jpg','../images/bout%20doseur2.jpg')">
<table width="700" border="0" cellpadding="0" cellspacing="0" class="ignorer">
  <tr>
    <td width="89"><img src="../images/cataloguemoran_r1_c1.gif" width="89" height="65"></td>
    <td width="80"><img src="../images/cataloguemoran_r1_c2.gif" width="80" height="65"></td>
    <td width="161"><img src="../images/cataloguemoran_r1_c3.gif" width="161" height="65"></td>
    <td width="128"><img src="../images/cataloguemoran_r1_c4.gif" width="128" height="65"></td>
    <td width="136"><img src="../images/cataloguemoran_r1_c5.gif" width="136" height="65"></td>
    <td width="163"><img src="../images/bars.gif" width="162" height="65"></td>
    <td width="44"><img src="../images/cataloguemoran_r1_c7.gif" width="44" height="65"></td>
  </tr>
  <tr>
    <td><img src="../images/cataloguemoran_r2_c1.gif" width="89" height="40"></td>
    <td><img src="../images/cataloguemoran_r2_c2.gif" width="80" height="40"></td>
    <td><img src="../images/cataloguemoran_r2_c3.gif" width="161" height="40"></td>
    <td><img src="../images/cataloguemoran_r2_c4.gif" width="128" height="40"></td>
    <td><img src="../images/cataloguemoran_r2_c5.gif" width="136" height="40"></td>
    <td><img src="../images/cataloguemoran_r2_c6.gif" width="162" height="40"></td>
    <td><img src="../images/cataloguemoran_r2_c7.gif" width="44" height="40"></td>
  </tr>
  <tr>
    <td><img src="../images/cataloguemoran_r3_c1.gif" width="89" height="48"></td>
    <td><img src="../images/inter%202.gif" width="80" height="48"></td>
    <td><a href="../accueil2/index2.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bout acc','','../images/bout%20accueil2.jpg',1)"><img src="../images/bout%20accueil1.jpg" name="bout acc" width="161" height="48" border="0"></a></td>
    <td colspan="2"><a href="cataloge.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bout doseur','','../images/bout%20doseur2.jpg',1)"><img src="../images/bout%20doseur1.jpg" name="bout doseur" width="264" height="48" border="0"></a></td>
    <td><a href="panier.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bout panier','','../images/bout%20panier2.jpg',1)"><img src="../images/bout%20panier1.jpg" name="bout panier" width="162" height="48" border="0"></a></td>
    <td><img src="../images/cataloguemoran_r3_c7.gif" width="44" height="48"></td>
  </tr>
</table>
<table width="637" height="873" border="0" cellpadding="0" cellspacing="0" bordercolor="#BE9903">
  <tr>
    <td width="635" height="615" valign="top"><table width="635" height="898" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="4" height="38"><div align="left">
          
        </div></td>
        <td width="631">
         <form name="form1" method="get" action="commande.php">
           <p align="center" class="style4"><strong>IMPORTANT :</strong> pour recevoir votre commande il est imp&eacute;ratif d'envoyer le bon imprim&eacute; avec votre r&egrave;glement &agrave; l'adresse indiqu&eacute;e au bas de cette page. </p>
           <table width="500" border="1" align="center" cellspacing="0" class="ignorer">
          <tr>
            <td width="236"><div align="right"><span class="style9">Afficher la commande</span> : </div></td>
            <td width="254">
              <select name="commandeID" id="commandeID"> 
<?php 
while ($row_rsSelectCommande = mysql_fetch_assoc($rsSelectCommande)) {   
                echo '<option value="'.$row_rsSelectCommande['ID'].'" '; 
                if(!strcmp($row_rsSelectCommande['ID'], $_GET['commandeID'])) 
                   echo 'SELECTED'; 
                echo ' >'; 
                echo 'N° '.$row_rsSelectCommande['ID']; 
                echo ' du '.$row_rsSelectCommande['date'].'</option>'; 
}   
?> 
</select> 
              <input name="act" type="submit" id="act" value="AFFICHER">
              </td>
          </tr>
        </table>
      </form>
          <table width="532" border="0" align="center" cellpadding="0" cellspacing="0" class="ignorer">
            <tr>
              
            </tr>
          </table>        </td>
      </tr>
      <tr>
        <td height="559">&nbsp;</td>
        <td valign="top">
		
          <form action="validation.php" method="post" name="form2" id="form2">
            <div align="left"></div>
			
            <table width="631" height="449" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="798" valign="top">
                  <table width="594" height="119" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="299"><div align="left"><img src="../images/logo.jpg" width="229" height="134"></div></td>
                      <td width="295" valign="top"><p align="left"><br>
                            <strong>Facture/Commande</strong> N&deg; : <span class="style3"><?php echo $row_rsSelectCommande['ID']; ?></span></p>
                        <p align="left"><strong>Du : </strong><span class="style3"><?php $date=date("d / m / Y à G:i:s"); echo $date; ?></span></p>
                        <p align="left"><strong>Mr/Mme : </strong><span class="style3"><?php echo $row_rsCommande['nom']; ?></span></p></td>
                    </tr>
                  </table>
                  <div align="center">
                    <p><span class="style7">PAIEMENT PAR CHEQUE </span><br>
                    </p>
                    </div>
                  <table width="611" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BE9903">
                    <tr>
                      <td width="214" bgcolor="#FCE383"><div align="center"><strong>D&eacute;signation</strong></div></td>
                      <td width="147" bgcolor="#FCE383"><div align="center"><strong> Prix Unitaire </strong></div></td>
                      <td width="121" bgcolor="#FCE383"><div align="center"><strong>Quantit&eacute;</strong></div></td>
                      <td width="167" bgcolor="#FCE383"><div align="center"><strong>Prix total </strong></div></td>
                    </tr>
                    <?php do { ?>
                    <tr>
                      <td height="21"><div align="center" class="style3"><?php echo $row_rsListe['nom']; ?></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsListe['prixUnitaire']; ?></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsListe['quantite']; ?></div></td>
                      <td><div align="center"><span class="style3"><?php echo $row_rsListe['prixArticle']; ?></span> <span class="style10">&euro;</span> </div></td>
                    </tr>
                    <?php } while ($row_rsListe = mysql_fetch_assoc($rsListe)); ?>
                  </table>
                  <br>
                  <table width="615" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#BE9903">
                    <tr>
                      <td>&nbsp;</td>
                      <td height="28"><div align="right"><strong>Prix total &agrave; payer TTC (Port compris)<span class="style4">*</span>:</strong></div></td>
                      <td bordercolor="#ECE9D8"><div align="center"><span class="style4"><?php echo $row_rsCommande['total']; ?></span> <span class="style4">&euro;</span></div></td>
                    </tr>
                    <tr>
                      <td width="172">&nbsp;</td>
                      <td width="287" height="19"><div align="center"><span class="style12"> (* Le prix  tient compte de la r&eacute;duction de 15 %. )</span> </div></td>
                      <td width="156" bordercolor="#ECE9D8"><div align="center"></div></td>
                    </tr>
                  </table>
                  <p>&nbsp;</p>
                  <table width="529" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BE9903">
                    <tr bgcolor="#BE9903">
                      <td colspan="2"><div align="center"><strong>ADRESSE DE FACTURATION ET DE LIVRAISON </strong></div></td>
                    </tr>
                    <tr>
                      <td width="266">&nbsp;</td>
                      <td width="257">&nbsp;</td>
                    </tr>
                    <tr>
                      <td bgcolor="#FCE383"><div align="right"><strong>NOM : </strong></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsCommande['nom']; ?></div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FCE383"><div align="right"><strong>PRENOM : </strong></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsCommande['prenom']; ?></div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FCE383"><div align="right"><strong>ADRESSE : </strong></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsCommande['adresse']; ?></div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FCE383"><div align="right"><strong>VILLE : </strong></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsCommande['ville']; ?></div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FCE383"><div align="right"><strong>CODE POSTAL : </strong></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsCommande['cp']; ?></div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FCE383"><div align="right"><strong>TELEPHONE : </strong></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsCommande['tel']; ?></div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FCE383"><div align="right"><strong>E-MAIL : </strong></div></td>
                      <td><div align="center" class="style3"><?php echo $row_rsCommande['email']; ?></div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#FFFFFF">&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                </table>
                  <p align="center">Pour toute commande 1 tire bouchon m&eacute;tallique offert.<br>
                    <span class="style4">+
                    </span><br>
                      Pour<span class="style6"> 50.00 &euro;</span> d'achats minimum 1 bec verseur offert.<br>
Pour <span class="style6">100.00 &euro;</span> d'achats minimum 1 bec doseur offert.<br>
Pour<span class="style6"> 150.00 &euro;</span> d'achats minimum 1 doseur poussoir non anis&eacute; offert.</p>
                  <table width="583" border="0" align="center" cellpadding="0" cellspacing="0" class="ignorer">
                    <tr>
                      <td width="568"><div align="center"><strong>
                        <input name="imprimer" type="submit" class="none" onClick="window.print()" value="Imprimer la facture">
                      </strong></div></td>
                      <td width="15"><div align="center">
                      </div></td>
                    </tr>
                  </table>



                 </td>
              </tr>
            </table>
          </form>
          <table width="631" height="86" border="0" cellpadding="0" cellspacing="0" class="ignorer">
            <tr>
              <td width="618" valign="top"><p align="center"><span class="style1">Paiement par ch&egrave;que :</span><br>
                    <br>
                    Imprimer la facture puis l'exp&eacute;dier  avec votre r&egrave;glement &agrave; l'ordre : <strong>SAS ATLANTIC BARS</strong> &agrave; l'adresse suivante : </p>
                <p align="center"><strong>2, Z.A Migelane - 33650 SAUCATS - FRANCE</strong><strong>
                </strong></p>
                </td>
              <td width="13" valign="top"><div align="center" class="non">
                <p class="style1">&nbsp;</p>
                <p>&nbsp;                </p>
              </div></td>
            </tr>
          </table>          </td>
      </tr>
    </table>
    <div align="left"></div></td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
<?php

mysql_free_result($rsSelectCommande);

mysql_free_result($rsListe);

mysql_free_result($rsCommande);


?>

Administrateur PHPfrance
Administrateur PHPfrance | 430 Messages

07 juin 2005, 09:44

g pas le temps de tout lire (eh oui, faut bosser ;) ), mais ca rimme a quoi cette ligne :
$message .= "{$row_rsCommande['email']}";
pourquoi tu déclanche un parsing de chaîne (qui est quelque chose de très long) alors qu'une simple concaténation suffit :)
$message .= $row_rsCommande['email'];
sinon, pour en revenir a ton undefined index, c'est normal : le $_GET['commandeID'] n'est pas toujours renseigné .... donc :
if(defined($_GET['commandeID']) && !strcmp($row_rsSelectCommande['ID'], $_GET['commandeID']))