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
| $annee = 2006;
$id_trim = 1;
$id_bacterie = "STAU";
$id_atb=1;
$sql = graph_view($id_service,$annee,$id_trim,$id_bacterie,$id_atb);
$result = MYSQL_QUERY($sql);
for ($i=1;$i<5;$i++)
{
$id_service = $i;
if(mysql_num_rows($result))
{
while($row=mysql_fetch_row($result)) # boucle pour séparer les resultats
{
$nom_trim = $row[0];
$nom_service= $row[1];
$nom_bacterie = $row[2];
$nom_atb = $row[3];
$R = $row[4];
$I = $row[5];
$S = $row[6];
$total = $R+$I+$S;
if($total != 0)
{
$pourcent = round(($S/$total)*100) ;
}
else {
$pourcent = 0;
}
}
} |
Partager