| Line 13... |
Line 13... |
| 13 |
|
13 |
|
| Line 14... |
Line 14... |
| 14 |
class StatistiqueControleur extends AppControleur {
|
14 |
class StatistiqueControleur extends AppControleur {
|
| Line 15... |
Line -... |
| 15 |
|
- |
|
| 16 |
private $statistiques = null;
|
- |
|
| 17 |
|
- |
|
| 18 |
private $champ_pays = '12';
|
- |
|
| 19 |
private $champ_rapport_activite_bota = '102';
|
15 |
|
| Line 20... |
Line 16... |
| 20 |
private $champ_experience_bota = '4';
|
16 |
private $statistiques = null;
|
| 21 |
|
17 |
|
| 22 |
public function StatistiqueControleur() {
|
18 |
public function StatistiqueControleur() {
|
| Line 35... |
Line 31... |
| 35 |
'Asie (%1.2f%%)' => 'pays_asie',
|
31 |
'Asie (%1.2f%%)' => 'pays_asie',
|
| 36 |
'Europe (%1.2f%%)' => 'pays_europe',
|
32 |
'Europe (%1.2f%%)' => 'pays_europe',
|
| 37 |
'Oceanie (%1.2f%%)' => 'pays_oceanie',
|
33 |
'Oceanie (%1.2f%%)' => 'pays_oceanie',
|
| 38 |
'Amerique du sud (%1.2f%%)' => 'pays_sud_amerique',
|
34 |
'Amerique du sud (%1.2f%%)' => 'pays_sud_amerique',
|
| 39 |
'Moyen Orient (%1.2f%%)' => 'pays_moyen_orient');
|
35 |
'Moyen Orient (%1.2f%%)' => 'pays_moyen_orient');
|
| 40 |
|
36 |
|
| 41 |
// pour chacun des continents, on fait la somme des membres de sa zone
|
37 |
// pour chacun des continents, on fait la somme des membres de sa zone
|
| 42 |
foreach($continents as $id_continent => $continent) {
|
38 |
foreach($continents as $id_continent => $continent) {
|
| 43 |
$zones_continent_ids = $cartographe->chargerInformationsPaysDuContinentsCsv($continent);
|
39 |
$zones_continent_ids = $cartographe->chargerInformationsPaysDuContinentsCsv($continent);
|
| - |
|
40 |
$zones_continent_ids = array_map(array($this,'miniQuote'), array_keys($zones_continent_ids));
|
| 44 |
$nb_inscrits[$id_continent] = array_sum($annuaire_controleur->chargerNombreAnnuaireListeInscritsParPays($id_annuaire, array_keys($zones_continent_ids)));
|
41 |
$nb_inscrits[$id_continent] = array_sum($annuaire_controleur->chargerNombreAnnuaireListeInscritsParPays($id_annuaire, $zones_continent_ids));
|
| 45 |
}
|
42 |
}
|
| 46 |
|
43 |
|
| 47 |
$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$nb_inscrits,'', array(650, 500));
|
44 |
$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$nb_inscrits,'', array(650, 500));
|
| Line 48... |
Line 45... |
| 48 |
|
45 |
|
| 49 |
return $this->dessinerGraph($graph);
|
46 |
return $this->dessinerGraph($graph);
|
| Line 54... |
Line 51... |
| 54 |
$cartographe = new CartoControleur();
|
51 |
$cartographe = new CartoControleur();
|
| 55 |
$annuaire_controleur = new AnnuaireControleur();
|
52 |
$annuaire_controleur = new AnnuaireControleur();
|
| 56 |
$cartographe = new CartoControleur();
|
53 |
$cartographe = new CartoControleur();
|
| Line 57... |
Line 54... |
| 57 |
|
54 |
|
| 58 |
$ids_zones_europe = $cartographe->chargerInformationsPaysDuContinentsCsv('pays_europe');
|
55 |
$ids_zones_europe = $cartographe->chargerInformationsPaysDuContinentsCsv('pays_europe');
|
| 59 |
|
56 |
|
| - |
|
57 |
$codes_zones_europe = array_map(array($this,'miniQuote'), array_keys($ids_zones_europe));
|
| 60 |
//Debug::printr()
|
58 |
|
| 61 |
$titre_zone = $this->convertirPourLegende($zone[2]);
|
59 |
$titre_zone = $this->convertirPourLegende($zone[2]);
|
| Line 62... |
Line 60... |
| 62 |
$nb_inscrits_par_code = $annuaire_controleur->chargerNombreAnnuaireListeInscritsParPays($id_annuaire, array_keys($ids_zones_europe));
|
60 |
$nb_inscrits_par_code = $annuaire_controleur->chargerNombreAnnuaireListeInscritsParPays($id_annuaire, $codes_zones_europe);
|
| Line 63... |
Line 61... |
| 63 |
|
61 |
|
| Line 72... |
Line 70... |
| 72 |
|
70 |
|
| 73 |
$label_pays = $this->convertirPourLegende($ids_zones_europe[$code_pays][2].' (%1.2f%%)');
|
71 |
$label_pays = $this->convertirPourLegende($ids_zones_europe[$code_pays][2].' (%1.2f%%)');
|
| 74 |
$nb_inscrits_par_legende[$label_pays] = $inscrits_pays;
|
72 |
$nb_inscrits_par_legende[$label_pays] = $inscrits_pays;
|
| 75 |
$somme_autres_pays += $inscrits_pays;
|
73 |
$somme_autres_pays += $inscrits_pays;
|
| 76 |
}
|
74 |
}
|
| 77 |
|
75 |
|
| Line 78... |
Line 76... |
| 78 |
$tableau_france_autres = array('France (%1.2f%%)' => $inscrits_france, 'Autres (%1.2f%%)' => $somme_autres_pays);
|
76 |
$tableau_france_autres = array('France (%1.2f%%)' => $inscrits_france, 'Autres (%1.2f%%)' => $somme_autres_pays);
|
| 79 |
|
77 |
|
| 80 |
$graph_france = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$tableau_france_autres,'', array(320, 200));
|
78 |
$graph_france = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$tableau_france_autres,'', array(320, 200));
|
| Line 207... |
Line 205... |
| 207 |
$valeurs_a_stat_legende = array();
|
205 |
$valeurs_a_stat_legende = array();
|
| Line 208... |
Line 206... |
| 208 |
|
206 |
|
| Line 209... |
Line 207... |
| 209 |
$tab_mois = array("Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aout","Sep","Oct","Nov","Dec");
|
207 |
$tab_mois = array("Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aout","Sep","Oct","Nov","Dec");
|
| 210 |
|
208 |
|
| 211 |
$annee_debut = 2010;
|
209 |
$annee_debut = 2010;
|
| 212 |
$mois = 7;
|
210 |
$mois = 1;
|
| 213 |
$annee = 2010;
|
211 |
$annee = 2010;
|
| Line 214... |
Line 212... |
| 214 |
$tps_debut = mktime(0,0,0,$mois,1,$annee);
|
212 |
$tps_debut = mktime(0,0,0,$mois,1,$annee);
|
| Line 310... |
Line 308... |
| 310 |
'C', 'Y', 'N',
|
308 |
'C', 'Y', 'N',
|
| 311 |
),$texte);
|
309 |
),$texte);
|
| Line 312... |
Line 310... |
| 312 |
|
310 |
|
| 313 |
return $texte;
|
311 |
return $texte;
|
| - |
|
312 |
}
|
| - |
|
313 |
|
| - |
|
314 |
private function miniQuote($chaine) {
|
| - |
|
315 |
return "'".$chaine."'";
|
| 314 |
}
|
316 |
}
|
| 315 |
}
|
317 |
}
|
| 316 |
?>
|
318 |
?>
|