Subversion Repositories Sites.tela-botanica.org

Rev

Rev 364 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 364 Rev 463
1
<?
1
<?
2
// +--------------------------------------------------------------------------------+
2
// +--------------------------------------------------------------------------------+
3
// | liste_inscrit.php                                                              |
3
// | liste_inscrit.php                                                              |
4
// +--------------------------------------------------------------------------------+
4
// +--------------------------------------------------------------------------------+
5
// | Copyright (c) 2002                                                             |
5
// | Copyright (c) 2002                                                             |
6
// +--------------------------------------------------------------------------------+
6
// +--------------------------------------------------------------------------------+
7
// |                                                                                |
7
// |                                                                                |
8
// +--------------------------------------------------------------------------------+
8
// +--------------------------------------------------------------------------------+
9
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org>                       |
9
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org>                       |
10
// +--------------------------------------------------------------------------------+
10
// +--------------------------------------------------------------------------------+
11
//
11
//
12
// $Id: liste_inscrit.php,v 1.6 2005/03/14 10:10:02 alex Exp $
12
// $Id: liste_inscrit.php,v 1.6 2005/03/14 10:10:02 alex Exp $
13
 
13
 
14
global $HTTP_USER_AGENT;
14
global $HTTP_USER_AGENT;
15
 
15
 
16
 
16
 
17
$javascript = "function confirmer () 
17
$javascript = "function confirmer () 
18
    {
18
    {
19
        if (window.confirm ('Cliquez sur OK pour confirmer.')) {
19
        if (window.confirm ('Cliquez sur OK pour confirmer.')) {
20
            window.formmail.submit();
20
            window.formmail.submit();
21
        }
21
        }
22
    }
22
    }
23
function setCheckboxes(the_form) 
23
function setCheckboxes(the_form) 
24
{
24
{
25
    var do_check=document.forms[the_form].elements['selecttotal'].checked;
25
    var do_check=document.forms[the_form].elements['selecttotal'].checked;
26
    var elts            = document.forms[the_form].elements['select[]'];
26
    var elts            = document.forms[the_form].elements['select[]'];
27
    var elts_cnt = (typeof(elts.length) != 'undefined')
27
    var elts_cnt = (typeof(elts.length) != 'undefined')
28
                        ? elts.length
28
                        ? elts.length
29
                        : 0;
29
                        : 0;
30
    if (elts_cnt) {
30
    if (elts_cnt) {
31
        for (var i = 0; i < elts_cnt; i++) {
31
        for (var i = 0; i < elts_cnt; i++) {
32
            elts[i].checked = do_check;
32
            elts[i].checked = do_check;
33
        } // Fin for
33
        } // Fin for
34
    } 
34
    } 
35
    else {
35
    else {
36
        elts.checked = do_check;
36
        elts.checked = do_check;
37
    } // Fin if... else
37
    } // Fin if... else
38
    return true;
38
    return true;
39
} // Fin de la fonction 'setCheckboxes()'";
39
} // Fin de la fonction 'setCheckboxes()'";
40
 
40
 
41
GEN_stockerCodeScript($javascript);
41
GEN_stockerCodeScript($javascript);
42
 
42
 
43
$url = CAR_URL ;
43
$url = CAR_URL ;
44
 
44
 
45
$corps = (isset($_POST['corps'])) ? $_POST['corps'] : '' ;
45
$corps = (isset($_POST['corps'])) ? $_POST['corps'] : '' ;
46
$titre_mail = (isset($_POST['titre_mail'])) ? $_POST['titre_mail'] : '';
46
$titre_mail = (isset($_POST['titre_mail'])) ? $_POST['titre_mail'] : '';
47
 
47
 
48
$tabmonde = explode ('*',$monde->historique);
48
$tabmonde = explode ('*',$monde->historique);
49
 
49
 
50
// Premier cas, on vient de cliquer sur un pays qui n'est pas 
50
// Premier cas, on vient de cliquer sur un pays qui n'est pas 
51
// la France, on affiche les adhérents de ce pays
51
// la France, on affiche les adhérents de ce pays
52
 
52
 
