Subversion Repositories Sites.tela-botanica.org

Rev

Rev 287 | 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
 
98
	$departement = & $GLOBALS['ann_db']->getAssoc('select GFD_ID, CONCAT(GFD_ID,\' - \',GFD_NAME) as GFD_NAME from gen_FRENCH_DPT');
99
	$departement = array_merge (array ('tous' => 'Tous'), $departement);
100
 
101
	$select_dpt = new HTML_QuickForm_select ('departement', AM_L_DEPARTEMENT, $departement, array ('class' => 'projet_asso')) ;
102
	$formulaire->addElement($select_dpt);
103
 
104
	$formulaire->addElement('text', 'mail', AM_L_MAIL);
105
 
106
	$cotisant = array (1 => 'Tous', 2 => 'Cotisants', 3 => 'Non cotisants');
107
 
108
	$select_cotisant = new HTML_QuickForm_select ('cotisant', AM_L_COTISANTS, $cotisant, array ('class' => 'projet_asso')) ;
109
	$formulaire->addElement($select_cotisant);
110
 
111
	$requete = 'select distinct(YEAR(IC_DATE)) as annees from annuaire_COTISATION';
112
    $resultat_annee_cotisation = &$GLOBALS['ann_db']->query ($requete);
4 david 113
 
263 alex 114
    if (DB::isError($resultat_annee_cotisation)) {
115
		return $resultat_annee_cotisation->getMessage().'<br />'.$resultat_annee_cotisation->getDebugInfo();
116
	}
117
	$tableau_annee_cotisation['Toutes'] = 'Toutes';
118
	while ($ligne_annee_cotisation = $resultat_annee_cotisation->fetchRow(DB_FETCHMODE_OBJECT)) {
119
    	$tableau_annee_cotisation[$ligne_annee_cotisation->annees] = $ligne_annee_cotisation->annees;
4 david 120
    }
263 alex 121
 
122
	$select_annee = new HTML_QuickForm_select ('annee_cotisation', 'Année', $tableau_annee_cotisation, array ('class' => 'projet_asso')) ;
123
	$formulaire->addElement($select_annee);
124
 
125
	$grp = array(20 => 20, 50 => 50, 100 => 100) ;
274 jpm 126
	$select_grp = new HTML_QuickForm_select ('T_REPONSE', 'Résultat par', $grp, array ('class' => 'projet_asso')) ;
263 alex 127
	$formulaire->addElement($select_grp);
128
	$formulaire->addElement('submit', 'bouton', AM_L_RECHERCHER);
129
	foreach ($mes_vars as $key=>$value) {
130
		if (isset($_POST[$value])) {
131
			$default[$value] = $_POST[$value] ;
132
		}
133
	}
134
	$formulaire->setDefaults($_POST);
4 david 135
 
263 alex 136
    $ret .= '<br />'.$formulaire->toHTML();
4 david 137
    return $ret;
138
}
139
 
