235 |
alex |
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.1.1 2005-01-03 17:27:49 alex Exp $
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
/** function mkengine ()
|
|
|
17 |
*
|
|
|
18 |
*
|
|
|
19 |
*
|
|
|
20 |
* @return
|
|
|
21 |
*/
|
|
|
22 |
|
|
|
23 |
function mkengine()
|
|
|
24 |
{
|
|
|
25 |
global $GS_GLOBAL;
|
|
|
26 |
global $label_bbota;
|
|
|
27 |
global $nbr_total;
|
|
|
28 |
global $bouton, $HTTP_POST_VARS ;
|
|
|
29 |
$mon_frag = new fragmenteur_session() ;
|
|
|
30 |
|
|
|
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])) {
|
|
|
37 |
$$value = $mon_frag->getVariable($value);
|
|
|
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 |
}
|
|
|
48 |
// Comptage du nombre total de données dans la table (hors CACHER = 1)
|
|
|
49 |
$query = "select count(*) as CPT from ".AM_ANNUAIRE;
|
|
|
50 |
$result = mysql_query($query) or die("<B>Erreur !</B> $query a échoué...");
|
|
|
51 |
|
|
|
52 |
if (mysql_num_rows($result) == 1)
|
|
|
53 |
{
|
|
|
54 |
$tmp_nb = mysql_fetch_object($result);
|
|
|
55 |
$nbr_total = $tmp_nb->CPT;
|
|
|
56 |
if ($nbr_total > 0) $chaine = "parmi $nbr_total données";
|
|
|
57 |
else die("<B>Erreur</B> lors du comptage des structures ($nbr_total trouvées) : $query");
|
|
|
58 |
}
|
|
|
59 |
else die("<B>Erreur</B> lors du comptage des structures : $query");
|
|
|
60 |
|
|
|
61 |
mysql_free_result($result);
|
|
|
62 |
// fin comptage
|
|
|
63 |
|
|
|
64 |
$ret = "";
|
|
|
65 |
|
|
|
66 |
// construction du moteur de str
|
|
|
67 |
|
|
|
68 |
$ret .= "<form action=\"".AM_URL_DOCUMENT."\" method=\"post\">\n";
|
|
|
69 |
$ret .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" summary=\"\">\n";
|
|
|
70 |
$ret .= "<tr class=\"titlePage\"><td colspan=\"2\">".AM_L_TITRE."</td></tr>\n" ;
|
|
|
71 |
$ret .= presa_mk_blkline(1);
|
|
|
72 |
$ret .= "<tr class=\"insTitle1\"><td colspan=\"2\">".AM_L_TITRE." $chaine :</td></tr>\n" ;
|
|
|
73 |
$ret .= presa_mk_blkline(1);
|
|
|
74 |
|
|
|
75 |
// ligne de recherche
|
|
|
76 |
$ret .= "<tr><td colspan=\"2\">\n";
|
|
|
77 |
$ret .= "<table border=\"0\"><tr>\n" ;
|
|
|
78 |
$ret .= "<td class=\"insLabel\">".AM_L_RECHERCHER." :\n</td>\n<td>";
|
|
|
79 |
$ret .= form_mk_chaineI(stripslashes($recherche), "recherche")." ";
|
|
|
80 |
$ret .= "</td><td class=\"insLabel\" colspan=\"4\">".AM_L_PAYS." : \n" ;
|
|
|
81 |
$ret .= "" ;
|
|
|
82 |
|
|
|
83 |
// formulaire contenant les pays, avec par défaut soit le pays en cours
|
|
|
84 |
// soit "tous les pays"
|
|
|
85 |
|
|
|
86 |
$query_pays = "select GC_ID, GC_NAME from gen_COUNTRY where GC_LOCALE='fr'" ;
|
|
|
87 |
$result_pays = mysql_query($query_pays) or die ("Echec de la requete sur gen_COUNTRY") ;
|
|
|
88 |
$ret .= "<select name=\"pays\" class=\"insInputForm\">\n" ;
|
|
|
89 |
$ret .= "<option value=\"tous\">Tous les pays</option>\n" ;
|
|
|
90 |
while ($row_pays = mysql_fetch_object($result_pays)) {
|
|
|
91 |
$ret .= "<option value=\"$row_pays->GC_ID\"" ;
|
|
|
92 |
if (!empty($pays)) {
|
|
|
93 |
if ($pays == $row_pays->GC_ID) $ret .= " selected" ;
|
|
|
94 |
}
|
|
|
95 |
$ret .= ">$row_pays->GC_NAME</option>\n" ;
|
|
|
96 |
}
|
|
|
97 |
$ret .= "</select>\n" ;
|
|
|
98 |
$ret .= "</td>\n" ;
|
|
|
99 |
|
|
|
100 |
$ret .= "<tr>\n";
|
|
|
101 |
$ret .= "<td class=\"insLabel\">".AM_L_NOM." :\n</td><td>";
|
|
|
102 |
$ret .= form_mk_chaineI(stripslashes($nom), "nom")." </td>\n<td class=\"insLabel\">" ;
|
|
|
103 |
$ret .= AM_L_PRENOM." :</td>\n<td>".form_mk_chaineI(stripslashes($prenom), "prenom")." </td>\n<td class=\"insLabel\">" ;
|
|
|
104 |
$ret .= AM_L_VILLE." :</td>\n<td>".form_mk_chaineI(stripslashes($ville), "ville")." </td>" ;
|
|
|
105 |
$ret .= "</tr><tr>\n" ;
|
|
|
106 |
$ret .= "<td class=\"insLabel\">".AM_L_DEPARTEMENT." : </td>\n<td>" ;
|
|
|
107 |
|
|
|
108 |
// Construction du <select> des départements
|
|
|
109 |
$requete_dpt = "select GFD_ID, GFD_NAME from gen_FRENCH_DPT" ;
|
|
|
110 |
$resultat_dpt = mysql_query($requete_dpt) or die ("Echec de la requete sur gen_FRENCH_DPT<br>".mysql_error()) ;
|
|
|
111 |
$ret .= "<select name=\"dept\" class=\"insInputForm\">\n" ;
|
|
|
112 |
$ret .= "<option value=\"tous\">tous</option>\n" ;
|
|
|
113 |
while ($ligne_dpt = mysql_fetch_object($resultat_dpt)) {
|
|
|
114 |
$ret .= "<option value=\"$ligne_dpt->GFD_ID\"" ;
|
|
|
115 |
if ($dept == $ligne_dpt->GFD_ID) $ret .= " selected" ;
|
|
|
116 |
$ret .= ">$ligne_dpt->GFD_ID - $ligne_dpt->GFD_NAME</option>\n" ;
|
|
|
117 |
}
|
|
|
118 |
$ret .= "</select></td>\n" ;
|
|
|
119 |
|
|
|
120 |
$ret .= "<td class=\"insLabel\">".AM_L_MAIL." : </td>\n<td>".form_mk_chaineI(stripslashes($mail), "mail")."</td>\n" ;
|
|
|
121 |
$ret .= "<td class=\"insLabel\">".AM_L_COTISANTS." : </td>\n" ;
|
|
|
122 |
$ret .= "<td>".form_mk_select(stripslashes($cotisant), "cotisant")."</td>\n";
|
|
|
123 |
$ret .= "</tr></table>\n";
|
|
|
124 |
$ret .= "</td></tr>\n";
|
|
|
125 |
|
|
|
126 |
$ret .= "<tr><td><table>\n" ;
|
|
|
127 |
|
|
|
128 |
// Les statuts des inscrits
|
|
|
129 |
$tableau_statut = array ("0" => "Désinscrit", "1" =>"Cotisant non inscrit", "3" =>"Inscrit") ;
|
|
|
130 |
$ret .= "<tr>\n";
|
|
|
131 |
$ret .= "<td class=\"insLabel\">Statut : </td>" ;
|
|
|
132 |
$ret .= "<td><select name=\"statut\" class=\"insInputForm\">\n" ;
|
|
|
133 |
foreach ($tableau_statut as $key=>$value) {
|
|
|
134 |
$ret .= "<option value=\"$key\"" ;
|
|
|
135 |
if (!empty($HTTP_POST_VARS["statut"]) && $HTTP_POST_VARS["statut"] == $key) $ret .= " selected" ;
|
|
|
136 |
if (empty($HTTP_POST_VARS["statut"]) && $key == "3") $ret .= " selected" ;
|
|
|
137 |
$ret .= ">$value</option>\n" ;
|
|
|
138 |
}
|
|
|
139 |
$ret .= "</select></td>" ;
|
|
|
140 |
$ret .= "<td class=\"insLabel\" width=\"60%\">\n";
|
|
|
141 |
$ret .= AM_L_GRP_RES." : </td>" ;
|
|
|
142 |
$grp = array(20, 50, 100) ;
|
|
|
143 |
$ret .= "<td><select name=\"T_REPONSE\" class=\"insInputForm\">\n" ;
|
|
|
144 |
for ($i = 0; $i < count($grp); $i++) {
|
|
|
145 |
$ret .= "<option value=\"".$grp[$i]."\">".$grp[$i]."</option>\n" ;
|
|
|
146 |
}
|
|
|
147 |
$ret .= "</select></td>" ;
|
|
|
148 |
$ret .= "<td class=\"texte_tb\" align=\"right\" width=\"40%\">\n";
|
|
|
149 |
$ret .= "<input type=\"submit\" class=\"texte_tb\" value=\"".AM_L_RECHERCHER."\" name =\"bouton\">\n";
|
|
|
150 |
$ret .= "</td></tr></table>\n</td></tr>\n";
|
|
|
151 |
$ret .= presa_mk_blkline(1);
|
|
|
152 |
$ret .= "</table></form>\n";
|
|
|
153 |
return $ret;
|
|
|
154 |
}
|
|
|
155 |
|
|
|
156 |
/** function form_mk_chaineI () Renvoie une balise de type <input>
|
|
|
157 |
*
|
|
|
158 |
* @param string l'attribut value de la balise
|
|
|
159 |
* @param string l'attibut name de la balise
|
|
|
160 |
* @param string la classe CSS
|
|
|
161 |
* @return string HTML
|
|
|
162 |
*/
|
|
|
163 |
function form_mk_chaineI($value="", $name, $class="insInputForm")
|
|
|
164 |
{
|
|
|
165 |
return "<input type=\"text\" size=\"15\" value=\"$value\" name=\"$name\" class=\"$class\">";
|
|
|
166 |
}
|
|
|
167 |
|
|
|
168 |
function form_mk_select($value="", $name="", $class="insInputForm") {
|
|
|
169 |
$res = "<select name=\"$name\" class=\"$class\">\n" ;
|
|
|
170 |
$res .= "<option value=\"1\"" ;
|
|
|
171 |
if ($value == 1) $res .= " selected" ;
|
|
|
172 |
$res .= ">Cotisants</option>\n" ;
|
|
|
173 |
$res .= "<option value=\"2\"" ;
|
|
|
174 |
if ($value == 2) $res .= " selected" ;
|
|
|
175 |
$res .= ">Non cotisants</option>\n" ;
|
|
|
176 |
$res .= "<option value=\"3\"" ;
|
|
|
177 |
if ($value == 3 || $value == "") $res .= " selected" ;
|
|
|
178 |
$res .= ">Tous</option>\n" ;
|
|
|
179 |
$res .= "</select>\n" ;
|
|
|
180 |
return $res ;
|
|
|
181 |
}
|
|
|
182 |
|
|
|
183 |
function mkquery()
|
|
|
184 |
{
|
|
|
185 |
// définition des variables globales
|
|
|
186 |
global $lettre ;
|
|
|
187 |
global $bouton, $HTTP_POST_VARS ;
|
|
|
188 |
|
|
|
189 |
$mon_frag = new fragmenteur_session() ;
|
|
|
190 |
|
|
|
191 |
// Requete sur l'annuaire pour extraire le nom, prénom, ville, nom du département (jointure),
|
|
|
192 |
// l'état de la cotisation (jointure)
|
|
|
193 |
|
|
|
194 |
// le tableau suivant contient tous les champs de la table annuaire_tela sur lesquels on peut effectuer une recherche
|
|
|
195 |
$fields_annu = array("nom" => "U_NAME", "prenom" => "U_SURNAME" , "mail" => "U_MAIL" , "ville" => "U_CITY",
|
|
|
196 |
"dept" => "U_FRENCH_DPT", "pays" => "U_COUNTRY" ) ;
|
|
|
197 |
|
|
|
198 |
$mes_vars = array ("recherche", "nom", "ville", "mail" ,"dept", "prenom", "cotisant", "pays", "sort", "T_REPONSE", "lettre","statut") ;
|
|
|
199 |
|
|
|
200 |
foreach ($mes_vars as $key=>$value) {
|
|
|
201 |
if (!$bouton) {
|
|
|
202 |
if (empty($HTTP_POST_VARS[$value])) {
|
|
|
203 |
$$value = $mon_frag->getVariable($value);
|
|
|
204 |
}
|
|
|
205 |
} else {
|
|
|
206 |
$lettre = "" ;
|
|
|
207 |
$mon_frag->setVariable("lettre", "") ;
|
|
|
208 |
$mon_frag->fixerLeDebut(0) ;
|
|
|
209 |
if (empty ($HTTP_POST_VARS[$value])) {
|
|
|
210 |
$$value = "" ;
|
|
|
211 |
} else {
|
|
|
212 |
$$value = $HTTP_POST_VARS[$value] ;
|
|
|
213 |
}
|
|
|
214 |
}
|
|
|
215 |
}
|
|
|
216 |
if ($bouton) $sort = $mon_frag->getVariable("sort") ;
|
|
|
217 |
|
|
|
218 |
|
|
|
219 |
$queries = "select ".AM_ANNUAIRE.".*" ;
|
|
|
220 |
$queries .= ", ".AM_PAYS.".GC_NAME ";
|
|
|
221 |
$queries .= "from ".AM_ANNUAIRE ;
|
|
|
222 |
$queries .= ",".AM_PAYS ;
|
|
|
223 |
|
|
|
224 |
// Construction en fonction des champs saisies
|
|
|
225 |
|
|
|
226 |
// juste le champs "rechercher", on regarde partout
|
|
|
227 |
$queries .= " where (" ;
|
|
|
228 |
|
|
|
229 |
if ($lettre == "") {
|
|
|
230 |
if ($recherche != "") {
|
|
|
231 |
$queries .= "(U_NAME like '%$recherche%'" ; // le premier
|
|
|
232 |
foreach($fields_annu as $key=>$value) {
|
|
|
233 |
if ($key == "nom") continue ;
|
|
|
234 |
$queries .= ($key == "pays" ?
|
|
|
235 |
$pays == "tous" ? ")" :
|
|
|
236 |
") and $value = '$pays'" : " or $value like '%$recherche%'") ; // les autres
|
|
|
237 |
}
|
|
|
238 |
|
|
|
239 |
} else {
|
|
|
240 |
|
|
|
241 |
// si un ou plusieurs autres champs ont été indiqué, on les rajoute ici
|
|
|
242 |
|
|
|
243 |
$or_flag = false ;
|
|
|
244 |
foreach($fields_annu as $key=>$valeur) {
|
|
|
245 |
if ($key != "") {
|
|
|
246 |
if ($key == "pays") {
|
|
|
247 |
if ($$key == "tous") $queries .= ") and U_COUNTRY like '%'";
|
|
|
248 |
else $queries .= ") and $valeur like \"%".$$key."%\"" ;
|
|
|
249 |
} else {
|
|
|
250 |
if ($key == "dept") {
|
|
|
251 |
if ($$key != "tous" && isset($HTTP_POST_VARS[$key])) {
|
|
|
252 |
$queries .= " and U_FRENCH_DPT=".$$key ;
|
|
|
253 |
if ($fields_annu["pays"] != "fr") $queries .= " and U_COUNTRY=\"fr\"" ;
|
|
|
254 |
}
|
|
|
255 |
|
|
|
256 |
} else {
|
|
|
257 |
if ($or_flag) $queries .= "$valeur like \"%".$$key."%\"" ;
|
|
|
258 |
else $queries .= "($valeur like \"%".$$key."%\"" ;
|
|
|
259 |
if ($key != "ville") $queries .= " and " ;
|
|
|
260 |
}
|
|
|
261 |
}
|
|
|
262 |
$or_flag = true ;
|
|
|
263 |
}
|
|
|
264 |
}
|
|
|
265 |
// ici le cas ou rien n'a été saisie du tout, on affiche tout
|
|
|
266 |
if (!$or_flag) {
|
|
|
267 |
$queries .= "U_NAME like '%')" ;
|
|
|
268 |
}
|
|
|
269 |
}
|
|
|
270 |
} else {
|
|
|
271 |
if ($lettre == "tous") $lettre = "" ;
|
|
|
272 |
$queries .="U_NAME like '$lettre%'" ;
|
|
|
273 |
}
|
|
|
274 |
$queries .= ")" ;
|
|
|
275 |
$queries .= " and ".AM_ANNUAIRE.".U_COUNTRY=".AM_PAYS.".GC_ID" ;
|
|
|
276 |
if (isset($cotisant) && $cotisant != 3) if ($cotisant == 1) {
|
|
|
277 |
$queries .= " and ".AM_ANNUAIRE.".U_COT=$cotisant" ;
|
|
|
278 |
} else {
|
|
|
279 |
$queries .= " and ".AM_ANNUAIRE.".U_COT=0" ;
|
|
|
280 |
}
|
|
|
281 |
if (isset($nom) && $nom != "") $queries .= " and U_NAME like \"%$nom%\"" ;
|
|
|
282 |
if (isset($prenom) && $prenom != "") $queries .= " and U_SURNAME like \"%$prenom%\"" ;
|
|
|
283 |
if (isset($ville) && $ville != "") $queries .= " and U_CITY like \"%$ville%\"" ;
|
|
|
284 |
if (isset($mail) && $mail != "") $queries .= " and U_MAIL like \"%$mail%\"" ;
|
|
|
285 |
if (isset($statut) && $statut != "") $queries .= " and U_SHOW=$statut" ; else $queries .= " and U_SHOW=0" ;
|
|
|
286 |
if (isset($sort) && $sort != "") $queries .= " order by $sort" ;
|
|
|
287 |
return $queries;
|
|
|
288 |
}
|
|
|
289 |
|
|
|
290 |
function mkresu()
|
|
|
291 |
{
|
|
|
292 |
global $GS_GLOBAL;
|
|
|
293 |
global $HTTP_HOST, $SCRIPT_URL, $SCRIPT_NAME, $bouton ;
|
|
|
294 |
|
|
|
295 |
$mon_frag = new fragmenteur_session() ;
|
|
|
296 |
$mon_frag->setURL(AM_BASE_URL.AM_URL_DOCUMENT) ;
|
|
|
297 |
if ($bouton) $mon_frag->fixerLeDebut(0) ;
|
|
|
298 |
$requete = mkquery() ;
|
|
|
299 |
|
|
|
300 |
// Deux requetes, une avec tous les resultats, l'autre avec les résultats affichés
|
|
|
301 |
$result_total = mysql_query($requete) or print ("Echec de la requete <br>$requete<br>".mysql_error()) ;
|
|
|
302 |
|
|
|
303 |
// Affichage de la requete
|
|
|
304 |
$ret_req = "<tr class=\"texte_tb\"><td><br><b>La requete : </b><br>$requete".
|
|
|
305 |
" limit ".$mon_frag->lireLeDebut().",".$mon_frag->lireLePas()."</td></tr>\n" ;
|
|
|
306 |
|
|
|
307 |
|
|
|
308 |
$result_final = mysql_query($requete." limit ".$mon_frag->lireLeDebut().",".$mon_frag->lireLePas()) or print (mysql_error());
|
|
|
309 |
$nbr_final = mysql_num_rows($result_total) ;
|
|
|
310 |
mysql_free_result($result_total) ;
|
|
|
311 |
cxt_addVariable(AM_BD_BOTA, AM_BD_LINK, "requete_mail_tous", $requete) ;
|
|
|
312 |
$ret = "<tr class=\"text1\"><td align=\"center\"><table><tr>" ;
|
|
|
313 |
|
|
|
314 |
for ($i = 65 ; $i <91 ; $i++) {
|
|
|
315 |
$ret .= "\t<td><a href=\"".AM_URL_DOCUMENT."&lettre=";
|
|
|
316 |
$ret .= chr($i)."\">";
|
|
|
317 |
$ret .= chr($i) ;
|
|
|
318 |
$ret .= "</a></td>\n";
|
|
|
319 |
}
|
|
|
320 |
|
|
|
321 |
$ret .= "<td> <a href=\"".AM_URL_DOCUMENT."&lettre=tous\">".AM_L_TOUS."</a></td>\n" ;
|
|
|
322 |
$ret .= "<tr></table></td></tr>\n" ;
|
|
|
323 |
$ret .= "<tr class=\"insInputForm\"><td>".$mon_frag->affNbRes($nbr_final) ;
|
|
|
324 |
$ret .= "<tr class=\"insInputForm\" align=\"center\"><td align=\"center\">".$mon_frag->fragmente($nbr_final)."</td></tr>\n" ;
|
|
|
325 |
if ($nbr_final != 0) {
|
|
|
326 |
$ret .= "<tr><td><table width=\"100%\">\n";
|
|
|
327 |
$ret .= "<tr class=\"insTitle1\"><td nowrap><a href=\"".AM_BASE_URL.AM_URL_DOCUMENT."&sort=U_NAME\">Identité</a></td>\n";
|
|
|
328 |
$ret .= "<td><a href=\"".AM_BASE_URL.AM_URL_DOCUMENT."&sort=U_MAIL\">Adresse mail</a></td>\n" ;
|
|
|
329 |
$ret .= "<td><a href=\"".AM_BASE_URL.AM_URL_DOCUMENT."&sort=U_CITY\">".AM_L_VILLE."</a></td>\n" ;
|
|
|
330 |
$ret .= "<td>Pays ou Dpt (fr)</td>\n" ;
|
|
|
331 |
$ret .= "<td><a href=\"".AM_BASE_URL.AM_URL_DOCUMENT."&sort=U_COT\">".AM_L_COTISANTS."</a></td></tr>\n" ;
|
|
|
332 |
|
|
|
333 |
$cotisant = array( "non", "oui") ;
|
|
|
334 |
|
|
|
335 |
$pair = true ; // pour afficher une ligne de résultat coloré, l'autre non
|
|
|
336 |
|
|
|
337 |
while ($row = mysql_fetch_object($result_final))
|
|
|
338 |
{
|
|
|
339 |
$ret .= "<tr class=\"texte_tb2\"";
|
|
|
340 |
if ($pair) {
|
|
|
341 |
$ret .= " bgcolor=\"\"" ;
|
|
|
342 |
$pair = false ;
|
|
|
343 |
} else {
|
|
|
344 |
$pair = true ;
|
|
|
345 |
}
|
|
|
346 |
$ret .= ">" ;
|
|
|
347 |
$ret .= "\n<td nowrap>";
|
|
|
348 |
$urlPop = "http://$HTTP_HOST$SCRIPT_NAME" ;
|
|
|
349 |
$urlPop .= "?project=".$GS_GLOBAL['project']."&locale=".$GS_GLOBAL['locale']."&set=popup&doc=admin_annu&page=".
|
|
|
350 |
$GS_GLOBAL['current_page_ndx']."&u_id=$row->U_ID" ;
|
|
|
351 |
$ret .= "<a href=\"javascript:MagicPopup('$urlPop', 'admin_annu');\">" ;
|
|
|
352 |
$ret .= $row->U_NAME." ".$row->U_SURNAME ;
|
|
|
353 |
$ret .= "</a></td>\n ";
|
|
|
354 |
$ret .= "<td><a href=\"mailto:$row->U_MAIL\">$row->U_MAIL</a></td>\n" ;
|
|
|
355 |
$ret .= "<td>$row->U_CITY</td>" ;
|
|
|
356 |
if ($row->U_COUNTRY != 'fr') {
|
|
|
357 |
$ret .= "<td>$row->GC_NAME</td>" ;
|
|
|
358 |
} else {
|
|
|
359 |
$req_dpt = "select GFD_NAME from ".AM_DPT.",".AM_ANNUAIRE." where ".AM_ANNUAIRE.".U_ID=$row->U_ID" ;
|
|
|
360 |
$req_dpt .= " and ".AM_ANNUAIRE.".U_FRENCH_DPT=".AM_DPT.".GFD_ID" ;
|
|
|
361 |
$resultat_dpt = mysql_query($req_dpt) or die ("Echec de la requete sur ".AM_DPT."<br>".mysql_error()) ;
|
|
|
362 |
$ligne_dpt = mysql_fetch_object($resultat_dpt) ;
|
|
|
363 |
$ret .= "<td>$ligne_dpt->GFD_NAME</td>" ;
|
|
|
364 |
}
|
|
|
365 |
$ret .= "<td>".$cotisant[$row->U_COT]."</td></tr>\n" ;
|
|
|
366 |
}
|
|
|
367 |
|
|
|
368 |
$ret .= "</table></td></tr>\n" ;
|
|
|
369 |
$ret .= "<tr class=\"insInputForm\" align=\"center\"><td align=\"center\">".$mon_frag->fragmente($nbr_final)."</td></tr>\n" ;
|
|
|
370 |
$ret .= presa_mk_blkline(1) ;
|
|
|
371 |
$ret .= "<tr class=\"texte_tb\"><td><a href=\"document.php?project=gus&doc=mail_tous\" target=\"_blank\">".AM_L_MAIL_SELECTION."</a></td></tr>\n" ;
|
|
|
372 |
}
|
|
|
373 |
// $ret .= $ret_req ;
|
|
|
374 |
return $ret;
|
|
|
375 |
}
|
|
|
376 |
|
|
|
377 |
/** function presa_mk_blkline () insere des lignes vides du type <tr><td> </td></tr>
|
|
|
378 |
*
|
|
|
379 |
*
|
|
|
380 |
* @param integer nombre de ligne à insérer
|
|
|
381 |
* @return string HTML
|
|
|
382 |
*/
|
|
|
383 |
|
|
|
384 |
function presa_mk_blkline ($nombre) {
|
|
|
385 |
$res = "" ;
|
|
|
386 |
for ($i = 0; $i < $nombre; $i++) {
|
|
|
387 |
$res .= "<tr><td> </td></tr>\n" ;
|
|
|
388 |
}
|
|
|
389 |
return $res ;
|
|
|
390 |
}
|
|
|
391 |
|
|
|
392 |
?>
|