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
| <html>
<body bgcolor=#9999FF>
<?php
error_reporting(0);
require_once('connect.php');
echo '<br>';
echo '<br>';
echo '<br>';
$ref=$_POST['ref'];
$datemaj=$_POST['datemaj'];
$requete='select reference,couleur,taille,quantite from produit where reference="'.$ref.'" ';
$requete2='select distinct image from produit where reference="'.$ref.'" ';
$result2=mysql_query($requete2) or die ("Pb requette ".mysql_error());
$result=mysql_query($requete) or die ("Pb requette ".mysql_error());
$list= mysql_fetch_array($result2);
$pic= ('<img src="ImaPro/'.$list[0].'" height="180px" />');
while ($row = mysql_fetch_assoc($result)) {
$tableau[$row['taille']][$row['couleur']] += $row['quantite'];
}
$html_titre = '<tr><td> </td>';
$html = '<table border=1>';
foreach ($tableau as $taille=>$value) {
$html_titre .= '<th>' . $taille . '</th>';
$html .= '<tr>';
$new_line = TRUE;
foreach ($value as $couleur=>$quantite) {
if ($new_line) {
$html .= '<td>' . $couleur . '</td>';
$new_line = FALSE;
}
$html .= '<td>' . $quantite . '</td>';
}
$html .= '</tr>';
}
$html .= '</table>';
$html_titre .= '</tr>';
echo $html_titre . $html;
echo '<br>';
?>
</body>
</html> |