Subversion Repositories Sites.tela-botanica.org

Rev

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

Rev 463 Rev 540
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">'.
117
            '		<table id="table_inscrits">'.
117
            '		<table id="table_inscrits">'.
118
            '			<colgroup>'.
118
            '			<colgroup>'.
119
			'				<col />'.
119
			'				<col />'.
120
			'				<col />'.
120
			'				<col />'.
121
			'				<col />'.
121
			'				<col />'.
122
			'				<col />'.
122
			'				<col />'.
123
			'				<col />'.
123
			'				<col />'.
124
			'				<col />'.
124
			'				<col />'.
125
			'			</colgroup>'.
125
			'			</colgroup>'.
126
			'			<thead>'.
126
			'			<thead>'.
127
			'				<tr>'.
127
			'				<tr>'.
128
			'					<th>&nbsp;</th>'.
128
			'					<th>&nbsp;</th>'.
129
			'					<th>'.CAR_NOM.'</th>'.
129
			'					<th>'.CAR_NOM.'</th>'.
130
			'					<th>'.CAR_PRENOM.'</th>'.
130
			'					<th>'.CAR_PRENOM.'</th>'.
131
			'					<th>'.CAR_DATE_INS.'</th>'.
131
			'					<th>'.CAR_DATE_INS.'</th>'.
132
			'					<th>'.CAR_REGION.'</th>'.
132
			'					<th>'.CAR_REGION.'</th>'.
133
			'					<th>'.CAR_VILLE.'</th>'.
133
			'					<th>'.CAR_VILLE.'</th>'.
134
			'				</tr>'.
134
			'				</tr>'.
135
			'			</thead>'.
135
			'			</thead>'.
136
			'			<tbody>';
136
			'			<tbody>';
137
        
137
        
138
        $requete = "select * from ".CAR_ANNUAIRE.
138
        $requete = "select * from ".CAR_ANNUAIRE.
139
                " where ".CAR_CHAMPS_CE_PAYS."='$argument'".
139
                " where ".CAR_CHAMPS_CE_PAYS."='$argument'".
140
                " order by ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
140
                " order by ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
141
        $resultat= $GLOBALS['car_db']->query($requete);
141
        $resultat= $GLOBALS['car_db']->query($requete);
142
        if (DB::isError($resultat)) {
142
        if (DB::isError($resultat)) {
143
        	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
143
        	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
144
        }
144
        }
145
        $indic=0;
145
        $indic=0;
146
        $i=1;
146
        $i=1;
147
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
147
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
148
            if ($indic==0) {
148
            if ($indic==0) {
149
                $res.="<tr class=\"ligne_impaire\">\n";
149
                $res.="<tr class=\"ligne_impaire\">\n";
150
                $indic=1;
150
                $indic=1;
151
            }
151
            }
152
            else {
152
            else {
153
                $res.="<tr class=\"ligne_paire\">\n";
153
                $res.="<tr class=\"ligne_paire\">\n";
154
                $indic=0;
154
                $indic=0;
155
            }
155
            }
156
            $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>
157
                            <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>\n
157
                            <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>\n
158
                        	<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
159
                            <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>
160
                            <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>
161
                            <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>\n";
161
                            <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>\n";
162
            $res .= "</tr>\n";
162
            $res .= "</tr>\n";
163
        }
163
        }
164
        $res .= "</tbody></table></div>\n";
164
        $res .= "</tbody></table></div>\n";
165
        
165
        
166
        if ($mailer==1) {
166
        if ($mailer==1) {
167
            if (!is_array($select)) {
167
            if (!is_array($select)) {
168
                $res .= "<div>".CAR_NO_DESTINATAIRE."</div>";
168
                $res .= "<div>".CAR_NO_DESTINATAIRE."</div>";
169
            } else {
169
            } else {
170
                $res .= envoie_mail($GLOBALS['car_db']) ;
170
                $res .= envoie_mail_modere($GLOBALS['car_db']) ;
171
            }
171
            }
172
        } else {
172
        } else {
173
            $res .= carto_texte_cocher() ;
173
            $res .= carto_texte_cocher() ;
174
        }
174
        }
175
        
175
        
176
        $res .= carto_formulaire($titre_mail, $corps) ;
176
        $res .= carto_formulaire($titre_mail, $corps) ;
177
    }
177
    }
178
 
178
 
179
// 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
180
 
180
 
