Subversion Repositories Applications.annuaire

Rev

Rev 247 | Rev 404 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 247 Rev 294
1
<?php
1
<?php
2
/**
2
/**
3
* PHP Version 5
3
* PHP Version 5
4
*
4
*
5
* @category  PHP
5
* @category  PHP
6
* @package   annuaire
6
* @package   annuaire
7
* @author    aurelien <aurelien@tela-botanica.org>
7
* @author    aurelien <aurelien@tela-botanica.org>
8
* @copyright 2010 Tela-Botanica
8
* @copyright 2010 Tela-Botanica
9
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
9
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
* @version   SVN: <svn_id>
10
* @version   SVN: <svn_id>
11
* @link      /doc/annuaire/
11
* @link      /doc/annuaire/
12
*/
12
*/
13
 
13
 
14
class StatistiqueControleur extends AppControleur {
14
class StatistiqueControleur extends AppControleur {
15
 
15
 
16
	private $statistiques = null;
16
	private $statistiques = null;
17
 
-
 
18
	private $champ_pays = '12';
-
 
19
	private $champ_rapport_activite_bota = '102';
-
 
20
	private $champ_experience_bota = '4';
-
 
21
 
17
 
22
	public function StatistiqueControleur() {
18
	public function StatistiqueControleur() {
23
		
19
		
24
		$this->__construct();
20
		$this->__construct();
25
		$this->statistiques = Composant::fabrique('statistiques', array());
21
		$this->statistiques = Composant::fabrique('statistiques', array());
26
	}
22
	}
27
	
23
	
28
	public function obtenirStatistiquesInscritsParContinents($id_annuaire) {
24
	public function obtenirStatistiquesInscritsParContinents($id_annuaire) {
29
		
25
		
30
		$cartographe = new CartoControleur();
26
		$cartographe = new CartoControleur();
31
		$annuaire_controleur = new AnnuaireControleur();
27
		$annuaire_controleur = new AnnuaireControleur();
32
		
28
		
33
		$continents = array('Afrique (%1.2f%%)' => 'pays_afrique',
29
		$continents = array('Afrique (%1.2f%%)' => 'pays_afrique',
34
		 							'Amerique du nord (%1.2f%%)' => 'pays_nord_amerique', 
30
		 							'Amerique du nord (%1.2f%%)' => 'pays_nord_amerique', 
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));
48
    	
45
    	
49
    	return $this->dessinerGraph($graph);
46
    	return $this->dessinerGraph($graph);
50
	}
47
	}
51
	
48
	
52
	public function obtenirStatistiquesInscritsEurope($id_annuaire) {
49
	public function obtenirStatistiquesInscritsEurope($id_annuaire) {
53
		
50
		
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();
57
		
54
		
58
		$ids_zones_europe = $cartographe->chargerInformationsPaysDuContinentsCsv('pays_europe');
55
		$ids_zones_europe = $cartographe->chargerInformationsPaysDuContinentsCsv('pays_europe');
59
		
56
				
60
		//Debug::printr()
57
		$codes_zones_europe = array_map(array($this,'miniQuote'), array_keys($ids_zones_europe));    
-
 
58
 
61
		$titre_zone = $this->convertirPourLegende($zone[2]);
59
		$titre_zone = $this->convertirPourLegende($zone[2]);
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);
63
		
61
		
64
    	$nb_inscrits_par_legende = array();
62
    	$nb_inscrits_par_legende = array();
65
    	
63
    	
66
    	$inscrits_france = $nb_inscrits_par_code['fr'];
64
    	$inscrits_france = $nb_inscrits_par_code['fr'];
67
    	
65
    	
68
    	unset($nb_inscrits_par_code['fr']);
66
    	unset($nb_inscrits_par_code['fr']);
69
    	$somme_autres_pays = 0;
67
    	$somme_autres_pays = 0;
70
    	
68
    	
71
    	foreach($nb_inscrits_par_code as $code_pays => $inscrits_pays) {
69
    	foreach($nb_inscrits_par_code as $code_pays => $inscrits_pays) {
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
    	    	
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));
81
		$graph_autres = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$nb_inscrits_par_legende,'', array(900, 700));
79
		$graph_autres = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$nb_inscrits_par_legende,'', array(900, 700));
82
		$graph = $this->statistiques->combinerGraphiques($graph_france, $graph_autres, array(920, 1200));
80
		$graph = $this->statistiques->combinerGraphiques($graph_france, $graph_autres, array(920, 1200));
83
		
81
		
84
		return $this->dessinerGraph($graph);
82
		return $this->dessinerGraph($graph);
85
	}
