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
|
<html>
<head>
<title>Édition</title>
</head>
<body>
<table border = "1" cellpadding = "5" cellspacing = "0">
<tr>
<td>Référence ***</td>
<?php
include('Fonction\fonction.php');
include('connexion.php');
$annee = $_GET['annee'];
//affichage des mois dans le tableau html
affiche_mois();
?>
<td>Total</td>
</tr>
<?php
include('connexion.php');
$req1="select num_fact, ref_haisoft, MONTH(date_fact)as mois, SUM(prix) as prix, date_fact from facture F group by ref_haisoft, mois";
$resultat = mysql_query($req1);
while ($row=mysql_fetch_row($resultat))
{
echo "<tr>";
$ref_haisoft=$row[1];
echo"<td>".$ref_haisoft."</td>";
$mois=$row[2];
$prix=$row[3];
$date_fact=$row[4];
$year=recup_annee($date_fact);
if ($year==$annee)
{
$montant[$mois]=$prix;
for ($i=1;$i<13;$i++)
{
if($mois==$i)
{
echo "<td>".$montant[$i]."</td>";
}
else
{
echo "<td></td>";
}
}
}
else
{
echo "Aucune archive n'a été trouvé pour cette année.";
break;
}
echo "</tr>";
}
mysql_close();
?>
</table>
</html> |
Partager