181
} else if (count($tabmonde) == 4) {
181
} else if (count($tabmonde) == 4) {
182
    $argument = $tabmonde[3];
182
    $argument = $tabmonde[3];
183
    
183
    
184
    $requete = "select * from gen_FRENCH_DPT where GFD_ID='$argument'";
184
    $requete = "select * from gen_FRENCH_DPT where GFD_ID='$argument'";
185
    $resultat = $GLOBALS['car_db']->query($requete);
185
    $resultat = $GLOBALS['car_db']->query($requete);
186
    if (DB::isError($resultat)) {
186
    if (DB::isError($resultat)) {
187
        die ($resultat->getMessage() .'<br />'.$resultat->getDebugInfo());
187
        die ($resultat->getMessage() .'<br />'.$resultat->getDebugInfo());
188
    }
188
    }
189
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
189
    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
190
    $nom = $ligne->GFD_NAME;
190
    $nom = $ligne->GFD_NAME;
191
    
191
    
192
    $tabonglet=explode ('*', $monde->historique);
192
    $tabonglet=explode ('*', $monde->historique);
193
    $tabnom=explode ('*', $monde->nom);
193
    $tabnom=explode ('*', $monde->nom);
194
    $res.="<div>\n";
194
    $res.="<div>\n";
195
    foreach ($tabonglet as $key=>$value) {
195
    foreach ($tabonglet as $key=>$value) {
196
        if ($key==0) {
196
        if ($key==0) {
197
            $chemin=$value;
197
            $chemin=$value;
198
            $value='monde';
198
            $value='monde';
199
            $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>";
200
        }
200
        }
201
        else if ($key==(count($tabonglet)-1)) {
201
        else if ($key==(count($tabonglet)-1)) {
202
            $res.="<a class=\"chemin_carto\">&nbsp;&gt;&nbsp;$nom</a>";
202
            $res.="<a class=\"chemin_carto\">&nbsp;&gt;&nbsp;$nom</a>";
203
        }
203
        }
204
        else {
204
        else {
205
            $chemin.='*'.$value;
205
            $chemin.='*'.$value;
206
            $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>";
207
        }
207
        }
208
    }
208
    }
209
    $res .= "</div>\n";
209
    $res .= "</div>\n";
210
    
210
    
211
    $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr".
211
    $requete_2 = " SELECT count(".CAR_CHAMPS_ID.") as nbr".
212
            " FROM ".CAR_ANNUAIRE.
212
            " FROM ".CAR_ANNUAIRE.
213
            " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
213
            " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
214
            " AND ".CAR_CHAMPS_CE_PAYS."='fr'";
214
            " AND ".CAR_CHAMPS_CE_PAYS."='fr'";
215
    
215
    
216
    $resultat_2 = $GLOBALS['car_db']->query($requete_2);
216
    $resultat_2 = $GLOBALS['car_db']->query($requete_2);
217
    if (DB::isError($resultat_2)) {
217
    if (DB::isError($resultat_2)) {
218
    	die ($resultat_2->getMessage().'<br />'.$resultat_2->getDebugInfo()) ;
218
    	die ($resultat_2->getMessage().'<br />'.$resultat_2->getDebugInfo()) ;
219
    }
219
    }
220
    
220
    
221
    $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT);
221
    $ligne_2 = $resultat_2->fetchRow(DB_FETCHMODE_OBJECT);
222
 
222
 
223
    $res .= '<h1 class="titre1_cartographie">'.$nom.' : ' ;
223
    $res .= '<h1 class="titre1_cartographie">'.$nom.' : ' ;
224
    if ($ligne_2->nbr == 0) {
224
    if ($ligne_2->nbr == 0) {
225
        $res .= 'aucun inscrit '.CAR_LABEL_PROJET."</h1>\n";
225
        $res .= 'aucun inscrit '.CAR_LABEL_PROJET."</h1>\n";
226
        if (!$GLOBALS['car_auth']->getAuth()) {
226
        if (!$GLOBALS['car_auth']->getAuth()) {
227
            $res .= AUTH_formulaire_login();
227
            $res .= AUTH_formulaire_login();
228
        } else {
228
        } else {
229
            $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" ;
230
        }
230
        }
231
        return $res ;
231
        return $res ;
232
    } else if ($ligne_2->nbr == 1) {
232
    } else if ($ligne_2->nbr == 1) {
233
        $res .= $ligne_2->nbr." inscrit " ;
233
        $res .= $ligne_2->nbr." inscrit " ;
234
    } else {
234
    } else {
235
        $res .= $ligne_2->nbr." inscrits " ;
235
        $res .= $ligne_2->nbr." inscrits " ;
236
    }
236
    }
237
    $res .= CAR_LABEL_PROJET."</h1>\n";
237
    $res .= CAR_LABEL_PROJET."</h1>\n";
238
    
238
    