83
	}
86
 
84
 
87
	public function obtenirStatistiquesParPays($id_annuaire) {
85
	public function obtenirStatistiquesParPays($id_annuaire) {
88
 
86
 
89
	    $controleur = new AnnuaireControleur();
87
	    $controleur = new AnnuaireControleur();
90
	   	
88
	   	
91
	   	//$controleur = new AnnuaireControleur();
89
	   	//$controleur = new AnnuaireControleur();
92
	    $modele_meta = new MetadonneeModele();
90
	    $modele_meta = new MetadonneeModele();
93
	   	$modele_onto = new OntologieModele();
91
	   	$modele_onto = new OntologieModele();
94
	   	$id_champ = 12;
92
	   	$id_champ = 12;
95
	    $valeurs = $modele_meta->obtenirNombreValeurMetadonnee($id_champ);
93
	    $valeurs = $modele_meta->obtenirNombreValeurMetadonnee($id_champ);
96
	    $id_onto = $modele_meta->obtenirOntologieLieeAChampParId($id_champ);
94
	    $id_onto = $modele_meta->obtenirOntologieLieeAChampParId($id_champ);
97
	   	$legendes = $modele_onto->chargerListeOntologie($id_onto);
95
	   	$legendes = $modele_onto->chargerListeOntologie($id_onto);
98
 
96
 
99
		$valeurs_a_stat_code = array();
97
		$valeurs_a_stat_code = array();
100
		$valeurs_a_stat_legende = array();
98
		$valeurs_a_stat_legende = array();
101
 
99
 
102
		foreach($valeurs as $valeur) {
100
		foreach($valeurs as $valeur) {
103
			$valeurs_a_stat_code[$valeur['amv_valeur']] = $valeur['nb'];
101
			$valeurs_a_stat_code[$valeur['amv_valeur']] = $valeur['nb'];
104
		}
102
		}
105
 
103
 
106
	    foreach($legendes as $legende) {
104
	    foreach($legendes as $legende) {
107
	    	$legende_nom = $legende['amo_nom'];
105
	    	$legende_nom = $legende['amo_nom'];
108
	    	$legende_code = $legende['amo_id_ontologie'];
106
	    	$legende_code = $legende['amo_id_ontologie'];
109
 
107
 
110
	    	if(isset($valeurs_a_stat_code[$legende_code])) {
108
	    	if(isset($valeurs_a_stat_code[$legende_code])) {
111
				$valeurs_a_stat_legende[$legende_nom] = $valeurs_a_stat_code[$legende_code];
109
				$valeurs_a_stat_legende[$legende_nom] = $valeurs_a_stat_code[$legende_code];
112
	    	}
110
	    	}
113
	    }
111
	    }
114
 
112
 
115
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$valeurs_a_stat_legende);
113
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$valeurs_a_stat_legende);
116
	    return $this->dessinerGraph($graph);
114
	    return $this->dessinerGraph($graph);
117
 
115
 
118
	}
116
	}
119
 
117
 