53
if (count($tabmonde) == 3) {
53
if (count($tabmonde) == 3) {
54
    $argument = $tabmonde[2];
54
    $argument = $tabmonde[2];
55
    
55
    
56
    $requete = "select * from carto_PAYS where CP_ID_pays='$argument'";
56
    $requete = "select * from carto_PAYS where CP_ID_pays='$argument'";
57
    $resultat = $GLOBALS['car_db']->query($requete);
57
    $resultat = $GLOBALS['car_db']->query($requete);
58
    if (DB::isError($resultat)) {
58
    if (DB::isError($resultat)) {
59
    	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
59
    	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
60
    }
60
    }
61
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
61
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
62
    
62
    
63
    $pays = $ligne->CP_Intitule_pays;
63
    $pays = $ligne->CP_Intitule_pays;
64
    $monde->nom = $monde->nom.'*'.$pays;
64
    $monde->nom = $monde->nom.'*'.$pays;
65
    
65
    
66
    $tabonglet = explode ('*', $monde->historique);
66
    $tabonglet = explode ('*', $monde->historique);
67
    $tabnom = explode ('*', $monde->nom);
67
    $tabnom = explode ('*', $monde->nom);
68
    foreach ($tabonglet as $key => $value) {
68
    foreach ($tabonglet as $key => $value) {
69
        $res .= '<a class="chemin_carto"' ;
69
        $res .= '<a class="chemin_carto"' ;
70
        if ($key == 0) {
70
        if ($key == 0) {
71
            $chemin = $value;
71
            $chemin = $value;
72
            $value = 'monde';
72
            $value = 'monde';
73
            $res .= " href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key] ;
73
            $res .= " href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key] ;
74
        }
74
        }
75
        else if ($key == (count($tabonglet)-1)) {
75
        else if ($key == (count($tabonglet)-1)) {
76
            $res .= ">&nbsp;&gt;&nbsp;$pays";
76
            $res .= ">&nbsp;&gt;&nbsp;$pays";
77
        }
77
        }
78
        else {
78
        else {
79
            $chemin .= '*'.$value;
79
            $chemin .= '*'.$value;
80
            $res .= " href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key] ;
80
            $res .= " href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key] ;
81
        }
81
        }
82
        $res .= '</a>' ;
82
        $res .= '</a>' ;
83
    }
83
    }
84
 
84
 
85
    $capitale = $ligne->CP_Intitule_capitale;
85
    $capitale = $ligne->CP_Intitule_capitale;
86
    
86
    
87
    $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr".
87
    $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr".
88
            " from ".CAR_ANNUAIRE.
88
            " from ".CAR_ANNUAIRE.
89
            " where ".CAR_CHAMPS_CE_PAYS."='$argument'";
89
            " where ".CAR_CHAMPS_CE_PAYS."='$argument'";
90
    
90
    
91
    $resultat_2 = $GLOBALS['car_db']->query($requete_2);
91
    $resultat_2 = $GLOBALS['car_db']->query($requete_2);
92
    if (DB::isError($resultat_2)) {
92
    if (DB::isError($resultat_2)) {
93
    	die ($resultat_2->getMessage().'<br />'.$resultat_2->getDebugInfo()) ;
93
    	die ($resultat_2->getMessage().'<br />'.$resultat_2->getDebugInfo()) ;
94
    }
94
    }
95
    $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT) ;
95
    $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT) ;
96
    $res .= '<h1 class="titre1_cartographie">'.$pays.' ('.$capitale.') : ' ;
96
    $res .= '<h1 class="titre1_cartographie">'.$pays.' ('.$capitale.') : ' ;