140
function mkquery()
141
{
142
    // définition des variables globales
143
	global $lettre ;
263 alex 144
	global $bouton ;
4 david 145
 
146
	// Requete sur l'annuaire pour extraire le nom, prénom, ville, nom du département (jointure),
147
	// l'état de la cotisation (jointure)
148
 
149
	// le tableau suivant contient tous les champs de la table annuaire_tela sur lesquels on peut effectuer une recherche
265 alex 150
	$fields_annu = array("nom" => ANN_CHAMPS_NOM, "prenom" => ANN_CHAMPS_PRENOM , "mail" => ANN_CHAMPS_MAIL , "ville" => ANN_CHAMPS_VILLE,
151
			"dept" => "U_FRENCH_DPT", "pays" => ANN_CHAMPS_PAYS  ) ;
4 david 152
 
263 alex 153
    $mes_vars = array ("recherche", "nom", "ville", "mail" ,"dept",
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 ;
174
	// On effectue une jointure gauche si l on veut tous les inscrits
175
	// y compris ce qui ne cotisent pas sinon pas de jointure gauche
176
	/*
177
	if (isset($cotisant) && $cotisant != 1) {
178
 
179
	} else {
180
		$queries .= ' left ' ;
181
	}
182
	$queries .= ' join annuaire_COTISATION on '.
183
    				ANN_ANNUAIRE.'.U_ID=annuaire_COTISATION.IC_ANNU_ID ';
184
 
185
    if (isset($annee_cotisation) && $annee_cotisation != 0) {
186
        	$queries .= ' and year(IC_DATE)='.$annee_cotisation ;
187
    } else {
188
    		$queries .= 'and year(IC_DATE)='.date('Y') ;
189
    }
190
 */
4 david 191
	// Construction en fonction des champs saisies
192
 
193
	// juste le champs "rechercher", on regarde partout
263 alex 194
	$queries .= " where " ;
4 david 195
 
196
	if ($lettre == "") {
263 alex 197
        if ($_REQUEST['recherche'] != '') {
265 alex 198
            $queries .= '('.ANN_CHAMPS_NOM.' like "%'.$_REQUEST['recherche'].'%"' ; // le premier
4 david 199
                foreach($fields_annu as $key=>$value) {
200
					if ($key == "nom") continue ;
201
							$queries .= ($key == "pays" ?
202
                                    $pays == "tous" ? ")" :
203
                                    ") and $value = '$pays'" : " or $value like '%$recherche%'") ;	// les autres
204
                }
263 alex 205
				$queries .= ' and ' ;
4 david 206
			} else {
207
 
208
			// si un ou plusieurs autres champs ont été indiqué, on les rajoute ici
209
 
210
			$or_flag = false ;
211
			foreach($fields_annu as $key=>$valeur) {
212
                if ($key != "") {
263 alex 213
                    if ($key == "pays" && ($$key != 'tous' && $$key != '')) {
214
                        if ($$key != "tous") $queries .= ") and $valeur like \"%".$$key."%\"" ;
4 david 215
                    } else {
216
                        if ($key == "dept") {
217
                            if ($$key != "tous" && isset($HTTP_POST_VARS[$key])) {
218
                                $queries .= " and U_FRENCH_DPT=".$$key ;
265 alex 219
                                if ($fields_annu["pays"] != "fr") $queries .= ' and '.ANN_CHAMPS_PAYS.'="fr"' ;
4 david 220
                            }
221
 
222
                        } else {
263 alex 223
                            if ($$key != '' && $key != 'pays') {
224
                            	if (!$or_flag) $queries .= '(' ;
225
                            	$queries .= $valeur.' like "%'.$$key.'%"' ;
226
                            	if ($key != "ville") $queries .= " and " ;
227
                            }
228
 
4 david 229
                        }
230
                    }
231
                    $or_flag = true ;
232
                }
233
			}
234
			// ici le cas ou rien n'a été saisie du tout, on affiche tout
235
			if (!$or_flag) {
265 alex 236
					$queries .= ANN_CHAMPS_NOM.' like "%")' ;
4 david 237
			}
238
	}
239
} else {
240
	if ($lettre == "tous") $lettre = "" ;
287 alex 241
	$queries .= ANN_CHAMPS_NOM.' like "'.$lettre.'%" and ' ;
4 david 242
}
263 alex 243
    $queries .= "" ;
244
    // jointure entre annuaire et table des pays annuaire_tela et gen_COUNTRY
265 alex 245
	$queries .= "  ".ANN_ANNUAIRE.".".ANN_CHAMPS_PAYS."=".ANN_TABLE_PAYS.".GC_ID" ;
263 alex 246
 
265 alex 247
    if (isset($nom) && $nom != "") $queries .= " and ".ANN_CHAMPS_NOM." like \"%$nom%\"" ;
248
    if (isset($prenom) && $prenom != "") $queries .= " and ".ANN_CHAMPS_PRENOM." like \"%$prenom%\"" ;
249
    if (isset($ville) && $ville != "") $queries .= " and ".ANN_CHAMPS_VILLE." like \"%$ville%\"" ;
250
    if (isset($mail) && $mail != "") $queries .= " and ".ANN_CHAMPS_MAIL." like \"%$mail%\"" ;
263 alex 251
  if (isset($_REQUEST['sort']) && $_REQUEST['sort'] != '') $queries .= ' order by '.$_REQUEST['sort'] ;
4 david 252
  return $queries;
253
}
254
 
263 alex 255
function mkresu() {
256
 
4 david 257
    $requete = mkquery() ;
263 alex 258
 
259
	// Requete sans le limit pour le nombre de resultat
260
	$resultat_nbr = $GLOBALS['ann_db']->query($requete) ;
261
    if (DB::isError($resultat_nbr)) {
262
		return $resultat_nbr->getMessage().'<br />'.$resultat_nbr->getDebugInfo().'<br />'.$requete ;
263
	}
264
	$nbr_final = $resultat_nbr->numRows() ;
265
	$resultat_nbr->free();
266
	$_SESSION['requete_mail_tous'] = $requete ;
267
 
268
	if (!isset($_REQUEST['T_REPONSE'])) $_REQUEST['T_REPONSE'] = 20 ;
269
	$debut = $_REQUEST['pageID'] * $_REQUEST['T_REPONSE'];
270
	$requete .= ' limit '.$debut.','.$_REQUEST['T_REPONSE'];
271
    // Requetes avec les résultats affichés
4 david 272
 
263 alex 273
    $resultat = $GLOBALS['ann_db']->query($requete) ;
274
    if (DB::isError($resultat)) {
275
		return $resultat->getMessage().'<br />'.$resultat->getDebugInfo().'<br />'.$requete ;
276
	}
4 david 277
 
278
 
263 alex 279
    $variables_a_supprimer = array ('username', 'password', 'connexion');
280
	foreach ($variables_a_supprimer as $var) if (isset($_POST[$var])) unset ($_POST[$var]) ;
281
 
282
 
283
	$variables = array_merge ($_POST, $_GET);
284
 
285
	foreach ($variables as $key => $var) if ($variables[$key] != '') $GLOBALS['ann_url']->addQueryString($key, $variables[$key]);
4 david 286
 
274 jpm 287
    $ret = "<table id=\"recherche_alphabetique\"><tr>" ;
4 david 288
 
289
    for ($i = 65 ; $i <91 ; $i++) {
290
        $ret .= "\t<td><a href=\"".$GLOBALS['ann_url']->getURL()."&lettre=";
291
        $ret .= chr($i)."\">";
292
        $ret .= chr($i) ;
293
        $ret .= "</a></td>\n";
294
	}
263 alex 295
	$GLOBALS['ann_url']->addQueryString('lettre', 'tous');
296
    $ret .= '<td>&nbsp;&nbsp;<a href="'.$GLOBALS['ann_url']->getURL().'">'.AM_L_TOUS."</a></td>\n" ;
274 jpm 297
    $ret .= "<tr></table>\n" ;
298
 
263 alex 299
    include_once 'api/pear/Pager/Pager.php';
300
 
301
	$params = array(
302
	    'mode'       => 'Jumping',
303
	    'perPage'    => $_REQUEST['T_REPONSE'],
304
	    'delta'      => 12,
305
	    'httpMethod' => 'GET',
306
	    'extraVars' => array_merge($_POST, $_GET),
307
	    'altNext' => 'Suivant',
308
	    'altPrev' => 'Précédent',
309
	    'nextImg' => 'Suivant',
310
	    'prevImg' => 'Précedent',
311
	    'totalItems'   => $nbr_final
312
		);
313
	$pager = & Pager::factory($params);
314
	$data  = $pager->getPageData();
315
	$links = $pager->getLinks();
316
	$range = $pager->getOffsetByPageId();
317
	$ret .= '<h2>'.$range[0].' - '.$range[1].' parmi '.$nbr_final.'</h2>';
318
	$ret .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
319
	include_once 'api/pear/HTML/Table.php';
320
	$table = new HTML_Table(array("class" => "table_cadre"));
265 alex 321
	$table->addRow(array("<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=".ANN_CHAMPS_NOM."\">Identit&eacute;</a>",
322
					"<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=".ANN_CHAMPS_MAIL."\">Adresse mail</a>",
323
					"<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=".ANN_CHAMPS_VILLE."\">".AM_L_VILLE, "Pays ou Dpt (fr)",
263 alex 324
					"<a href=\"".$GLOBALS['ann_url']->getURL()."&amp;sort=U_COT\">Cotisant en ".date(Y)),'', 'TH') ;
265 alex 325
	while ($valeur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
263 alex 326
		$ligne_tableau = array();
327
		$montant = 0;
328
		// Le nom de l inscrit avec un lien dessus pour voir les details
265 alex 329
		$GLOBALS['ann_url']->addQueryString('u_id', $valeur[ANN_CHAMPS_ID]);
330
		array_push ($ligne_tableau, '<a href="'.$GLOBALS['ann_url']->getURL().'">'.$valeur[ANN_CHAMPS_NOM].' '.$valeur[ANN_CHAMPS_PRENOM].'</a>');
263 alex 331
 
332
		// l email
265 alex 333
		array_push ($ligne_tableau, '<a href="mailto:'.$valeur[ANN_CHAMPS_MAIL].'">'.$valeur[ANN_CHAMPS_MAIL].'</a>');
263 alex 334
		// La ville
265 alex 335
		array_push ($ligne_tableau, $valeur[ANN_CHAMPS_VILLE]);
263 alex 336
 
337
		// Le pays ou le departement si francais
265 alex 338
		if ($valeur['U_COUNTRY'] != 'fr') {
339
			array_push ($ligne_tableau,  $valeur['GC_NAME']) ;
4 david 340
		} else {
265 alex 341
	        $req_dpt = 'select GFD_NAME from '.ANN_TABLE_DEPARTEMENT.','.ANN_ANNUAIRE.
342
						' where '.ANN_ANNUAIRE.'.'.ANN_CHAMPS_ID.'='.$valeur[ANN_CHAMPS_ID] ;
263 alex 343
	        $req_dpt .= " and ".ANN_ANNUAIRE.".U_FRENCH_DPT=".ANN_TABLE_DEPARTEMENT.".GFD_ID" ;
344
	        $resultat_dpt = $GLOBALS['ann_db']->query($req_dpt) ;
345
	        if (DB::isError($resultat_dpt)) {
346
	        	return $resultat_dpt->getMessage().'<br />'.$resultat_dpt->getDebugInfo().'<br />'.$req_dpt ;
347
	        }
348
	        $ligne_dpt = $resultat_dpt->fetchRow(DB_FETCHMODE_OBJECT) ;
349
			array_push ($ligne_tableau, $ligne_dpt->GFD_NAME) ;
4 david 350
		}
263 alex 351
		// Si cotisant
352
		if ($valeur->IC_MONTANT != NULL) $montant = $valeur->IC_MONTANT.' &euro;';
353
		array_push ($ligne_tableau, $montant);
354
		$table->addRow($ligne_tableau);
355
	}
274 jpm 356
	$table->altRowAttributes(1, array("class" => "ligne_paire"), array("class" => "ligne_impaire"), true);
263 alex 357
	$ret .= $table->toHTML();
358
	$GLOBALS['ann_url']->removeQueryString('u_id');
359
 
360
	$ret .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
361
	$GLOBALS['ann_url']->addQueryString(ANN_VARIABLE_ACTION, ANN_ACTION_MAIL_TOUS);
274 jpm 362
	$ret .= "<div id=\"envoyer_selection\"><a href=\"".$GLOBALS['ann_url']->getURL()."\">".AM_L_MAIL_SELECTION."</a></div>\n" ;
287 alex 363
	//$ret .= '<pre id="debogage">'.$requete.'</pre>';
4 david 364
  return $ret;
365
}
366
 
263 alex 367
function resume_cotisation() {
368
 
369
	$res = '<h1>Etat des cotisations</h1>'."\n";
370
 
371
	$requete = 'select distinct(YEAR(IC_DATE)) as annees from annuaire_COTISATION';
372
    $tableau_annee_cotisation = &$GLOBALS['ann_db']->getCol ($requete);
373
    if (DB::isError($tableau_annee_cotisation)) {
374
		return $tableau_annee_cotisation->getMessage().'<br />'.$tableau_annee_cotisation->getDebugInfo();
375
	}
376
	$requete = 'select MC_ID,MC_LABEL from MODE_COTISATION order by MC_ID' ;
377
	$tableau_mode_cotisation = & $GLOBALS['ann_db']->getAssoc($requete);
378
	if (DB::isError($tableau_annee_cotisation)) {
379
		return $tableau_mode_cotisation->getMessage().'<br />'.$tableau_mode_cotisation->getDebugInfo();
380
	}
381
	// Initialisation de la table
382
	include_once 'api/pear/HTML/Table.php';
383
	$table = new HTML_Table(array('class' => 'table_cadre'));
384
	$table->addRow(array_merge (array('Année'), $tableau_mode_cotisation,
385
				array('Total', 'Nb cotisant', 'Nb inscrit', 'Ratio')), '', 'TH');
386
 
387
	foreach ($tableau_annee_cotisation as $annee) {
388
 
389
		// recherche du nombre d adherent de l annee
390
		$requete_nb_cotisant = 'select count(*) as nbr from annuaire_tela where U_DATE < "'.$annee.'-12-31" union'.
391
								' select count(*) as nbr from annuaire_COTISATION where year(IC_DATE)='.$annee;
392
		// La requete union renvoie une colonne appele nbr avec 2 lignes le nbre inscrit a tela et le nbre de cotisant
393
		// pour une année donnee
394
 
395
		$resultat = $GLOBALS['ann_db']->query($requete_nb_cotisant);
396
		if (DB::isError($resultat)) {
397
				return $resultat->getMessage().'<br />'.$rseultat->getDebugInfo();
398
		}
399
		$nb_inscrit_annee = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
400
		$nb_cotisant_annee = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
401
		$ratio = $nb_cotisant_annee->nbr / $nb_inscrit_annee->nbr * 100;
402
		$ligne_table = array();
403
 
404
		// On insere une premiere colone pour les annees
405
		array_push ($ligne_table, $annee);
406
		$somme_annee = 0;
407
		foreach ($tableau_mode_cotisation as $mode_id => $mode_label) {
408
			$requete = 'select sum(IC_MONTANT) as montant from annuaire_COTISATION where IC_MC_ID='.$mode_id.
409
						' and year(IC_DATE)='.$annee;
410
			$montant = $GLOBALS['ann_db']->getOne($requete);
411
			if (DB::isError($montant)) {
412
				return $montant->getMessage().'<br />'.$montant->getDebugInfo();
413
			}
414
			array_push ($ligne_table, $montant);
415
			$somme_annee += $montant;
416
		}
417
 
418
		array_push ($ligne_table, $somme_annee, $nb_cotisant_annee->nbr, $nb_inscrit_annee->nbr,substr((string)$ratio, 0, 5).' %');
419
 
420
		$table->addRow($ligne_table);
421
 
422
	}
423
	$res .= $table->toHTML();
424
	return $res;
425
}
426
/* +--Fin du code ----------------------------------------------------------------------------------------+
4 david 427
*
263 alex 428
* $Log:$
429
* * +-- Fin du code ----------------------------------------------------------------------------------------+
4 david 430
*/
431
 
263 alex 432
?>