120
	public function obtenirStatistiquesParCritere($id_annuaire, $code_champ, $titre = '') {
118
	public function obtenirStatistiquesParCritere($id_annuaire, $code_champ, $titre = '') {
121
 
119
 
122
	    $modele_meta = new MetadonneeModele();
120
	    $modele_meta = new MetadonneeModele();
123
	   	$modele_onto = new OntologieModele();
121
	   	$modele_onto = new OntologieModele();
124
	   	$id_champ = $modele_meta->renvoyerIdChampMetadonneeParAbreviation($id_annuaire, $code_champ);
122
	   	$id_champ = $modele_meta->renvoyerIdChampMetadonneeParAbreviation($id_annuaire, $code_champ);
125
	    $valeurs = $modele_meta->obtenirNombreValeurMetadonnee($id_champ);
123
	    $valeurs = $modele_meta->obtenirNombreValeurMetadonnee($id_champ);
126
	    $id_onto = $modele_meta->obtenirOntologieLieeAChampParId($id_champ);
124
	    $id_onto = $modele_meta->obtenirOntologieLieeAChampParId($id_champ);
127
	   	$legendes = $modele_onto->chargerListeOntologie($id_onto);
125
	   	$legendes = $modele_onto->chargerListeOntologie($id_onto);
128
	   	
126
	   	
129
		$valeurs_a_stat_code = array();
127
		$valeurs_a_stat_code = array();
130
		$valeurs_a_stat_legende = array();
128
		$valeurs_a_stat_legende = array();
131
				
129
				
132
		$titre = $this->convertirPourLegende($titre);
130
		$titre = $this->convertirPourLegende($titre);
133
 
131
 
134
		foreach($valeurs as $valeur) {
132
		foreach($valeurs as $valeur) {
135
			$valeurs_a_stat_code[$valeur['amv_valeur']] = $valeur['nb'];
133
			$valeurs_a_stat_code[$valeur['amv_valeur']] = $valeur['nb'];
136
		}
134
		}
137
		
135
		
138
	    foreach($legendes as $legende) {
136
	    foreach($legendes as $legende) {
139
	    	$legende_nom = $this->convertirPourLegende($legende['amo_nom']);
137
	    	$legende_nom = $this->convertirPourLegende($legende['amo_nom']);
140
	    	$legende_code = $legende['amo_id_ontologie'];
138
	    	$legende_code = $legende['amo_id_ontologie'];
141
	    	
139
	    	
142
	    	if(isset($valeurs_a_stat_code[$legende_code])) {
140
	    	if(isset($valeurs_a_stat_code[$legende_code])) {
143
				$valeurs_a_stat_legende[$legende_nom] = $valeurs_a_stat_code[$legende_code];
141
				$valeurs_a_stat_legende[$legende_nom] = $valeurs_a_stat_code[$legende_code];
144
	    	} else {
142
	    	} else {
145
	    		
143
	    		
146
	    	}
144
	    	}
147
	    }
145
	    }
148
	    
146
	    
149
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$valeurs_a_stat_legende, $titre, array(650, 400));
147
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_CAMEMBERT,$valeurs_a_stat_legende, $titre, array(650, 400));
150
		return $this->dessinerGraph($graph);
148
		return $this->dessinerGraph($graph);
151
		
149
		
152
	}
150
	}
153
 
151
 
