Subversion Repositories Sites.tela-botanica.org

Rev

Rev 265 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 david 1
<?php
2
 
3
// +--------------------------------------------------------------------------------+
4
// | annuaire_moteur_fonction.php 		                      						|
5
// +--------------------------------------------------------------------------------+
6
// | Copyright (c) 2000 - 2003 Tela Botanica 							        	|
7
// +--------------------------------------------------------------------------------+
8
// | Les fonctions de annuaire_moteur.php                                           |
9
// +--------------------------------------------------------------------------------+
10
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> 		  		        |
11
// +--------------------------------------------------------------------------------+
12
//
13
// $Id: annuaire_moteur_fonction.php,v 1.1 2005/03/24 08:47:31 alex Exp $
14
 
15
 
263 alex 16
include_once 'api/pear/HTML/QuickForm/select.php';
17
 
4 david 18
/** function mkengine ()
19
*
20
*
21
*
22
*	@return
23
*/
24
 
25
function mkengine()
26
  {
27
    global $label_bbota;
28
    global $nbr_total;
29
    global $bouton, $HTTP_POST_VARS ;
30
 
263 alex 31
 
4 david 32
    $mes_vars = array ("recherche", "nom", "ville", "mail" ,"dept", "prenom", "cotisant", "pays", "sort", "T_REPONSE", "lettre","statut") ;
33
 
34
    // Deux cas , soit on a cliqué sur rechercher, soit on a cliqué sur un lien
35
    foreach ($mes_vars as $key=>$value) {
36
        if (!$bouton) {     // on a cliqué sur un lien
37
            if (empty($HTTP_POST_VARS[$value])) {
263 alex 38
 
4 david 39
            }
40
        } else {
41
            // Si on clique sur le bouton rechercher
42
            if (empty ($HTTP_POST_VARS[$value])) {
43
                $$value = "" ;
44
            } else {
45
                $$value = $HTTP_POST_VARS[$value] ;
46
            }
47
        }
48
    }
263 alex 49
 
4 david 50
    // Comptage du nombre total de données dans la table (hors CACHER = 1)
51
    $query = "select count(*) as CPT from ".ANN_ANNUAIRE;
263 alex 52
    $result = $GLOBALS['ann_db']->query($query) ;
53
	if (DB::isError($result)) {
54
		return $result->getMessage().'<br />'.$result->getDebugInfo();
55
	}
4 david 56
 
263 alex 57
	if ($result->numRows() == 1) {
58
	    $tmp_nb = $result->fetchRow(DB_FETCHMODE_OBJECT);
59
	    $nbr_total = $tmp_nb->CPT;
60
	    if ($nbr_total > 0) $chaine = "parmi $nbr_total données";
61
	    else die("<B>Erreur</B> lors du comptage des structures ($nbr_total trouvées) : $query");
62
    } else die("<B>Erreur</B> lors du comptage des structures : $query");
4 david 63
 
263 alex 64
	$result->free();
4 david 65
  // fin comptage
66
 
263 alex 67
	$ret = '<h1>'.AM_L_TITRE.'</h1>'."\n";
68
	$ret .= '<h2>'.AM_L_TITRE.' '.$chaine.'</h2>'."\n";
4 david 69
  // construction du moteur de str
263 alex 70
 	$formulaire = new HTML_QuickForm('formulaire_recherche', 'post', str_replace('&amp;', '&', $GLOBALS['ann_url']->getURL()));
71
 
274 jpm 72
 	$squelette =& $formulaire->defaultRenderer();
73
    $squelette->setFormTemplate("\n".'<div id="annuaire_zone_recherche"><table id="annuaire_recherche"><form{attributes}>'."\n".'{content}'."\n".'</form></table></div>'."\n");
74
    $squelette->setElementTemplate(  '<tr>'."\n".
75
                                    '<td class="champ">{label}</td>'."\n".
76
                                    '<td class="valeur">{element}'.
77
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">'.ADME_LG_FORM_SYMBOLE_CHP_OBLIGATOIRE.'</span><!-- END required -->'.
78
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'.
79
                                    '</td>'."\n".
80
                                    '</tr>'."\n");
81
 
263 alex 82
 	$formulaire->addElement('text', 'recherche', AM_L_RECHERCHER);
83
 
84
 	$requete = 'select GC_ID, GC_NAME from gen_COUNTRY where GC_LOCALE="fr"';
85
    $pays = &$GLOBALS['ann_db']->getAssoc ($requete);
86
 
87
    $pays = array_merge (array('tous' => 'Tous les pays'), $pays);
88
 
89
    if (DB::isError($pays)) {
90
		return $pays->getMessage().'<br />'.$pays->getDebugInfo();
91
	}
4 david 92
 
263 alex 93
	$select = new HTML_QuickForm_select ('pays', AM_L_PAYS, $pays, array ('class' => 'projet_asso')) ;
94
	$formulaire->addElement($select) ;
95
	$formulaire->addElement('text', 'nom', AM_L_NOM);
96
	$formulaire->addElement('text', 'prenom', AM_L_PRENOM);
97
	$formulaire->addElement('text', 'ville', AM_L_VILLE);
98
 
99
	$departement = & $GLOBALS['ann_db']->getAssoc('select GFD_ID, CONCAT(GFD_ID,\' - \',GFD_NAME) as GFD_NAME from gen_FRENCH_DPT');
100
	$departement = array_merge (array ('tous' => 'Tous'), $departement);
101
 
102
	$select_dpt = new HTML_QuickForm_select ('departement', AM_L_DEPARTEMENT, $departement, array ('class' => 'projet_asso')) ;
103
	$formulaire->addElement($select_dpt);
104
 
105
	$formulaire->addElement('text', 'mail', AM_L_MAIL);
106
 
107
	$cotisant = array (1 => 'Tous', 2 => 'Cotisants', 3 => 'Non cotisants');
108
 
109
	$select_cotisant = new HTML_QuickForm_select ('cotisant', AM_L_COTISANTS, $cotisant, array ('class' => 'projet_asso')) ;
110
	$formulaire->addElement($select_cotisant);
111
 
112
	$requete = 'select distinct(YEAR(IC_DATE)) as annees from annuaire_COTISATION';
113
    $resultat_annee_cotisation = &$GLOBALS['ann_db']->query ($requete);
4 david 114
 
263 alex 115
    if (DB::isError($resultat_annee_cotisation)) {
116
		return $resultat_annee_cotisation->getMessage().'<br />'.$resultat_annee_cotisation->getDebugInfo();
117
	}
118
	$tableau_annee_cotisation['Toutes'] = 'Toutes';
119
	while ($ligne_annee_cotisation = $resultat_annee_cotisation->fetchRow(DB_FETCHMODE_OBJECT)) {
120
    	$tableau_annee_cotisation[$ligne_annee_cotisation->annees] = $ligne_annee_cotisation->annees;
4 david 121
    }
263 alex 122
 
123
	$select_annee = new HTML_QuickForm_select ('annee_cotisation', 'Année', $tableau_annee_cotisation, array ('class' => 'projet_asso')) ;
124
	$formulaire->addElement($select_annee);
125
 
126
	$grp = array(20 => 20, 50 => 50, 100 => 100) ;
274 jpm 127
	$select_grp = new HTML_QuickForm_select ('T_REPONSE', 'Résultat par', $grp, array ('class' => 'projet_asso')) ;
263 alex 128
	$formulaire->addElement($select_grp);
129
	$formulaire->addElement('submit', 'bouton', AM_L_RECHERCHER);
130
	foreach ($mes_vars as $key=>$value) {
131
		if (isset($_POST[$value])) {
132
			$default[$value] = $_POST[$value] ;
133
		}
134
	}
135
	$formulaire->setDefaults($_POST);
4 david 136
 
263 alex 137
    $ret .= '<br />'.$formulaire->toHTML();
4 david 138
    return $ret;
139
}
140
 
