Subversion Repositories Sites.tela-botanica.org

Rev

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