97
    if ($ligne_2->nbr == 0) {
97
    if ($ligne_2->nbr == 0) {
98
        $res .= 'aucun inscrit '.CAR_LABEL_PROJET."</h1>\n";
98
        $res .= 'aucun inscrit '.CAR_LABEL_PROJET."</h1>\n";
99
        if (!$GLOBALS['car_auth']->getAuth()) {
99
        if (!$GLOBALS['car_auth']->getAuth()) {
100
            $res .= AUTH_formulaire_login();
100
            $res .= AUTH_formulaire_login();
101
        } else {
101
        } else {
102
            $res .= '<div class="message_pas_dinscrit">'.CAR_PAS_D_INSCRIT.'</div>'."\n" ;
102
            $res .= '<div class="message_pas_dinscrit">'.CAR_PAS_D_INSCRIT.'</div>'."\n" ;
103
        }
103
        }
104
        return $res ;
104
        return $res ;
105
    } else if ($ligne_2->nbr == 1) {
105
    } else if ($ligne_2->nbr == 1) {
106
        $res .= $ligne_2->nbr." inscrit " ;
106
        $res .= $ligne_2->nbr." inscrit " ;
107
    } else {
107
    } else {
108
        $res .= $ligne_2->nbr." inscrits " ;
108
        $res .= $ligne_2->nbr." inscrits " ;
109
    }
109
    }
110
    $res .= CAR_LABEL_PROJET."</h1>\n";
110
    $res .= CAR_LABEL_PROJET."</h1>\n";
111
    
111
    
112
    if (!$GLOBALS['car_auth']->getAuth()) {
112
    if (!$GLOBALS['car_auth']->getAuth()) {
113
        $res .= AUTH_formulaire_login();
113
        $res .= AUTH_formulaire_login();
114
    } else {
114
    } else {
115
    $res .= "<form action=\"$url?mailer=1&amp;fin=true\" method=\"post\" name=\"formmail\">
115
    $res .= '<form action="'.$url.'?mailer=1&amp;fin=true" method="post" name="formmail">'.
-
 
116
            '	<div id="div_inscrit">'.
116
                <div id=\"div_inscrit\"><table id=\"table_inscrits\">
117
            '		<table id="table_inscrits">'.
117
                    <colgroup>
118
            '			<colgroup>'.
118
                        <col />
119
			'				<col />'.
119
                        <col />
120
			'				<col />'.
120
                        <col />
121
			'				<col />'.
121
                        <col />
122
			'				<col />'.
122
                        <col />
123
			'				<col />'.
123
                        <col />
124
			'				<col />'.
124
                    </colgroup>
125
			'			</colgroup>'.
-
 
126
			'			<thead>'.
125
                        <tr>
127
			'				<tr>'.
126
                            <th>&nbsp;</th>
128
			'					<th>&nbsp;</th>'.
127
                            <th>".CAR_NOM."</th>
129
			'					<th>'.CAR_NOM.'</th>'.
128
                            <th>".CAR_PRENOM."</th>
130
			'					<th>'.CAR_PRENOM.'</th>'.
129
                            <th>".CAR_DATE_INS."</th>
131
			'					<th>'.CAR_DATE_INS.'</th>'.
130
                            <th>".CAR_REGION."</th>
132
			'					<th>'.CAR_REGION.'</th>'.
131
                            <th>".CAR_VILLE."</th>
133
			'					<th>'.CAR_VILLE.'</th>'.
132
                        </tr>\n";
134
			'				</tr>'.
-
 
135
			'			</thead>'.
-
 
136
			'			<tbody>';
133
        
137
        
134
        $requete = "select * from ".CAR_ANNUAIRE.
138
        $requete = "select * from ".CAR_ANNUAIRE.
135
                " where ".CAR_CHAMPS_CE_PAYS."='$argument'".
139
                " where ".CAR_CHAMPS_CE_PAYS."='$argument'".
136
                " order by ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
140
                " order by ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
137
        $resultat= $GLOBALS['car_db']->query($requete);
141
        $resultat= $GLOBALS['car_db']->query($requete);
138
        if (DB::isError($resultat)) {
142
        if (DB::isError($resultat)) {
139
        	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
143
        	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
140
        }
144
        }
141
        $indic=0;
145
        $indic=0;
142
        $i=1;
146
        $i=1;
143
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
147
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
144
            if ($indic==0) {
148
            if ($indic==0) {
145
                $res.="<tr class=\"ligne_impaire\">\n";
149
                $res.="<tr class=\"ligne_impaire\">\n";
146
                $indic=1;
150
                $indic=1;
147
            }
151
            }
148
            else {
152
            else {
149
                $res.="<tr class=\"ligne_paire\">\n";
153
                $res.="<tr class=\"ligne_paire\">\n";
150
                $indic=0;
154
                $indic=0;
151
            }
155
            }
152
            $res.="<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[CAR_CHAMPS_MAIL]."\" /></td>
156
            $res.="<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[CAR_CHAMPS_MAIL]."\" /></td>
153
                            <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>\n
157
                            <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>\n
154
                        	<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM]))))."&nbsp;</td>\n
