Subversion Repositories Applications.annuaire

Rev

Rev 231 | Rev 294 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 231 Rev 247
Line 197... Line 197...
197
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_COURBE,$valeurs_a_stat_legende, '', array(500,490), $nom_axeX, '');
197
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_COURBE,$valeurs_a_stat_legende, '', array(500,490), $nom_axeX, '');
198
	    return $this->dessinerGraph($graph);
198
	    return $this->dessinerGraph($graph);
Line 199... Line 199...
199
 
199
 
Line -... Line 200...
-
 
200
	}
-
 
201
	
-
 
202
	public function obtenirStatistiquesModificationsProfil($id_annuaire, $annee_fin = '') {
-
 
203
 
-
 
204
	    $modele = new StatistiqueModele();
-
 
205
 
-
 
206
		$valeurs_a_stat_code = array();
-
 
207
		$valeurs_a_stat_legende = array();
-
 
208
			        
-
 
209
		$tab_mois = array("Jan","Fev","Mar","Avr","Mai","Juin","Juil","Aout","Sep","Oct","Nov","Dec");
-
 
210
		
-
 
211
		$annee_debut = 2010;
-
 
212
		$mois = 7;
-
 
213
		$annee = 2010;
-
 
214
		$tps_debut = mktime(0,0,0,$mois,1,$annee);
-
 
215
		$tps_courant = $tps_debut;
-
 
216
		
-
 
217
		if($annee_fin != '') {
-
 
218
			$tps_fin = mktime(0,0,0,1,1,$annee_fin);
-
 
219
		} else {
-
 
220
			$today = date_parse(date('Y-m-d H:i:s'));
-
 
221
			
-
 
222
			$annee_fin_today = $today['year'];
-
 
223
			$mois_fin_today = $today['month'];
-
 
224
						
-
 
225
			if($annee_debut == $annee_fin_today) {
-
 
226
				$tps_fin = mktime(0,0,0,$mois_fin_today+1,1,$annee_fin_today);
-
 
227
			} else {
-
 
228
				$tps_fin = time();// jour courant
-
 
229
			}
-
 
230
		}
-
 
231
		
-
 
232
		//Requete par mois
-
 
233
		$i = 1;
-
 
234
		while  ($tps_courant <= $tps_fin) {
-
 
235
			
-
 
236
			if (($mois)/12 > 1) {
-
 
237
				$mois = 1;
-
 
238
				$annee = $annee+1;
-
 
239
			}
-
 
240
			
-
 
241
			$tps_mois_suivant = mktime(0,0,0,$mois+1,1,$annee);
-
 
242
			
-
 
243
			$nb_modif_dans_intervalle = $modele->obtenirEvenementsDansIntervalle($id_annuaire,'modification', $tps_debut, $tps_courant);
-
 
244
			
-
 
245
			$valeurs_a_stat_legende[$tab_mois[$mois-1].' '.$annee] = $nb_modif_dans_intervalle;
-
 
246
			
-
 
247
			$tps_courant = $tps_mois_suivant;
-
 
248
			$mois++;
-
 
249
			$i++;
-
 
250
		}
-
 
251
 
-
 
252
		$nom_axeX = 'Mois depuis le 1er juillet 2010'; 
-
 
253
		
-
 
254
		$graph = $this->statistiques->genererGraphique(Statistiques::GRAPH_COURBE,$valeurs_a_stat_legende, '', array(500,490), $nom_axeX, '');
-
 
255
	    return $this->dessinerGraph($graph);
-
 
256
 
200
	}
257
	}
Line 201... Line 258...
201
	
258
	
202
	public function ajouterEvenementStatistique($id_annuaire, $id_utilisateur, $type) {
259
	public function ajouterEvenementStatistique($id_annuaire, $id_utilisateur, $type) {