154
	public function obtenirStatistiquesParAnnees($id_annuaire, $annee_fin = '') {
152
	public function obtenirStatistiquesParAnnees($id_annuaire, $annee_fin = '') {
155
 
153
 
156
	    $annuaire_modele = new AnnuaireModele();
154
	    $annuaire_modele = new AnnuaireModele();
157
 
155
 
158
		$valeurs_a_stat_code = array();
156
		$valeurs_a_stat_code = array();
159
		$valeurs_a_stat_legende = array();
157
		$valeurs_a_stat_legende = array();
160
			        
158
			        
161
		$tab_mois = array("Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aout","Sep","Oct","Nov","Dec");
159
		$tab_mois = array("Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aout","Sep","Oct","Nov","Dec");
162
		
160
		
163
		$annee_debut = 2002;
161
		$annee_debut = 2002;
164
		$mois = 4;
162
		$mois = 4;
165
		$annee = 2002;
163
		$annee = 2002;
166
		$tps_debut = mktime(0,0,0,$mois,1,$annee);
164
		$tps_debut = mktime(0,0,0,$mois,1,$annee);
167
		$tps_courant = $tps_debut;
165
		$tps_courant = $tps_debut;
168
		
166
		
169
		if($annee_fin != '') {
167
		if($annee_fin != '') {
170
			$tps_fin = mktime(0,0,0,1,1,$annee_fin);
168
			$tps_fin = mktime(0,0,0,1,1,$annee_fin);
171
		} else {
169
		} else {
172
			$tps_fin = time();// jour courant
170
			$tps_fin = time();// jour courant
173
		}
171
		}
174
 
172
 
175
		//Requete par mois
173
		//Requete par mois
176
		$i = 1;
174
		$i = 1;
177
		while  ($tps_courant <= $tps_fin) {
175
		while  ($tps_courant <= $tps_fin) {
178
			
176
			
179
			if (($mois)/12 > 1) {
177
			if (($mois)/12 > 1) {
180
				$mois = 1;
178
				$mois = 1;
181
				$annee = $annee+1;
179
				$annee = $annee+1;
182
			}
180
			}
183
			
181
			
184
			$tps_mois_suivant = mktime(0,0,0,$mois+1,1,$annee);
182
			$tps_mois_suivant = mktime(0,0,0,$mois+1,1,$annee);
185
			
183
			
186
			$nb_inscrits_dans_intervalle = $annuaire_modele->obtenirNombreInscriptionsDansIntervalleDate($id_annuaire, $tps_debut, $tps_courant);
184
			$nb_inscrits_dans_intervalle = $annuaire_modele->obtenirNombreInscriptionsDansIntervalleDate($id_annuaire, $tps_debut, $tps_courant);
187
			
185
			
188
			$valeurs_a_stat_legende[$tab_mois[$mois-1].' '.$annee] = $nb_inscrits_dans_intervalle;
186
			$valeurs_a_stat_legende[$tab_mois[$mois-1].' '.$annee] = $nb_inscrits_dans_intervalle;
189
			
187
			
190
			$tps_courant = $tps_mois_suivant;
188
			$tps_courant = $tps_mois_suivant;
191
			$mois++;
189
			$mois++;
192
			$i++;
190
			$i++;
193
		}
191
		}
194
 
192
 
195
		$nom_axeX = 'Mois depuis le 1er avril 2002'; 
193
		$nom_axeX = 'Mois depuis le 1er avril 2002'; 
196
		
194
		
197
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_COURBE,$valeurs_a_stat_legende, '', array(500,490), $nom_axeX, '');
195
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_COURBE,$valeurs_a_stat_legende, '', array(500,490), $nom_axeX, '');
198
	    return $this->dessinerGraph($graph);
196
	    return $this->dessinerGraph($graph);
199
 
197
 
200
	}
198
	}
201
	
199
	
