Line 65... |
Line 65... |
65 |
*
|
65 |
*
|
66 |
*
|
66 |
*
|
67 |
*
|
67 |
*
|
68 |
* @return string HTML
|
68 |
* @return string HTML
|
69 |
*/
|
69 |
*/
|
70 |
function parcourrirAnnu($event) {
|
70 |
function parcourrirAnnu() {
|
Line 71... |
Line 71... |
71 |
|
71 |
|
Line 72... |
Line 72... |
72 |
$res = '<p id="annuaire_alphabet">';
|
72 |
$res = '<p id="annuaire_alphabet">';
|
73 |
|
73 |
|
Line 88... |
Line 88... |
88 |
if (empty($_REQUEST['lettre'])) {
|
88 |
if (empty($_REQUEST['lettre'])) {
|
89 |
$_REQUEST['lettre'] = ANN_LETTRE_DEFAUT;
|
89 |
$_REQUEST['lettre'] = ANN_LETTRE_DEFAUT;
|
90 |
}
|
90 |
}
|
91 |
// Si une lettre est sélectionnée
|
91 |
// Si une lettre est sélectionnée
|
92 |
if (!empty($_REQUEST['lettre'])) {
|
92 |
if (!empty($_REQUEST['lettre'])) {
|
93 |
$requete = "SELECT ".ANN_ANNUAIRE.".*, ".ANN_TABLE_PAYS.".* FROM ".ANN_ANNUAIRE.",".ANN_TABLE_PAYS." WHERE ".ANN_CHAMPS_PAYS." = ".ANN_GC_ID." ";
|
93 |
$requete = 'SELECT '.ANN_ANNUAIRE.'.*, '.ANN_TABLE_PAYS.'.* '.
|
- |
|
94 |
'FROM '.ANN_ANNUAIRE.','.ANN_TABLE_PAYS.' '.
|
- |
|
95 |
'WHERE '.ANN_CHAMPS_PAYS.' = '.ANN_GC_ID.' ';
|
94 |
if ($_REQUEST['lettre'] != 'tous') {
|
96 |
if ($_REQUEST['lettre'] != 'tous') {
|
95 |
$requete .= " AND ".ANN_CHAMPS_NOM." LIKE \"".$_REQUEST['lettre']."%\"" ;
|
97 |
$requete .= ' AND '.ANN_CHAMPS_NOM.' LIKE "'.$_REQUEST['lettre'].'%" ' ;
|
96 |
}
|
98 |
}
|
97 |
$requete .= " ORDER BY ".ANN_CHAMPS_NOM ;
|
99 |
$requete .= 'ORDER BY '.ANN_CHAMPS_NOM;
|
Line 98... |
Line 100... |
98 |
|
100 |
|
99 |
$res .= listes_inscrit ($requete, $GLOBALS['ann_url']->getURL(), $select, '', $GLOBALS['ann_db'], $niveau = 'pays').
|
101 |
$res .= listes_inscrit ($requete, $GLOBALS['ann_url']->getURL(), '', $GLOBALS['ann_db'], $niveau = 'pays').
|
100 |
carto_texte_cocher().
|
102 |
carto_texte_cocher().
|
101 |
carto_formulaire($_POST['titre'], $_POST['corps']) ;
|
103 |
carto_formulaire();
|
102 |
}
|
104 |
}
|
103 |
return $res;
|
105 |
return $res;
|
Line 104... |
Line 106... |
104 |
}
|
106 |
}
|
105 |
|
107 |
|
106 |
/**
|
108 |
/**
|
107 |
* Renvoie le code HTML de la liste des inscrits
|
109 |
* Renvoie le code HTML de la liste des inscrits
|
108 |
* en fonction de la requete passé en parametre
|
110 |
* en fonction de la requete passé en parametre
|
109 |
*
|
111 |
*
|
110 |
* @return Renvoie le code HTML de la liste des inscrits
|
112 |
* @return Renvoie le code HTML de la liste des inscrits
|
111 |
*/
|
113 |
*/
|
112 |
function listes_inscrit ($requete, $url, $select, $argument, &$db, $niveau = 'pays') {
|
114 |
function listes_inscrit($requete, $url, $argument, &$db, $niveau = 'pays') {
|
Line 113... |
Line 115... |
113 |
$resultat = $GLOBALS['ann_db']->query($requete);
|
115 |
$resultat = $GLOBALS['ann_db']->query($requete);
|
114 |
(DB::isError($resultat)) ? die($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) : '';
|
116 |
(DB::isError($resultat)) ? die($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) : '';
|
115 |
|
117 |
|
116 |
if ($resultat->numRows() > 0) {
|
118 |
if ($resultat->numRows() > 0) {
|
117 |
$res = "<form action=\"$url?mailer=1&lettre=".$_REQUEST['lettre']."\" method=\"post\" name=\"formmail\">\n";
|
119 |
$res = '<form action="'.$url.'?mailer=1&lettre='.$_REQUEST['lettre'].'" method="post" name="formmail">'."\n";
|
118 |
$res .= '<div id="annuaire" class="conteneur_table">
|
120 |
$res .= '<div id="annuaire" class="conteneur_table">
|
119 |
<table id="table_inscrit" class="table_cadre">
|
121 |
<table id="table_inscrit" class="table_cadre">
|
Line 139... |
Line 141... |
139 |
</thead>
|
141 |
</thead>
|
140 |
<tbody class="contenu_deroulant">';
|
142 |
<tbody class="contenu_deroulant">';
|
141 |
$indic = 0;
|
143 |
$indic = 0;
|
142 |
$i = 1;
|
144 |
$i = 1;
|
143 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
145 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
144 |
if ($indic==0) {
|
146 |
if ($indic == 0) {
|
145 |
$res.="<tr class=\"ligne_impaire\">\n";
|
147 |
$res .= '<tr class="ligne_impaire">'."\n";
|
146 |
$indic=1;
|
148 |
$indic = 1;
|
147 |
} else {
|
149 |
} else {
|
148 |
$res.="<tr class=\"ligne_paire\">\n";
|
150 |
$res .= '<tr class="ligne_paire">'."\n";
|
149 |
$indic=0;
|
151 |
$indic = 0;
|
150 |
}
|
152 |
}
|
151 |
$res.= "<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[ANN_CHAMPS_MAIL]."\" /></td>\n
|
153 |
$res.= '<td><input type="checkbox" name="select[]" value="'.$ligne[ANN_CHAMPS_MAIL].'" /></td>'."\n".
|
152 |
<td>".strtoupper($ligne[ANN_CHAMPS_NOM])." </td>\n
|
154 |
'<td>'.strtoupper($ligne[ANN_CHAMPS_NOM]).' </td>'."\n".
|
153 |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[ANN_CHAMPS_PRENOM]))))." </td>\n
|
155 |
'<td>'.str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[ANN_CHAMPS_PRENOM])))).' </td>'."\n".
|
154 |
<td>".date("d m Y", strtotime($ligne[ANN_CHAMPS_DATE_INS]))." </td>\n
|
156 |
'<td>'.date('d m Y', strtotime($ligne[ANN_CHAMPS_DATE_INS])).' </td>'."\n".
|
155 |
<td>".$ligne[ANN_CHAMPS_CODE_POSTAL]." </td>\n
|
157 |
'<td>'.$ligne[ANN_CHAMPS_CODE_POSTAL].' </td>'."\n".
|
156 |
<td>".strtoupper($ligne[ANN_CHAMPS_VILLE])." </td>\n
|
158 |
'<td>'.strtoupper($ligne[ANN_CHAMPS_VILLE]).' </td>'."\n".
|
157 |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM])))))." </td>\n" ;
|
159 |
'<td>'.str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM]))))).' </td>'."\n";
|
158 |
$res .= "</tr>\n";
|
160 |
$res .= '</tr>'."\n";
|
159 |
}
|
161 |
}
|
160 |
$res .= "</tbody></table></div>\n";
|
162 |
$res .= '</tbody></table></div>'."\n";
|
161 |
} else {
|
163 |
} else {
|
162 |
$res = '<p class="information">Aucun inscrit n\'a de nom commençant par '.$_REQUEST['lettre'].'</p>'."\n";
|
164 |
$res = '<p class="information">'.'Aucun inscrit n\'a de nom commençant par '.$_REQUEST['lettre'].'</p>'."\n";
|
163 |
}
|
165 |
}
|
164 |
return $res;
|
166 |
return $res;
|
165 |
}
|
167 |
}
|
Line 166... |
Line 168... |
166 |
|
168 |
|
167 |
|
169 |
|
168 |
function carto_formulaire ($titre_mail="", $corps = "") {
|
170 |
function carto_formulaire() {
|
169 |
$res = '<h2 class="chapo">'.ANN_ENVOYER_MAIL.'</h2>'."\n";
|
171 |
$res = '<h2 class="chapo">'.ANN_ENVOYER_MAIL.'</h2>'."\n";
|
170 |
$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>'."\n";
|
172 |
$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>'."\n";
|
171 |
$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>'."\n";
|
173 |
$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>'."\n";
|
172 |
$res .= '<table>'."\n".
|
174 |
$res .= '<table>'."\n".
|
173 |
'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n".
|
175 |
'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n".
|
174 |
'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$GLOBALS['titre_mail'].'"/></td>'."\n".
|
176 |
'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$_POST['titre_mail'].'"/></td>'."\n".
|
175 |
'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.' : </td>'."\n".
|
177 |
'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.' : </td>'."\n".
|
176 |
'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$GLOBALS['corps'].'</textarea></td>'."\n".
|
178 |
'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$_POST['corps'].'</textarea></td>'."\n".
|
177 |
'</tr><tr><td></td><td align="center">';
|
179 |
'</tr><tr><td></td><td align="center">';
|
178 |
$res .= '<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />'."\n";
|
180 |
$res .= '<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />'."\n";
|
179 |
$res .= '</td>'."\n";
|
181 |
$res .= '</td>'."\n";
|
Line 187... |
Line 189... |
187 |
/** function carto_texte_cocher ()
|
189 |
/** function carto_texte_cocher ()
|
188 |
*
|
190 |
*
|
189 |
*
|
191 |
*
|
190 |
* @return string HTML
|
192 |
* @return string HTML
|
191 |
*/
|
193 |
*/
|
192 |
function carto_texte_cocher () {
|
194 |
function carto_texte_cocher() {
|
193 |
$res .= '<div class="texte">'.ANN_CHECK_UNCHECK."\n";
|
195 |
$res .= '<div class="texte">'.ANN_CHECK_UNCHECK."\n";
|
194 |
$res .= ' <input type="checkbox" name="selecttotal" onclick="javascript:setCheckboxes(\'formmail\');"/>'."\n";
|
196 |
$res .= ' <input type="checkbox" name="selecttotal" onclick="javascript:setCheckboxes(\'formmail\');"/>'."\n";
|
195 |
$res .= '</div>';
|
197 |
$res .= '</div>';
|
196 |
return $res;
|
198 |
return $res;
|
197 |
}
|
199 |
}
|
Line 200... |
Line 202... |
200 |
/** envoie_mail()
|
202 |
/** envoie_mail()
|
201 |
*
|
203 |
*
|
202 |
*
|
204 |
*
|
203 |
* @return envoie l'email
|
205 |
* @return envoie l'email
|
204 |
*/
|
206 |
*/
|
205 |
function envoie_mail () {
|
207 |
function envoie_mail($selection, $titre_mail, $corps) {
|
206 |
$requete = 'SELECT '.ANN_CHAMPS_MAIL.' '.
|
208 |
$requete = 'SELECT '.ANN_CHAMPS_MAIL.' '.
|
207 |
'FROM '.ANN_ANNUAIRE.' '.
|
209 |
'FROM '.ANN_ANNUAIRE.' '.
|
208 |
'WHERE '.ANN_CHAMPS_ID.' = "'.$GLOBALS['AUTH']->getAuthData(ANN_CHAMPS_ID).'" ';
|
210 |
'WHERE '.ANN_CHAMPS_ID.' = "'.$GLOBALS['AUTH']->getAuthData(ANN_CHAMPS_ID).'" ';
|
209 |
$resultat = $GLOBALS['ann_db']->query($requete);
|
211 |
$resultat = $GLOBALS['ann_db']->query($requete);
|
210 |
if (DB::isError($resultat)) {
|
212 |
if (DB::isError($resultat)) {
|
211 |
die($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
|
213 |
die($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
|
212 |
}
|
214 |
}
|
213 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
215 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
214 |
$entete = 'From: <'.$ligne[ANN_CHAMPS_MAIL].">\n";
|
216 |
$entete = 'From: <'.$ligne[ANN_CHAMPS_MAIL].">\n";
|
215 |
|
217 |
|
216 |
$_POST['corps'] .= "\n".ANN_PIED_MESSAGE;
|
218 |
$corps .= "\n".ANN_PIED_MESSAGE;
|
217 |
$_POST['corps'] = stripslashes($_POST['corps']);
|
- |
|
- |
|
219 |
|
218 |
$liste = '';
|
220 |
$liste = '';
|
219 |
foreach ($_POST['select'] as $key => $value) {
|
221 |
foreach ($selection as $key => $value) {
|
220 |
mail($value, stripslashes($_POST['titre_mail']), $_POST['corps'] , $entete);
|
222 |
mail($value, $titre_mail, $corps, $entete);
|
221 |
$liste .= $value."\n";
|
223 |
$liste .= $value."\n";
|
222 |
}
|
224 |
}
|
Line 223... |
Line 225... |
223 |
|
225 |
|
224 |
$_POST['corps'] .= "\n----------------------------------------------------------------------------";
|
226 |
$corps .= "\n----------------------------------------------------------------------------";
|
225 |
$_POST['corps'] .= "\n".ANN_MESSAGE_APPLI."\n" ;
|
227 |
$corps .= "\n".ANN_MESSAGE_APPLI."\n" ;
|
Line 226... |
Line 228... |
226 |
$_POST['corps'] .= "\n".ANN_MESSAGE_ENVOYE_A." :\n $liste" ;
|
228 |
$corps .= "\n".ANN_MESSAGE_ENVOYE_A." :\n $liste" ;
|
227 |
|
- |
|
228 |
mail(ANN_MAIL_ADMIN, stripslashes($_POST['titre_mail']), $_POST['corps'], $entete);
|
- |
|
- |
|
229 |
|
229 |
$_POST['corps'] = '';
|
230 |
mail(ANN_MAIL_ADMIN, $titre_mail, $corps, $entete);
|
230 |
$_POST['titre_mail'] = '';
|
231 |
|
- |
|
232 |
return '<div class="information">'.ANN_MAIL_ENVOYER.'</div>' ;
|
- |
|
233 |
}
|
- |
|
234 |
/** translittererVersIso88591()
|
- |
|
235 |
*
|
- |
|
236 |
* Convertit les caractères CP1252 (= ANSI) non présent dans l'ISO-8859-1 par un équivalant ressemblant.
|
- |
|
237 |
*
|
- |
|
238 |
* @return envoie l'email
|
- |
|
239 |
*/
|
- |
|
240 |
function translittererCp1252VersIso88591($str, $translit = true) {
|
- |
|
241 |
$cp1252_entite_map = array(
|
- |
|
242 |
'\x80' => '€', /* EURO SIGN */
|
- |
|
243 |
'\x82' => '‚', /* SINGLE LOW-9 QUOTATION MARK */
|
- |
|
244 |
'\x83' => 'ƒ', /* LATIN SMALL LETTER F WITH HOOK */
|
- |
|
245 |
'\x84' => '„', /* DOUBLE LOW-9 QUOTATION MARK */
|
- |
|
246 |
'\x85' => '…', /* HORIZONTAL ELLIPSIS */
|
- |
|
247 |
'\x86' => '†', /* DAGGER */
|
- |
|
248 |
'\x87' => '‡', /* DOUBLE DAGGER */
|
- |
|
249 |
'\x88' => 'ˆ', /* MODIFIER LETTER CIRCUMFLEX ACCENT */
|
- |
|
250 |
'\x89' => '‰', /* PER MILLE SIGN */
|
- |
|
251 |
'\x8a' => 'Š', /* LATIN CAPITAL LETTER S WITH CARON */
|
- |
|
252 |
'\x8b' => '‹', /* SINGLE LEFT-POINTING ANGLE QUOTATION */
|
- |
|
253 |
'\x8c' => 'Œ', /* LATIN CAPITAL LIGATURE OE */
|
- |
|
254 |
'\x8e' => 'Ž', /* LATIN CAPITAL LETTER Z WITH CARON */
|
- |
|
255 |
'\x91' => '‘', /* LEFT SINGLE QUOTATION MARK */
|
- |
|
256 |
'\x92' => '’', /* RIGHT SINGLE QUOTATION MARK */
|
- |
|
257 |
'\x93' => '“', /* LEFT DOUBLE QUOTATION MARK */
|
- |
|
258 |
'\x94' => '”', /* RIGHT DOUBLE QUOTATION MARK */
|
- |
|
259 |
'\x95' => '•', /* BULLET */
|
- |
|
260 |
'\x96' => '–', /* EN DASH */
|
- |
|
261 |
'\x97' => '—', /* EM DASH */
|
- |
|
262 |
'\x98' => '˜', /* SMALL TILDE */
|
- |
|
263 |
'\x99' => '™', /* TRADE MARK SIGN */
|
- |
|
264 |
'\x9a' => 'š', /* LATIN SMALL LETTER S WITH CARON */
|
- |
|
265 |
'\x9b' => '›', /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
|
- |
|
266 |
'\x9c' => 'œ', /* LATIN SMALL LIGATURE OE */
|
- |
|
267 |
'\x9e' => 'ž', /* LATIN SMALL LETTER Z WITH CARON */
|
- |
|
268 |
'\x9f' => 'Ÿ' /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
|
- |
|
269 |
);
|
- |
|
270 |
$translit_map = array(
|
- |
|
271 |
'€' => 'Euro', /* EURO SIGN */
|
- |
|
272 |
'‚' => ',', /* SINGLE LOW-9 QUOTATION MARK */
|
- |
|
273 |
'ƒ' => 'f', /* LATIN SMALL LETTER F WITH HOOK */
|
- |
|
274 |
'„' => ',,', /* DOUBLE LOW-9 QUOTATION MARK */
|
- |
|
275 |
'…' => '...', /* HORIZONTAL ELLIPSIS */
|
- |
|
276 |
'†' => '+', /* DAGGER */
|
- |
|
277 |
'‡' => '++', /* DOUBLE DAGGER */
|
- |
|
278 |
'ˆ' => '^', /* MODIFIER LETTER CIRCUMFLEX ACCENT */
|
- |
|
279 |
'‰' => '0/00', /* PER MILLE SIGN */
|
- |
|
280 |
'Š' => 'S', /* LATIN CAPITAL LETTER S WITH CARON */
|
- |
|
281 |
'‹' => '<', /* SINGLE LEFT-POINTING ANGLE QUOTATION */
|
- |
|
282 |
'Œ' => 'OE', /* LATIN CAPITAL LIGATURE OE */
|
- |
|
283 |
'Ž' => 'Z', /* LATIN CAPITAL LETTER Z WITH CARON */
|
- |
|
284 |
'‘' => "'", /* LEFT SINGLE QUOTATION MARK */
|
- |
|
285 |
'’' => "'", /* RIGHT SINGLE QUOTATION MARK */
|
- |
|
286 |
'“' => '"', /* LEFT DOUBLE QUOTATION MARK */
|
- |
|
287 |
'”' => '"', /* RIGHT DOUBLE QUOTATION MARK */
|
- |
|
288 |
'•' => '*', /* BULLET */
|
- |
|
289 |
'–' => '-', /* EN DASH */
|
- |
|
290 |
'—' => '--', /* EM DASH */
|
- |
|
291 |
'˜' => '~', /* SMALL TILDE */
|
- |
|
292 |
'™' => '(TM)', /* TRADE MARK SIGN */
|
- |
|
293 |
'š' => 's', /* LATIN SMALL LETTER S WITH CARON */
|
- |
|
294 |
'›' => '>', /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
|
- |
|
295 |
'œ' => 'oe', /* LATIN SMALL LIGATURE OE */
|
- |
|
296 |
'ž' => 'z', /* LATIN SMALL LETTER Z WITH CARON */
|
- |
|
297 |
'Ÿ' => 'Y' /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
|
- |
|
298 |
);
|
- |
|
299 |
$str = strtr($str, $cp1252_entite_map);
|
- |
|
300 |
if ($translit) {
|
- |
|
301 |
$str = strtr($str, $translit_map);
|
- |
|
302 |
}
|
231 |
return '<div class="information">'.ANN_MAIL_ENVOYER.'</div>' ;
|
303 |
return $str;
|
232 |
}
|
304 |
}
|