158
                        	<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM]))))."&nbsp;</td>\n
155
                            <td>".date("d m Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))."&nbsp;</td>
159
                            <td>".date("d m Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))."&nbsp;</td>
156
                            <td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_REGION]))))."&nbsp;</td>
160
                            <td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_REGION]))))."&nbsp;</td>
157
                            <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>\n";
161
                            <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>\n";
158
            $res .= "</tr>\n";
162
            $res .= "</tr>\n";
159
        }
163
        }
160
        $res .= "</table></div>\n";
164
        $res .= "</tbody></table></div>\n";
161
        
165
        
162
        if ($mailer==1) {
166
        if ($mailer==1) {
163
            if (!is_array($select)) {
167
            if (!is_array($select)) {
164
                $res .= "<div>".CAR_NO_DESTINATAIRE."</div>";
168
                $res .= "<div>".CAR_NO_DESTINATAIRE."</div>";
165
            } else {
169
            } else {
166
                $res .= envoie_mail($GLOBALS['car_db']) ;
170
                $res .= envoie_mail($GLOBALS['car_db']) ;
167
            }
171
            }
168
        } else {
172
        } else {
169
            $res .= carto_texte_cocher() ;
173
            $res .= carto_texte_cocher() ;
170
        }
174
        }
171
        
175
        
172
        $res .= carto_formulaire($titre_mail, $corps) ;
176
        $res .= carto_formulaire($titre_mail, $corps) ;
173
    }
177
    }
174
 
178
 
175
// 2 ème cas, on vient de cliquer sur un département français
179
// 2 ème cas, on vient de cliquer sur un département français
176
 
180
 
177
} else if (count($tabmonde) == 4) {
181
} else if (count($tabmonde) == 4) {
178
    $argument = $tabmonde[3];
182
    $argument = $tabmonde[3];
179
    
183
    
180
    $requete = "select * from gen_FRENCH_DPT where GFD_ID='$argument'";
184
    $requete = "select * from gen_FRENCH_DPT where GFD_ID='$argument'";
181
    $resultat = $GLOBALS['car_db']->query($requete);
185
    $resultat = $GLOBALS['car_db']->query($requete);
182
    if (DB::isError($resultat)) {
186
    if (DB::isError($resultat)) {
183
        die ($resultat->getMessage() .'<br />'.$resultat->getDebugInfo());
187
        die ($resultat->getMessage() .'<br />'.$resultat->getDebugInfo());
184
    }
188
    }
185
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
189
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
186
    $nom = $ligne->GFD_NAME;
190
    $nom = $ligne->GFD_NAME;
187
    
191
    
188
    $tabonglet=explode ('*', $monde->historique);
192
    $tabonglet=explode ('*', $monde->historique);
189
    $tabnom=explode ('*', $monde->nom);
193
    $tabnom=explode ('*', $monde->nom);
190
    $res.="<div>\n";
194
    $res.="<div>\n";
191
    foreach ($tabonglet as $key=>$value) {
195
    foreach ($tabonglet as $key=>$value) {
192
        if ($key==0) {
196
        if ($key==0) {
193
            $chemin=$value;
197
            $chemin=$value;
194
            $value='monde';
198
            $value='monde';
195
            $res.= "<a class=\"chemin_carto\" href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key]."</a>";
199
            $res.= "<a class=\"chemin_carto\" href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key]."</a>";
196
        }
200
        }
197
        else if ($key==(count($tabonglet)-1)) {
201
        else if ($key==(count($tabonglet)-1)) {
198
            $res.="<a class=\"chemin_carto\">&nbsp;&gt;&nbsp;$nom</a>";
202
            $res.="<a class=\"chemin_carto\">&nbsp;&gt;&nbsp;$nom</a>";
199
        }
203
        }
200
        else {
204
        else {
201
            $chemin.='*'.$value;
205
            $chemin.='*'.$value;
202
            $res.= "<a class=\"chemin_carto\" href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key]."</a>";
206
            $res.= "<a class=\"chemin_carto\" href=\"".$monde->url."&amp;historique_cartes=$chemin\">&nbsp;&gt;&nbsp;".$tabnom[$key]."</a>";
203
        }
207
        }
204
    }
208
    }
205
    $res .= "</div>\n";
209
    $res .= "</div>\n";
206
    
210
    
207
    $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr".
211
    $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr".
208
            " FROM ".CAR_ANNUAIRE.
212
            " FROM ".CAR_ANNUAIRE.
209
            " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
213
            " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
210
            " AND ".CAR_CHAMPS_CE_PAYS."='fr'";
214
            " AND ".CAR_CHAMPS_CE_PAYS."='fr'";
211
    
215
    
212
    $resultat_2 = $GLOBALS['car_db']->query($requete_2);
216
    $resultat_2 = $GLOBALS['car_db']->query($requete_2);
213
    if (DB::isError($resultat_2)) {
217
    if (DB::isError($resultat_2)) {
214
    	die ($resultat_2->getMessage().'<br />'.$resultat_2->getDebugInfo()) ;
218
    	die ($resultat_2->getMessage().'<br />'.$resultat_2->getDebugInfo()) ;
215
    }
219
    }
216
    
220
    
217
    $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT);
