%PDF- %PDF-
Direktori : /home/alliance/domains/congress-pact1in5.eu/public_html/ |
Current File : /home/alliance/domains/congress-pact1in5.eu/public_html/a-voir_stats.php |
<?php include_once("inc/config.php"); include_once("inc/functions.php"); include_once("inc/session.php"); include_once("inc/init.php"); verif_co_admin(); $edition=new Edition; if(isset($_GET['edition'])){ $this_edition['id']=$_GET['edition']; } else{ $this_edition=$edition->getCurrentEdition($aff="ins"); } $obj_stats=new Stats; if(!isset($_GET['edition']) || $_GET['edition'] == "n") $ed = null; else $ed = $_GET['edition']; if(!isset($_GET['profil']) || $_GET['profil'] == "all") $pr = null; else $pr = $_GET['profil']; if(!isset($_GET['pays']) || $_GET['pays'] == "all") $pa = null; else $pa = $_GET['pays']; if(!isset($_GET['valeur']) || $_GET['valeur'] == "nb") $valeur = "nb"; else $valeur = $_GET['valeur']; //affichage du html include("theme/html.php"); //affichage des metas include("theme/meta.php"); echo "\n<title>Statistiques - ".$info_titresite."</title>\n"; //affichage du header include("theme/header_admin.php"); ?> <h2>Statistiques</h2> <form action="admin/voir_stats.php" method="get" class="form"> <table> <tr> <!--<td class="label">Edition</td> <td class="field"> <select name="edition" style="width: 300px;"> <?php $res = $edition->liste_editions(); foreach($res as $edit) { $datesplit = explode('-', $edit['date_debut']); $annee = $datesplit['0']; echo '<option value="'.$edit['id'].'"'; if($ed == $edit['id']) echo ' selected="selected"'; echo ' >'.$annee.' - '.$edit['titre'].'</option> '; } ?> </select> </td> </tr>--> <input type="hidden" name="edition" value="1" /> <tr> <td class="label">Profil</td> <td class="field"> <select name="profil" style="width: 300px;"> <option value="all">Tous les profils</option> <?php $res = $profil->getProfils(); foreach($res as $prof) { echo '<option value="'.$prof['id'].'"'; if($pr == $prof['id']) echo ' selected="selected"'; echo ' >'.$prof['libelle'].'</option> '; } ?> </select> </td> </tr> <tr> <td class="label">Pays</td> <td class="field"> <select name="pays[]" style="width: 300px;" size="10" multiple="multiple"> <option value="all">Tous les pays</option> <?php $res = $pays->getPays(1); foreach($res as $pay) { echo '<option value="'.$pay['id'].'"'; if($pa == $pay['id']) echo ' selected="selected"'; echo ' >'.$pay['name'].'</option> '; } ?> </select> </td> </tr> <tr> <td class="label">Valeur</td> <td class="field"> <select name="valeur" style="width: 300px;"> <option value="nb" <?if($valeur == "nb") echo ' selected="selected"';?>>Nombre de participants</option> <option value="population" <?if($valeur == "population") echo ' selected="selected"';?>>Population</option> <option value="activites" <?if($valeur == "activites") echo ' selected="selected"';?>>Activités</option> </select> </td> </tr> </table> <div class="form_bouton"> <input type="submit" class="bouton" id="maj_bouton" value="Filtrer les partenaires" /> </div> </form> <p></p> <?if($valeur=="nb"){ echo '<h2>Nombre de participants</h2>'; } elseif($valeur=="population"){ echo '<h2>Populations</h2>'; } elseif($valeur=="activites"){ echo '<h2>Activités</h2>'; } ?> <table id="stats_admin"> <? if(!isset($_GET['profil']) || $_GET['profil']=="all"){ ?> <tr><th><h3>Pays</h3></th><th><h3>Tous les profils</h3></th><th><h3>Collectivités</h3></th><th><h3>Associations</h3></th></tr> <? } else{ echo "<tr><th><h3>Pays</h3></th>"; if($_GET['profil']==1){ echo "<th><h3>Collectivités</h3></th></tr>"; } else{ echo "<th><h3>Associations</h3></th></tr>"; } } $obj_pays=new Pays; $tab_profil=array(); if(!isset($_GET['profil']) || $_GET['profil']=="all"){ $tab_profil[]='all'; //$tab_profil[]=2; $tab_profil[]=1; $tab_profil[]=3; } else{ $tab_profil[]=$_GET['profil']; } $allpays=false; if(!isset($_GET['pays']) || $_GET['pays']=="all"){ $list_pays=$obj_pays->getPaysEdition($this_edition['id'],$_SESSION['lang']); $allpays=true; } else{ foreach($_GET['pays'] as $unpays){ if($unpays!="all"){ $list_pays[]=$obj_pays->getUnPays($unpays,$_SESSION['lang']); } else{ $list_pays=$obj_pays->getPaysEdition($this_edition['id'],$_SESSION['lang']); $allpays=true; } } } if($allpays==true){ echo "<tr>"; echo "<td>Total</td>"; foreach($tab_profil as $profil){ if($valeur=="population"){ echo "<td>".number_format($obj_stats->getStats($this_edition['id'],"all",$profil,$valeur),0,'.',' ')."</td>"; } else{ echo "<td>".$obj_stats->getStats($this_edition['id'],"all",$profil,$valeur)."</td>"; } } echo "</tr>"; } foreach($list_pays as $pays){ echo "<tr>"; echo "<td>".$pays['name']."</td>"; foreach($tab_profil as $profil){ if($valeur=="population"){ echo "<td>".number_format($obj_stats->getStats($this_edition['id'],$pays['id'],$profil,$valeur),0,'.',' ')."</td>"; } else{ echo "<td>".$obj_stats->getStats($this_edition['id'],$pays['id'],$profil,$valeur)."</td>"; } } echo "</tr>"; } ?>