141
function mkquery()
142
{
143
    // définition des variables globales
144
	global $lettre ;
263 alex 145
	global $bouton ;
4 david 146
 
147
	// Requete sur l'annuaire pour extraire le nom, prénom, ville, nom du département (jointure),
148
	// l'état de la cotisation (jointure)
149
 
150
	// le tableau suivant contient tous les champs de la table annuaire_tela sur lesquels on peut effectuer une recherche
265 alex 151
	$fields_annu = array("nom" => ANN_CHAMPS_NOM, "prenom" => ANN_CHAMPS_PRENOM , "mail" => ANN_CHAMPS_MAIL , "ville" => ANN_CHAMPS_VILLE,
152
			"dept" => "U_FRENCH_DPT", "pays" => ANN_CHAMPS_PAYS  ) ;
4 david 153
 
263 alex 154
    $mes_vars = array ("recherche", "nom", "ville", "mail" ,"dept",
155
						"prenom", "cotisant", "pays", "sort", "T_REPONSE",
156
						"lettre","statut", "annee_cotisation") ;
4 david 157
 
158
    foreach ($mes_vars as $key=>$value) {
159
        if (!$bouton) {
263 alex 160
 
4 david 161
        } else {
162
            $lettre = "" ;
263 alex 163
            if (empty ($_REQUEST[$value])) {
4 david 164
                $$value = "" ;
165
            } else {
263 alex 166
                $$value = $_REQUEST[$value] ;
4 david 167
            }
168
        }
169
    }
265 alex 170
    $queries = 'select '.ANN_CHAMPS_ID.','.ANN_CHAMPS_NOM.', '.ANN_CHAMPS_PRENOM.', '.
171
    				ANN_CHAMPS_PAYS.','.ANN_CHAMPS_MAIL.', '.ANN_CHAMPS_VILLE ;
4 david 172
    $queries .= ", ".ANN_TABLE_PAYS.".GC_NAME ";
263 alex 173
	$queries .= "from ";
174
	$queries .= ANN_TABLE_PAYS.','.ANN_ANNUAIRE ;
175
	// On effectue une jointure gauche si l on veut tous les inscrits
176
	// y compris ce qui ne cotisent pas sinon pas de jointure gauche
177
	/*
178
	if (isset($cotisant) && $cotisant != 1) {
179
 
180
	} else {
181
		$queries .= ' left ' ;
182
	}
183
	$queries .= ' join annuaire_COTISATION on '.
184
    				ANN_ANNUAIRE.'.U_ID=annuaire_COTISATION.IC_ANNU_ID ';
185
 
186
    if (isset($annee_cotisation) && $annee_cotisation != 0) {
187
        	$queries .= ' and year(IC_DATE)='.$annee_cotisation ;
188
    } else {
189
    		$queries .= 'and year(IC_DATE)='.date('Y') ;
190
    }
191
 */
4 david 192
	// Construction en fonction des champs saisies
193
 
194
	// juste le champs "rechercher", on regarde partout
263 alex 195
	$queries .= " where " ;
4 david 196
 
197
	if ($lettre == "") {
263 alex 198
        if ($_REQUEST['recherche'] != '') {
265 alex 199
            $queries .= '('.ANN_CHAMPS_NOM.' like "%'.$_REQUEST['recherche'].'%"' ; // le premier
4 david 200
                foreach($fields_annu as $key=>$value) {
201
					if ($key == "nom") continue ;
202
							$queries .= ($key == "pays" ?
203
                                    $pays == "tous" ? ")" :
204
                                    ") and $value = '$pays'" : " or $value like '%$recherche%'") ;	// les autres
205
                }
263 alex 206
				$queries .= ' and ' ;
4 david 207
			} else {
208
 
209
			// si un ou plusieurs autres champs ont été indiqué, on les rajoute ici
210
 
211
			$or_flag = false ;
212
			foreach($fields_annu as $key=>$valeur) {
213
                if ($key != "") {
263 alex 214
                    if ($key == "pays" && ($$key != 'tous' && $$key != '')) {
215
                        if ($$key != "tous") $queries .= ") and $valeur like \"%".$$key."%\"" ;
4 david 216
                    } else {
217
                        if ($key == "dept") {
218
                            if ($$key != "tous" && isset($HTTP_POST_VARS[$key])) {
219
                                $queries .= " and U_FRENCH_DPT=".$$key ;
265 alex 220
                                if ($fields_annu["pays"] != "fr") $queries .= ' and '.ANN_CHAMPS_PAYS.'="fr"' ;
4 david 221
                            }
222
 
223
                        } else {
263 alex 224
                            if ($$key != '' && $key != 'pays') {
225
                            	if (!$or_flag) $queries .= '(' ;
226
                            	$queries .= $valeur.' like "%'.$$key.'%"' ;
227
                            	if ($key != "ville") $queries .= " and " ;
228
                            }
229
 
4 david 230
                        }
231
                    }
232
                    $or_flag = true ;
233
                }
234
			}
235
			// ici le cas ou rien n'a été saisie du tout, on affiche tout
236
			if (!$or_flag) {
265 alex 237
					$queries .= ANN_CHAMPS_NOM.' like "%")' ;
4 david 238
			}
239
	}
240
} else {
241
	if ($lettre == "tous") $lettre = "" ;
265 alex 242
	$queries .= ANN_CHAMPS_NOM.' like "'.$lettre.'%"' ;
4 david 243
}
263 alex 244
    $queries .= "" ;
245
    // jointure entre annuaire et table des pays annuaire_tela et gen_COUNTRY
265 alex 246
	$queries .= "  ".ANN_ANNUAIRE.".".ANN_CHAMPS_PAYS."=".ANN_TABLE_PAYS.".GC_ID" ;
263 alex 247
 
265 alex 248
    if (isset($nom) && $nom != "") $queries .= " and ".ANN_CHAMPS_NOM." like \"%$nom%\"" ;
249
    if (isset($prenom) && $prenom != "") $queries .= " and ".ANN_CHAMPS_PRENOM." like \"%$prenom%\"" ;
250
    if (isset($ville) && $ville != "") $queries .= " and ".ANN_CHAMPS_VILLE." like \"%$ville%\"" ;
251
    if (isset($mail) && $mail != "") $queries .= " and ".ANN_CHAMPS_MAIL." like \"%$mail%\"" ;
263 alex 252
  if (isset($_REQUEST['sort']) && $_REQUEST['sort'] != '') $queries .= ' order by '.$_REQUEST['sort'] ;
4 david 253
  return $queries;
254
}
255
 