221
    $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT);
218
 
222
 
219
    $res .= '<h1 class="titre1_cartographie">'.$nom.' : ' ;
223
    $res .= '<h1 class="titre1_cartographie">'.$nom.' : ' ;
220
    if ($ligne_2->nbr == 0) {
224
    if ($ligne_2->nbr == 0) {
221
        $res .= 'aucun inscrit '.CAR_LABEL_PROJET."</h1>\n";
225
        $res .= 'aucun inscrit '.CAR_LABEL_PROJET."</h1>\n";
222
        if (!$GLOBALS['car_auth']->getAuth()) {
226
        if (!$GLOBALS['car_auth']->getAuth()) {
223
            $res .= AUTH_formulaire_login();
227
            $res .= AUTH_formulaire_login();
224
        } else {
228
        } else {
225
            $res .= '<div class="message_pas_dinscrit">'.CAR_PAS_D_INSCRIT.'</div>'."\n" ;
229
            $res .= '<div class="message_pas_dinscrit">'.CAR_PAS_D_INSCRIT.'</div>'."\n" ;
226
        }
230
        }
227
        return $res ;
231
        return $res ;
228
    } else if ($ligne_2->nbr == 1) {
232
    } else if ($ligne_2->nbr == 1) {
229
        $res .= $ligne_2->nbr." inscrit " ;
233
        $res .= $ligne_2->nbr." inscrit " ;
230
    } else {
234
    } else {
231
        $res .= $ligne_2->nbr." inscrits " ;
235
        $res .= $ligne_2->nbr." inscrits " ;
232
    }
236
    }
233
    $res .= CAR_LABEL_PROJET."</h1>\n";
237
    $res .= CAR_LABEL_PROJET."</h1>\n";
234
    
238
    