202
	public function obtenirStatistiquesModificationsProfil($id_annuaire, $annee_fin = '') {
200
	public function obtenirStatistiquesModificationsProfil($id_annuaire, $annee_fin = '') {
203
 
201
 
204
	    $modele = new StatistiqueModele();
202
	    $modele = new StatistiqueModele();
205
 
203
 
206
		$valeurs_a_stat_code = array();
204
		$valeurs_a_stat_code = array();
207
		$valeurs_a_stat_legende = array();
205
		$valeurs_a_stat_legende = array();
208
			        
206
			        
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;
214
		$tps_debut = mktime(0,0,0,$mois,1,$annee);
212
		$tps_debut = mktime(0,0,0,$mois,1,$annee);
215
		$tps_courant = $tps_debut;
213
		$tps_courant = $tps_debut;
216
		
214
		
217
		if($annee_fin != '') {
215
		if($annee_fin != '') {
218
			$tps_fin = mktime(0,0,0,1,1,$annee_fin);
216
			$tps_fin = mktime(0,0,0,1,1,$annee_fin);
219
		} else {
217
		} else {
220
			$today = date_parse(date('Y-m-d H:i:s'));
218
			$today = date_parse(date('Y-m-d H:i:s'));
221
			
219
			
222
			$annee_fin_today = $today['year'];
220
			$annee_fin_today = $today['year'];
223
			$mois_fin_today = $today['month'];
221
			$mois_fin_today = $today['month'];
224
						
222
						
225
			if($annee_debut == $annee_fin_today) {
223
			if($annee_debut == $annee_fin_today) {
226
				$tps_fin = mktime(0,0,0,$mois_fin_today+1,1,$annee_fin_today);
224
				$tps_fin = mktime(0,0,0,$mois_fin_today+1,1,$annee_fin_today);
227
			} else {
225
			} else {
228
				$tps_fin = time();// jour courant
226
				$tps_fin = time();// jour courant
229
			}
227
			}
230
		}
228
		}
231
		
229
		
232
		//Requete par mois
230
		//Requete par mois
233
		$i = 1;
231
		$i = 1;
234
		while  ($tps_courant <= $tps_fin) {
232
		while  ($tps_courant <= $tps_fin) {
235
			
233
			
236
			if (($mois)/12 > 1) {
234
			if (($mois)/12 > 1) {
237
				$mois = 1;
235
				$mois = 1;
238
				$annee = $annee+1;
236
				$annee = $annee+1;
239
			}
237
			}
240
			
238
			
241
			$tps_mois_suivant = mktime(0,0,0,$mois+1,1,$annee);
239
			$tps_mois_suivant = mktime(0,0,0,$mois+1,1,$annee);
242
			
240
			
243
			$nb_modif_dans_intervalle = $modele->obtenirEvenementsDansIntervalle($id_annuaire,'modification', $tps_debut, $tps_courant);
241
			$nb_modif_dans_intervalle = $modele->obtenirEvenementsDansIntervalle($id_annuaire,'modification', $tps_debut, $tps_courant);
244
			
242
			
245
			$valeurs_a_stat_legende[$tab_mois[$mois-1].' '.$annee] = $nb_modif_dans_intervalle;
243
			$valeurs_a_stat_legende[$tab_mois[$mois-1].' '.$annee] = $nb_modif_dans_intervalle;
246
			
244
			
247
			$tps_courant = $tps_mois_suivant;
245
			$tps_courant = $tps_mois_suivant;
248
			$mois++;
246
			$mois++;
249
			$i++;
247
			$i++;
250
		}
248
		}
251
 
249
 
252
		$nom_axeX = 'Mois depuis le 1er juillet 2010'; 
250
		$nom_axeX = 'Mois depuis le 1er juillet 2010'; 
253
		
251
		
254
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_COURBE,$valeurs_a_stat_legende, '', array(500,490), $nom_axeX, '');
252
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_COURBE,$valeurs_a_stat_legende, '', array(500,490), $nom_axeX, '');
255
	    return $this->dessinerGraph($graph);
253
	    return $this->dessinerGraph($graph);
256
 
254
 
257
	}
255
	}
258
	
256
	
259
	public function ajouterEvenementStatistique($id_annuaire, $id_utilisateur, $type) {
257
	public function ajouterEvenementStatistique($id_annuaire, $id_utilisateur, $type) {
260
		
258
		
261
		$this->chargerModele('StatistiqueModele');	
259
		$this->chargerModele('StatistiqueModele');	
262
		$this->StatistiqueModele->ajouterEvenementStatistique($id_annuaire, $id_utilisateur, $type);
260
		$this->StatistiqueModele->ajouterEvenementStatistique($id_annuaire, $id_utilisateur, $type);
263
		
261
		
264
	}
262
	}
265
	
263
	
266
	public function obtenirDerniersEvenementsStatistique($id_annuaire, $type) {
264
	public function obtenirDerniersEvenementsStatistique($id_annuaire, $type) {
267
		
265
		
268
		$this->chargerModele('StatistiqueModele');	
266
		$this->chargerModele('StatistiqueModele');	
269
		return $this->StatistiqueModele->obtenirDerniersEvenementsStatistique($id_annuaire, $type);
267
		return $this->StatistiqueModele->obtenirDerniersEvenementsStatistique($id_annuaire, $type);
270
		
268
		
271
	}
269
	}
272
	
270
	
