269 lines
7.8 KiB
PHP
Executable File
269 lines
7.8 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
$idcmde=$HTTP_GET_VARS["idcmde"];
|
|
?>
|
|
<html>
|
|
<head>
|
|
<title>
|
|
Partie Membres
|
|
</title>
|
|
<link href="../style.css" rel="stylesheet" type="text/css">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
|
|
<!--
|
|
a:link {
|
|
color: #FFFFFF;
|
|
text-decoration: none;
|
|
}
|
|
a:visited {
|
|
text-decoration: none;
|
|
color: #FFFFFF;
|
|
}
|
|
a:hover {
|
|
text-decoration: underline;
|
|
color: #FFFFFF;
|
|
}
|
|
a:active {
|
|
text-decoration: none;
|
|
color: #FFFFFF;
|
|
}
|
|
-->
|
|
</style></head>
|
|
<body class="bgcolor" text="white">
|
|
|
|
<p><br>
|
|
<br>
|
|
<b>Information sur la commande</b></p>
|
|
<p><br>
|
|
<br>
|
|
</p>
|
|
<table border=0 align="center">
|
|
<tr align=center>
|
|
<td>
|
|
date
|
|
</td>
|
|
<td>
|
|
montant
|
|
</td>
|
|
<td>
|
|
Etat
|
|
</td>
|
|
<td>
|
|
Mode de paiement
|
|
</td>
|
|
<td>
|
|
Commentaires
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
if (isset($_SESSION['client']))
|
|
{
|
|
require("../connexion.php");
|
|
$conn = mysql_connect($host, $user, $password);
|
|
mysql_select_db($bdd) or die("Impossible d'ouvrir la base de donnee $bdd");
|
|
|
|
$requete1 = "select idcmde,datecmde,montantcmde,etatcmde,modepaiement,message,idcli from commande where idcli='$idcli' and idcmde='$idcmde'";
|
|
$result1=mysql_query($requete1) or die ("Erreur SQL :$requete1<br>".mysql_error()."...");
|
|
|
|
while ($ligne1=mysql_fetch_row($result1))
|
|
{
|
|
$idcmde=$ligne1[0];
|
|
$datecmde=$ligne1[1];
|
|
$montantcmde=$ligne1[2];
|
|
$etatcmde=$ligne1[3];
|
|
$modepaiement=$ligne1[4];
|
|
$message=$ligne1[5];
|
|
$idcli=$ligne1[6];
|
|
?>
|
|
<tr align=center>
|
|
<td>
|
|
<?php
|
|
print $datecmde;
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
print $montantcmde;
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
if ($etatcmde=="print")
|
|
{
|
|
print "En cours";
|
|
}
|
|
else
|
|
{
|
|
print $etatcmde;
|
|
}
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
print $modepaiement;
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
print $message;
|
|
?> 
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</table>
|
|
<p><br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<b>Detail de la commande</b></p>
|
|
<p><br>
|
|
</p>
|
|
<table align="center">
|
|
<tr align=center>
|
|
<td>
|
|
Nom Produit
|
|
</td>
|
|
<td> Colisage </td>
|
|
<td> </td>
|
|
<td> Qtt commandee </td>
|
|
<td> Prix </td>
|
|
</tr>
|
|
<?php
|
|
$tot=0;
|
|
/* DETAIL DE LA COMMANDE */
|
|
|
|
$requete3 = "select idcmde,idcomp,idprod,qtecmde from composee where idcmde='$idcmde'";
|
|
$result3=mysql_query($requete3) or die ("Erreur SQL :$requete2<br>".mysql_error()."...");
|
|
$i=0;
|
|
$j=0;
|
|
while ($ligne3=mysql_fetch_row($result3))
|
|
{
|
|
$i++;
|
|
$idcmde=$ligne3[0];
|
|
$idcomp=$ligne3[1];
|
|
$idprod=$ligne3[2];
|
|
$qtecmde=$ligne3[3];
|
|
|
|
$requete4 = "select idprod,denomination,prixht1,prixht2,prixht3,qteprod1,qteprod2,qteprod3,poidsprod1,poidsprod2,poidsprod3 from produit where idprod='$idprod'";
|
|
$result4=mysql_query($requete4) or die ("Erreur SQL :$requete2<br>".mysql_error()."...");
|
|
|
|
while ($ligne4=mysql_fetch_row($result4))
|
|
{
|
|
$idprod=$ligne4[0];
|
|
$denomination=$ligne4[1];
|
|
$prixht1=$ligne4[2];
|
|
$prixht2=$ligne4[3];
|
|
$prixht3=$ligne4[4];
|
|
$qteprod1=$ligne4[5];
|
|
$qteprod2=$ligne4[6];
|
|
$qteprod3=$ligne4[7];
|
|
$poidsprod1=$ligne4[8];
|
|
$poidsprod2=$ligne4[9];
|
|
$poidsprod3=$ligne4[10];
|
|
}
|
|
?>
|
|
<br>
|
|
<tr align="center">
|
|
<td>
|
|
<?php print $denomination?>
|
|
</td>
|
|
<td>
|
|
<table><h6>
|
|
<form name="fairien">
|
|
<tr align=center>
|
|
<td colspan=3>
|
|
Quantite
|
|
</td>
|
|
</tr>
|
|
<tr align=center>
|
|
<td>
|
|
<?php print $qteprod1?>
|
|
</td>
|
|
<td>
|
|
<?php print $qteprod2?>
|
|
</td>
|
|
<td>
|
|
<?php print $qteprod3?>
|
|
</td>
|
|
</tr>
|
|
<tr align=center>
|
|
<td colspan=3>
|
|
Prix
|
|
</td>
|
|
</tr>
|
|
<tr align=center>
|
|
<td>
|
|
<?php print $prixht1?>
|
|
</td>
|
|
<td>
|
|
<?php print $prixht2?>
|
|
</td>
|
|
<td>
|
|
<?php print $prixht3?>
|
|
</td>
|
|
</tr>
|
|
</form>
|
|
</table>
|
|
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
<?php print $qtecmde?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
//prix total $prixtot;
|
|
//Quantite de produit commandee $qtecmde;
|
|
//Colisage $qteprod[i] $prixht[i] $poidsprod[i], i=1,2 ou 3 (3 colisage différent possible)
|
|
|
|
if($qteprod3)
|
|
{
|
|
$prix=0;
|
|
if ($qtecmde >= $qteprod3)
|
|
{
|
|
do
|
|
{
|
|
$qtecmde = $qtecmde - $qteprod3;
|
|
$prix+=$prixht3;
|
|
$prixtot+=$prixht3;
|
|
}
|
|
while ($qtecmde >= $qteprod3);
|
|
}
|
|
}
|
|
if($qteprod2)
|
|
{
|
|
if ($qtecmde >= $qteprod2)
|
|
{
|
|
do
|
|
{
|
|
$qtecmde = $qtecmde - $qteprod2;
|
|
$prix+=$prixht2;
|
|
$prixtot+=$prixht2;
|
|
print "$prixtot<br>";
|
|
}
|
|
while ($qtecmde >= $qteprod2);
|
|
}
|
|
}
|
|
if($qtecmde>0)
|
|
{
|
|
do
|
|
{
|
|
$qtecmde-=$qteprod1;
|
|
$prix+=$prixht1;
|
|
$prixtot+=$prixht1;
|
|
}
|
|
while ($qtecmde != 0);
|
|
}
|
|
print "$prix<br>";
|
|
}
|
|
}
|
|
?>
|
|
<td>
|
|
<tr>
|
|
</table>
|
|
|
|
<br><br><a href="gestcmde.php">Retour</a></div>
|
|
</body>
|
|
</html>
|