263 alex 256
function mkresu() {
257
 
4 david 258
    $requete = mkquery() ;
263 alex 259
 
260
	// Requete sans le limit pour le nombre de resultat
261
	$resultat_nbr = $GLOBALS['ann_db']->query($requete) ;
262
    if (DB::isError($resultat_nbr)) {
263
		return $resultat_nbr->getMessage().'<br />'.$resultat_nbr->getDebugInfo().'<br />'.$requete ;
264
	}
265
	$nbr_final = $resultat_nbr->numRows() ;
266
	$resultat_nbr->free();
267
	$_SESSION['requete_mail_tous'] = $requete ;
268
 
269
	if (!isset($_REQUEST['T_REPONSE'])) $_REQUEST['T_REPONSE'] = 20 ;
270
	$debut = $_REQUEST['pageID'] * $_REQUEST['T_REPONSE'];
271
	$requete .= ' limit '.$debut.','.$_REQUEST['T_REPONSE'];
272
    // Requetes avec les résultats affichés
4 david 273
 
263 alex 274
    $resultat = $GLOBALS['ann_db']->query($requete) ;
275
    if (DB::isError($resultat)) {
276
		return $resultat->getMessage().'<br />'.$resultat->getDebugInfo().'<br />'.$requete ;
277
	}
4 david 278
 
279
 
263 alex 280
    $variables_a_supprimer = array ('username', 'password', 'connexion');
281
	foreach ($variables_a_supprimer as $var) if (isset($_POST[$var])) unset ($_POST[$var]) ;
282
 
283
 
284
	$variables = array_merge ($_POST, $_GET);
285
 
286
	foreach ($variables as $key => $var) if ($variables[$key] != '') $GLOBALS['ann_url']->addQueryString($key, $variables[$key]);
4 david 287
 
274 jpm 288
    $ret = "<table id=\"recherche_alphabetique\"><tr>" ;
4 david 289
 
290
    for ($i = 65 ; $i <91 ; $i++) {
291
        $ret .= "\t<td><a href=\"".$GLOBALS['ann_url']->getURL()."&lettre=";
292
        $ret .= chr($i)."\">";
293
        $ret .= chr($i) ;
294
        $ret .= "</a></td>\n";
295
	}
263 alex 296
	$GLOBALS['ann_url']->addQueryString('lettre', 'tous');
297
    $ret .= '<td>&nbsp;&nbsp;<a href="'.$GLOBALS['ann_url']->getURL().'">'.AM_L_TOUS."</a></td>\n" ;
274 jpm 298
    $ret .= "<tr></table>\n" ;
299
 
263 alex 300
    include_once 'api/pear/Pager/Pager.php';
301
 
302
	$params = array(
303
	    'mode'       => 'Jumping',
304
	    'perPage'    => $_REQUEST['T_REPONSE'],
305
	    'delta'      => 12,
306
	    'httpMethod' => 'GET',
307
	    'extraVars' => array_merge($_POST, $_GET),
308
	    'altNext' => 'Suivant',
309
	    'altPrev' => 'Précédent',
310
	    'nextImg' => 'Suivant',
311
	    'prevImg' => 'Précedent',
312
	    'totalItems'   => $nbr_final
313
		);
314
	$pager = & Pager::factory($params);
315
	$data  = $pager->getPageData();
316
	$links = $pager->getLinks();
317
	$range = $pager->getOffsetByPageId();
318
	$ret .= '<h2>'.$range[0].' - '.$range[1].' parmi '.$nbr_final.'</h2>';
319
	$ret .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
320
	include_once 'api/pear/HTML/Table.php';
321
	$table = new HTML_Table(array("class" => "table_cadre"));
265 alex 322
	$table->addRow(array("<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=".ANN_CHAMPS_NOM."\">Identit&eacute;</a>",
323
					"<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=".ANN_CHAMPS_MAIL."\">Adresse mail</a>",
324
					"<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=".ANN_CHAMPS_VILLE."\">".AM_L_VILLE, "Pays ou Dpt (fr)",
263 alex 325
					"<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=U_COT\">Cotisant en ".date(Y)),'', 'TH') ;
265 alex 326
	while ($valeur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
263 alex 327
		$ligne_tableau = array();
328
		$montant = 0;
329
		// Le nom de l inscrit avec un lien dessus pour voir les details
265 alex 330
		$GLOBALS['ann_url']->addQueryString('u_id', $valeur[ANN_CHAMPS_ID]);
331
		array_push ($ligne_tableau, '<a href="'.$GLOBALS['ann_url']->getURL().'">'.$valeur[ANN_CHAMPS_NOM].' '.$valeur[ANN_CHAMPS_PRENOM].'</a>');
263 alex 332
 
333
		// l email
265 alex 334
		array_push ($ligne_tableau, '<a href="mailto:'.$valeur[ANN_CHAMPS_MAIL].'">'.$valeur[ANN_CHAMPS_MAIL].'</a>');
263 alex 335
		// La ville
265 alex 336
		array_push ($ligne_tableau, $valeur[ANN_CHAMPS_VILLE]);
263 alex 337
 
338
		// Le pays ou le departement si francais
265 alex 339
		if ($valeur['U_COUNTRY'] != 'fr') {
340
			array_push ($ligne_tableau,  $valeur['GC_NAME']) ;
4 david 341
		} else {
265 alex 342
	        $req_dpt = 'select GFD_NAME from '.ANN_TABLE_DEPARTEMENT.','.ANN_ANNUAIRE.
343
						' where '.ANN_ANNUAIRE.'.'.ANN_CHAMPS_ID.'='.$valeur[ANN_CHAMPS_ID] ;
263 alex 344
	        $req_dpt .= " and ".ANN_ANNUAIRE.".U_FRENCH_DPT=".ANN_TABLE_DEPARTEMENT.".GFD_ID" ;
345
	        $resultat_dpt = $GLOBALS['ann_db']->query($req_dpt) ;
346
	        if (DB::isError($resultat_dpt)) {
347
	        	return $resultat_dpt->getMessage().'<br />'.$resultat_dpt->getDebugInfo().'<br />'.$req_dpt ;
348
	        }
349
	        $ligne_dpt = $resultat_dpt->fetchRow(DB_FETCHMODE_OBJECT) ;
350
			array_push ($ligne_tableau, $ligne_dpt->GFD_NAME) ;
4 david 351
		}
263 alex 352
		// Si cotisant
353
		if ($valeur->IC_MONTANT != NULL) $montant = $valeur->IC_MONTANT.' &euro;';
354
		array_push ($ligne_tableau, $montant);
355
		$table->addRow($ligne_tableau);
356
	}
274 jpm 357
	$table->altRowAttributes(1, array("class" => "ligne_paire"), array("class" => "ligne_impaire"), true);
263 alex 358
	$ret .= $table->toHTML();
359
	$GLOBALS['ann_url']->removeQueryString('u_id');
360
 
361
	$ret .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
362
	$GLOBALS['ann_url']->addQueryString(ANN_VARIABLE_ACTION, ANN_ACTION_MAIL_TOUS);
274 jpm 363
	$ret .= "<div id=\"envoyer_selection\"><a href=\"".$GLOBALS['ann_url']->getURL()."\">".AM_L_MAIL_SELECTION."</a></div>\n" ;
364
	$ret .= '<pre id="debogage">'.$requete.'</pre>';
4 david 365
  return $ret;
366
}
367
 
