/
compte_commandes.php
92 lines (86 loc) · 3.29 KB
/
compte_commandes.php
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
include ("kernel/main.php");
include ("_affiche_vignette.php");
# Pas loggué...
if (!$_COMPTE) $Navig->fix_page_demande_connect_compte(true);
//
// Variables...
//
# Historique...
$titre_historique = "Mon compte - mes commandes";
//////////////////////////////////////////////////
//
// Requêtes...
//
# Commandes en cours...
sql_mysql_query (" SELECT *,
DATE_FORMAT(commandes.date_commande,'%d/%m/%Y') AS la_date
FROM commandes
WHERE id_client = '$_COMPTE'
AND statut < 100
AND NOT (mode_paiement=1 AND statut=1)
ORDER BY id
", 'cmd_encours');
# Commandes expédiées...
sql_mysql_query (" SELECT *,
DATE_FORMAT(commandes.date_commande,'%d/%m/%Y') AS la_date
FROM commandes
WHERE id_client = '$_COMPTE'
AND statut = 100
ORDER BY id
", 'cmd_ok');
//////////////////////////////////////////////////
?>
<div class="catalogue clearfix">
<div class="head">Mon compte - mes commandes</div>
<div class="padding">
<?php if ($nb_cmd_encours) { ?>
<h2 class="header2">Mes commandes en cours</h2>
<table width="100%" border="0" cellspacing="2" cellpadding="2" class="tbl">
<tr>
<th>Numéro de commande</th>
<th>Paiement</th>
<th>Date</th>
<th>Total</th>
<th>Statut</th>
<th> </th>
</tr>
<?php while ($row = mysql_fetch_object($query_cmd_encours)) { ?>
<tr align="center">
<td><?php echo $row->code_commande; ?></td>
<td><?php echo $_MODE_PAIEMENT[$row->mode_paiement]; ?></td>
<td><?php echo $row->la_date; ?></td>
<td><?php echo prix($row->total_TTC); ?></td>
<td <?php if ($row->statut==3) { ?>style="font-weight:bold;color:#009900;"<?php } ?>><?php echo $_STATUT_CMD[$row->statut]; ?></td>
<td><a href="javascript:facture('<?php echo $row->id; ?>');"><b>Voir</b></a></td>
</tr>
<?php } ?>
</table>
<p> </p>
<?php } ?>
<?php if ($nb_cmd_ok) { ?>
<h2 class="header2">Mes commandes expédiées</h2>
<table width="100%" border="0" cellspacing="2" cellpadding="2" class="tbl">
<tr>
<th>Numéro de commande</th>
<th>Paiement</th>
<th>Date</th>
<th>Total</th>
<th>Statut</th>
<th> </th>
</tr>
<?php while ($row = mysql_fetch_object($query_cmd_ok)) { ?>
<tr align="center">
<td><?php echo $row->code_commande; ?></td>
<td><?php echo $_MODE_PAIEMENT[$row->mode_paiement]; ?></td>
<td><?php echo $row->la_date; ?></td>
<td><?php echo prix($row->total_TTC); ?></td>
<td><?php echo $_STATUT_CMD[$row->statut]; ?></td>
<td><a href="javascript:facture('<?php echo $row->id; ?>');"><b>Voir</b></a></td>
</tr>
<?php } ?>
</table>
<?php } ?>
</div>
</div>
<?php modele_page("_modele_page.php", "Commander"); ?>