239
    if (!$GLOBALS['car_auth']->getAuth()) {
239
    if (!$GLOBALS['car_auth']->getAuth()) {
240
        $res .= AUTH_formulaire_login();
240
        $res .= AUTH_formulaire_login();
241
    } else {
241
    } else {
242
        $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\" 
243
                method=\"post\" name=\"formmail\">
243
                method=\"post\" name=\"formmail\">
244
                    <div id=\"div_inscrit\"><table id=\"table_inscrits\">
244
                    <div id=\"div_inscrit\"><table id=\"table_inscrits\">
245
                        <colgroup>
245
                        <colgroup>
246
                            <col />
246
                            <col />
247
                            <col />
247
                            <col />
248
                            <col />
248
                            <col />
249
                            <col />
249
                            <col />
250
                            <col />
250
                            <col />
251
                            <col />
251
                            <col />
252
                        </colgroup>
252
                        </colgroup>
253
                        <thead>
253
                        <thead>
254
                        <tr>
254
                        <tr>
255
                            <th>&nbsp;</th>
255
                            <th>&nbsp;</th>
256
                            <th>".CAR_NOM."</th>
256
                            <th>".CAR_NOM."</th>
257
                            <th>".CAR_PRENOM."</th>
257
                            <th>".CAR_PRENOM."</th>
258
                            <th>".CAR_DATE_INS."</th>
258
                            <th>".CAR_DATE_INS."</th>
259
                            <th>".CAR_CP."</th>
259
                            <th>".CAR_CP."</th>
260
                            <th>".CAR_VILLE."</th>
260
                            <th>".CAR_VILLE."</th>
261
                        </tr></thead><tbody>\n";
261
                        </tr></thead><tbody>\n";
262
        
262
        
263
        $requete = "SELECT * FROM ".CAR_ANNUAIRE.
263
        $requete = "SELECT * FROM ".CAR_ANNUAIRE.
264
                " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
264
                " WHERE ".CAR_CHAMPS_DPT." = '$argument'".
265
                " AND ".CAR_CHAMPS_CE_PAYS."='fr'".
265
                " AND ".CAR_CHAMPS_CE_PAYS."='fr'".
266
                " ORDER BY ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
266
                " ORDER BY ".CAR_CHAMPS_NOM.", ".CAR_CHAMPS_PRENOM;
267
        $resultat = $GLOBALS['car_db']->query($requete);
267
        $resultat = $GLOBALS['car_db']->query($requete);
268
        if (DB::isError($resultat)) {
268
        if (DB::isError($resultat)) {
269
            die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
269
            die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
270
        }
270
        }
271
        
271
        
272
        $indic=0;
272
        $indic=0;
273
        $i=1;
273
        $i=1;
274
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
274
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
275
            if ($indic==0) {
275
            if ($indic==0) {
276
                $res.="<tr class=\"ligne_impaire\">\n";
276
                $res.="<tr class=\"ligne_impaire\">\n";
277
                $indic=1;
277
                $indic=1;
278
            } else {
278
            } else {
279
                $res.="<tr class=\"ligne_paire\">\n";
279
                $res.="<tr class=\"ligne_paire\">\n";
280
                $indic=0;
280
                $indic=0;
281
            }
281
            }
282
            $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>
283
                                    <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>
283
                                    <td>".strtoupper($ligne[CAR_CHAMPS_NOM])."&nbsp;</td>
284
                                    <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>
285
                                    <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>
286
                                    <td>".$ligne[CAR_CHAMPS_CODE_POSTAL]."&nbsp;</td>
286
                                    <td>".$ligne[CAR_CHAMPS_CODE_POSTAL]."&nbsp;</td>
287
                                    <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>
287
                                    <td>".strtoupper($ligne[CAR_CHAMPS_VILLE])."&nbsp;</td>
288
                                    </tr>\n";
288
                                    </tr>\n";
289
        }
289
        }
290
        $res.="</tbody></table></div>\n";
290
        $res.="</tbody></table></div>\n";
291
        if ($mailer==1) {
291
        if ($mailer==1) {
292
            if (!is_array($select)) {
292
            if (!is_array($select)) {
293
                $res.= CAR_NO_DESTINATAIRE;
293
                $res.= CAR_NO_DESTINATAIRE;
294
            } else {
294
            } else {
295
                $res .= envoie_mail($GLOBALS['car_db']) ;
295
                $res .= envoie_mail_modere($GLOBALS['car_db']) ;
296
            }
296
            }
297
        } else {
297
        } else {
298
            $res .=carto_texte_cocher() ;
298
            $res .=carto_texte_cocher() ;
299
        }
299
        }
300
        $res .= carto_formulaire($titre_mail, $corps) ;
300
        $res .= carto_formulaire($titre_mail, $corps) ;
301
    }
301
    }
302
}
302
}
303
?>
303
?>