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
| //Avant ces lignes, j'ai récupéré et affiché les coordonnées de l'acheteur//
if (creationPanier())
{
$nbArticles=count($_SESSION['panier']['libelle']);
for ($i=0 ;$i < $nbArticles ; $i++)
echo "<td>".htmlspecialchars($_SESSION['panier']['libelle'][$i])."</ td>";
echo "<td>".htmlspecialchars($_SESSION['panier']['fournisseur'][$i])."</ td>";
echo "<td>".htmlspecialchars($_SESSION['panier']['ref'][$i])."</ td>";
echo "<td><input type='text' size='3' name='QteArticle[]' value='".htmlspecialchars($_SESSION['panier']['qte'][$i])."'/></td>";
echo "<td>".sprintf("%01.2f",$_SESSION['panier']['price'][$i])."</td>";
echo "<td>".sprintf("%01.2f",$_SESSION['panier']['total'][$i] = $_SESSION['panier']['qte'][$i] * $_SESSION['panier']['price'][$i])."</td>";
echo "<td>".sprintf("%01.2f",$_SESSION['panier']['gain'][$i])."</td>";
echo "<td>".sprintf("%01.2f",$_SESSION['panier']['totalgain'][$i] = $_SESSION['panier']['qte'][$i] * $_SESSION['panier']['gain'][$i])."</td>";
$libelle = addslashes($_SESSION['panier']['libelle'][$i]);
$hid = addslashes($_SESSION['panier']['fournisseur'][$i]);
$ref = htmlspecialchars($_SESSION['panier']['ref'][$i]);
$qte = htmlspecialchars($_SESSION['panier']['qte'][$i]);
$price = sprintf("%01.2f",$_SESSION['panier']['price'][$i]);
}
echo "Totaux (en euros) : </td>";
echo "<td>".sprintf("%01.2f",MontantGlobal());
echo "</td>";
echo "<td>".sprintf("%01.2f",MontantGain());
echo "</td>";
echo "</tr>";
echo "</table>";
}
$now = date("d/m/Y");
$sql = "INSERT INTO sbbcmde VALUES ('','$ref', '$libelle', '$qte', '$price', '$nom', '$adresse', '$cp', '$ville', '$tel', '$mobile', '$email', '$comments', '$hid', '$now')";
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error()); |
Partager