0x1998 - MANAGER
Edit File: modal_stats.php
<?php include 'config/garde.php'; $id= isset($_GET['id']) ? $_GET['id']:""; $year=isset($_GET['year']) ? $_GET['year']:""; $quadri=isset($_GET['quadri']) ? $_GET['quadri']:""; $mois_encours=array(1=>"Janvier", 2=>"Février", 3=>"Mars", 4=>"Avril", 5=>"Mai", 6=>"Juin", 7=>"Juillet", 8=>"Août", 9=>"Septembre", 10=>"Octobre", 11=>"Novembre", 12=>"Décembre"); $query="select *, (user_conso.volume*4) as 'Volume' from solde_activite inner join user_conso on user_conso.id=activite_user where activite_user=".$id." and year=".$year." and Quadri=".$quadri." order by month"; $result=mysqli_query($link,$query); while ($a_row=mysqli_fetch_array($result)) { $index=$a_row[1]; $volume0[$index]=$a_row['Total']; $volume1[$index]=$a_row['Total P']; $volume2[$index]=$a_row['Total NC']; $volume3[$index]=$a_row[5]; $presence_quadri=$a_row['Volume']; } echo" <table class=\"table table-bordered\" style=\"font-size:12px;\"> <tr> <th>Mois</th> <th>Total</th> <th>Posté</th> <th>NC</th> <th>Solde</th> </tr>"; if (isset($volume0)) { $total=0; foreach ($volume0 as $key => $value) { echo" <tr> <td>".$mois_encours[$key]."</td> <td>".$value."</td> <td>".$volume1[$key]."</td> <td>".$volume2[$key]."</td> <td>".$volume3[$key]."</td> </tr>"; $total=$total+$volume0[$key]; } echo "<tr><td>Total</td><td colspan=3>".$total." (Obligation : 4 X ".($presence_quadri/4)."=".$presence_quadri.")</td> <td>".($total-$presence_quadri)."</td> </tr>"; } echo "</table>"; ?>