235
    if (!$GLOBALS['car_auth']->getAuth()) {
239
    if (!$GLOBALS['car_auth']->getAuth()) {
236
        $res .= AUTH_formulaire_login();
240
        $res .= AUTH_formulaire_login();
237
    } else {
241
    } else {
238
        $res.= "<form action=\"$url?argument=$argument&amp;fin=true&amp;mailer=1\" 
242
        $res.= "<form action=\"$url?argument=$argument&amp;fin=true&amp;mailer=1\" 
239
                method=\"post\" name=\"formmail\">
243
                method=\"post\" name=\"formmail\">
240
                    <div id=\"div_inscrit\"><table id=\"table_inscrits\">
244
                    <div id=\"div_inscrit\"><table id=\"table_inscrits\">
241
                        <colgroup>
245
                        <colgroup>
242
                            <col />
246
                            <col />
243
                            <col />
247
                            <col />
244
                            <col />
248
                            <col />
245
                            <col />
249
                            <col />
246
                            <col />
250
                            <col />
247
                            <col />
251
                            <col />
248
                        </colgroup>
252
                        </colgroup>
-
 
253
                        <thead>
249
                        <tr>
254
                        <tr>
250
                            <th>&nbsp;</th>
255
                            <th>&nbsp;</th>
251
                            <th>".CAR_NOM."</th>
256
                            <th>".CAR_NOM."</th>
252
                            <th>".CAR_PRENOM."</th>
257
                            <th>".CAR_PRENOM."</th>
253
                            <th>".CAR_DATE_INS."</th>
258
                            <th>".CAR_DATE_INS."</th>
254
                            <th>".CAR_CP."</th>
259
                            <th>".CAR_CP."</th>
255
                            <th>".CAR_VILLE."</th>
260
                            <th>".CAR_VILLE."</th>
256
                        </tr>\n";
261
                        </tr></thead><tbody>\n";
257
        
262
        
258
        $requete = "SELECT * FROM ".CAR_ANNUAIRE.
263
        $requete = "SELECT * FROM ".CAR_ANNUAIRE.
259
                " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
264
                " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
260
                " AND ".CAR_CHAMPS_CE_PAYS."='fr'".
265
                " AND ".CAR_CHAMPS_CE_PAYS."='fr'".
261
                " ORDER BY ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
266
                " ORDER BY ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
262
        $resultat = $GLOBALS['car_db']->query($requete);
267
        $resultat = $GLOBALS['car_db']->query($requete);
263
        if (DB::isError($resultat)) {
268
        if (DB::isError($resultat)) {
264
            die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
269
            die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
265
        }
270
        }
266
        
271
        
267
        $indic=0;
272
        $indic=0;
268
        $i=1;
273
        $i=1;
269
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
274
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
270
            if ($indic==0) {
275
            if ($indic==0) {
271
                $res.="<tr class=\"ligne_impaire\">\n";
276
                $res.="<tr class=\"ligne_impaire\">\n";
272
                $indic=1;
277
                $indic=1;
273
            } else {
278
            } else {
274
                $res.="<tr class=\"ligne_paire\">\n";
279
                $res.="<tr class=\"ligne_paire\">\n";
275
                $indic=0;
280
                $indic=0;
276
            }
281
            }
277
            $res.="<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[CAR_CHAMPS_MAIL]."\" /></td>
282
            $res.="<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[CAR_CHAMPS_MAIL]."\" /></td>
278
                                    <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>
283
                                    <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>
279
                                    <td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM]))))."&nbsp;</td>
284
                                    <td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[CAR_CHAMPS_PRENOM]))))."&nbsp;</td>
280
                                    <td>".date("d m Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))."</td>
285
                                    <td>".date("d m Y", strtotime($ligne[CAR_CHAMPS_DATE_INS]))."</td>
281
                                    <td>".$ligne[CAR_CHAMPS_CODE_POSTAL]."&nbsp;</td>
286
                                    <td>".$ligne[CAR_CHAMPS_CODE_POSTAL]."&nbsp;</td>
282
                                    <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>
287
                                    <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>
283
                                    </tr>\n";
288
                                    </tr>\n";
284
        }
289
        }
285
        $res.="</table></div>\n";
290
        $res.="</tbody></table></div>\n";
286
        if ($mailer==1) {
291
        if ($mailer==1) {
287
            if (!is_array($select)) {
292
            if (!is_array($select)) {
288
                $res.= CAR_NO_DESTINATAIRE;
293
                $res.= CAR_NO_DESTINATAIRE;
289
            } else {
294
            } else {
290
                $res .= envoie_mail($GLOBALS['car_db']) ;
295
                $res .= envoie_mail($GLOBALS['car_db']) ;
291
            }
296
            }
292
        } else {
297
        } else {
293
            $res .=carto_texte_cocher() ;
298
            $res .=carto_texte_cocher() ;
294
        }
299
        }
295
        $res .= carto_formulaire($titre_mail, $corps) ;
300
        $res .= carto_formulaire($titre_mail, $corps) ;
296
    }
301
    }
297
}
302
}
298
?>
303
?>