263 alex 368
function resume_cotisation() {
369
 
370
	$res = '<h1>Etat des cotisations</h1>'."\n";
371
 
372
	$requete = 'select distinct(YEAR(IC_DATE)) as annees from annuaire_COTISATION';
373
    $tableau_annee_cotisation = &$GLOBALS['ann_db']->getCol ($requete);
374
    if (DB::isError($tableau_annee_cotisation)) {
375
		return $tableau_annee_cotisation->getMessage().'<br />'.$tableau_annee_cotisation->getDebugInfo();
376
	}
377
	$requete = 'select MC_ID,MC_LABEL from MODE_COTISATION order by MC_ID' ;
378
	$tableau_mode_cotisation = & $GLOBALS['ann_db']->getAssoc($requete);
379
	if (DB::isError($tableau_annee_cotisation)) {
380
		return $tableau_mode_cotisation->getMessage().'<br />'.$tableau_mode_cotisation->getDebugInfo();
381
	}
382
	// Initialisation de la table
383
	include_once 'api/pear/HTML/Table.php';
384
	$table = new HTML_Table(array('class' => 'table_cadre'));
385
	$table->addRow(array_merge (array('Année'), $tableau_mode_cotisation,
386
				array('Total', 'Nb cotisant', 'Nb inscrit', 'Ratio')), '', 'TH');
387
 
388
	foreach ($tableau_annee_cotisation as $annee) {
389
 
390
		// recherche du nombre d adherent de l annee
391
		$requete_nb_cotisant = 'select count(*) as nbr from annuaire_tela where U_DATE < "'.$annee.'-12-31" union'.
392
								' select count(*) as nbr from annuaire_COTISATION where year(IC_DATE)='.$annee;
393
		// La requete union renvoie une colonne appele nbr avec 2 lignes le nbre inscrit a tela et le nbre de cotisant
394
		// pour une année donnee
395
 
396
		$resultat = $GLOBALS['ann_db']->query($requete_nb_cotisant);
397
		if (DB::isError($resultat)) {
398
				return $resultat->getMessage().'<br />'.$rseultat->getDebugInfo();
399
		}
400
		$nb_inscrit_annee = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
401
		$nb_cotisant_annee = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
402
		$ratio = $nb_cotisant_annee->nbr / $nb_inscrit_annee->nbr * 100;
403
		$ligne_table = array();
404
 
405
		// On insere une premiere colone pour les annees
406
		array_push ($ligne_table, $annee);
407
		$somme_annee = 0;
408
		foreach ($tableau_mode_cotisation as $mode_id => $mode_label) {
409
			$requete = 'select sum(IC_MONTANT) as montant from annuaire_COTISATION where IC_MC_ID='.$mode_id.
410
						' and year(IC_DATE)='.$annee;
411
			$montant = $GLOBALS['ann_db']->getOne($requete);
412
			if (DB::isError($montant)) {
413
				return $montant->getMessage().'<br />'.$montant->getDebugInfo();
414
			}
415
			array_push ($ligne_table, $montant);
416
			$somme_annee += $montant;
417
		}
418
 
419
		array_push ($ligne_table, $somme_annee, $nb_cotisant_annee->nbr, $nb_inscrit_annee->nbr,substr((string)$ratio, 0, 5).' %');
420
 
421
		$table->addRow($ligne_table);
422
 
423
	}
424
	$res .= $table->toHTML();
425
	$res .= print_r(parse_url($GLOBALS['ann_url']->getURL(), PHP_URL_PATH), true);
426
	return $res;
427
}
428
/* +--Fin du code ----------------------------------------------------------------------------------------+
4 david 429
*
263 alex 430
* $Log:$
431
* * +-- Fin du code ----------------------------------------------------------------------------------------+
4 david 432
*/
433
 
263 alex 434
?>