273
	private function dessinerGraph($graph) {
271
	private function dessinerGraph($graph) {
274
		return $this->statistiques->dessinerGraph($graph);
272
		return $this->statistiques->dessinerGraph($graph);
275
	}
273
	}
276
	
274
	
277
	private function convertirPourLegende($texte) {	
275
	private function convertirPourLegende($texte) {	
278
 
276
 
279
		if(trim($texte) == '') {
277
		if(trim($texte) == '') {
280
			$texte = '' ;
278
			$texte = '' ;
281
		}
279
		}
282
 
280
 
283
		$texte = str_replace(
281
		$texte = str_replace(
284
			array(
282
			array(
285
				'à', 'â', 'ä', 'á', 'ã', 'å',
283
				'à', 'â', 'ä', 'á', 'ã', 'å',
286
				'î', 'ï', 'ì', 'í', 
284
				'î', 'ï', 'ì', 'í', 
287
				'ô', 'ö', 'ò', 'ó', 'õ', 'ø', 
285
				'ô', 'ö', 'ò', 'ó', 'õ', 'ø', 
288
				'ù', 'û', 'ü', 'ú', 
286
				'ù', 'û', 'ü', 'ú', 
289
				'é', 'è', 'ê', 'ë', 
287
				'é', 'è', 'ê', 'ë', 
290
				'ç', 'ÿ', 'ñ',
288
				'ç', 'ÿ', 'ñ',
291
				'À', 'Â', 'Ä', 'Á', 'Ã', 'Å',
289
				'À', 'Â', 'Ä', 'Á', 'Ã', 'Å',
292
				'Î', 'Ï', 'Ì', 'Í', 
290
				'Î', 'Ï', 'Ì', 'Í', 
293
				'Ô', 'Ö', 'Ò', 'Ó', 'Õ', 'Ø', 
291
				'Ô', 'Ö', 'Ò', 'Ó', 'Õ', 'Ø', 
294
				'Ù', 'Û', 'Ü', 'Ú', 
292
				'Ù', 'Û', 'Ü', 'Ú', 
295
				'É', 'È', 'Ê', 'Ë', 
293
				'É', 'È', 'Ê', 'Ë', 
296
				'Ç', 'Ÿ', 'Ñ',
294
				'Ç', 'Ÿ', 'Ñ',
297
			),
295
			),
298
			array(
296
			array(
299
				'a', 'a', 'a', 'a', 'a', 'a', 
297
				'a', 'a', 'a', 'a', 'a', 'a', 
300
				'i', 'i', 'i', 'i', 
298
				'i', 'i', 'i', 'i', 
301
				'o', 'o', 'o', 'o', 'o', 'o', 
299
				'o', 'o', 'o', 'o', 'o', 'o', 
302
				'u', 'u', 'u', 'u', 
300
				'u', 'u', 'u', 'u', 
303
				'e', 'e', 'e', 'e', 
301
				'e', 'e', 'e', 'e', 
304
				'c', 'y', 'n', 
302
				'c', 'y', 'n', 
305
				'A', 'A', 'A', 'A', 'A', 'A', 
303
				'A', 'A', 'A', 'A', 'A', 'A', 
306
				'I', 'I', 'I', 'I', 
304
				'I', 'I', 'I', 'I', 
307
				'O', 'O', 'O', 'O', 'O', 'O', 
305
				'O', 'O', 'O', 'O', 'O', 'O', 
308
				'U', 'U', 'U', 'U', 
306
				'U', 'U', 'U', 'U', 
309
				'E', 'E', 'E', 'E', 
307
				'E', 'E', 'E', 'E', 
310
				'C', 'Y', 'N', 
308
				'C', 'Y', 'N', 
311
			),$texte);
309
			),$texte);
312
		
310
		
313
		return $texte;	
311
		return $texte;	
314
	}
312
	}
-
 
313
	
-
 
314
	private function miniQuote($chaine) {
-
 
315
		return "'".$chaine."'";
-
 
316
	}
315
}
317
}
316
?>
318
?>
317
319