Line 70... |
Line 70... |
70 |
function parcourrirAnnu($event) {
|
70 |
function parcourrirAnnu($event) {
|
Line 71... |
Line 71... |
71 |
|
71 |
|
Line 72... |
Line 72... |
72 |
$res = '<p id="annuaire_alphabet">';
|
72 |
$res = '<p id="annuaire_alphabet">';
|
73 |
|
73 |
|
74 |
// Alphabet pour la rechercher par lettre du nom des inscrits
|
74 |
// Alphabet pour la rechercher par lettre du nom des inscrits
|
75 |
for ($i = 65 ; $i <91 ; $i++) {
|
75 |
for ($i = 65 ; $i < 91 ; $i++) {
|
76 |
$GLOBALS['ann_url']->addQueryString('lettre', chr($i));
|
76 |
$GLOBALS['ann_url']->addQueryString('lettre', chr($i));
|
77 |
$url_lettre = $GLOBALS['ann_url']->getURL();
|
77 |
$url_lettre = $GLOBALS['ann_url']->getURL();
|
78 |
$GLOBALS['ann_url']->removeQueryString('lettre');
|
78 |
$GLOBALS['ann_url']->removeQueryString('lettre');
|
Line 82... |
Line 82... |
82 |
$url_lettre = $GLOBALS['ann_url']->getURL();
|
82 |
$url_lettre = $GLOBALS['ann_url']->getURL();
|
83 |
$GLOBALS['ann_url']->removeQueryString('lettre');
|
83 |
$GLOBALS['ann_url']->removeQueryString('lettre');
|
84 |
$res .= '<a href="'.$url_lettre.'">'.'Tous'.'</a>'."\n";
|
84 |
$res .= '<a href="'.$url_lettre.'">'.'Tous'.'</a>'."\n";
|
85 |
$res .= '</p>'."\n";
|
85 |
$res .= '</p>'."\n";
|
Line 86... |
Line 86... |
86 |
|
86 |
|
87 |
// Si une lettre est sélectionnée
|
87 |
// Si aucune lettre n'est sélectionnée, attribution de la lettre par défaut
|
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 |
if (!empty($_REQUEST['lettre'])) {
|
92 |
if (!empty($_REQUEST['lettre'])) {
|
92 |
$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.".* FROM ".ANN_ANNUAIRE.",".ANN_TABLE_PAYS." WHERE ".ANN_CHAMPS_PAYS." = ".ANN_GC_ID." ";
|
93 |
if ($_REQUEST['lettre'] != 'tous') {
|
94 |
if ($_REQUEST['lettre'] != 'tous') {
|
94 |
$requete .= " AND ".ANN_CHAMPS_NOM." LIKE \"".$_REQUEST['lettre']."%\"" ;
|
95 |
$requete .= " AND ".ANN_CHAMPS_NOM." LIKE \"".$_REQUEST['lettre']."%\"" ;
|
Line 156... |
Line 157... |
156 |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM])))))." </td>\n" ;
|
157 |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM])))))." </td>\n" ;
|
157 |
$res .= "</tr>\n";
|
158 |
$res .= "</tr>\n";
|
158 |
}
|
159 |
}
|
159 |
$res .= "</tbody></table></div>\n";
|
160 |
$res .= "</tbody></table></div>\n";
|
160 |
} else {
|
161 |
} else {
|
161 |
$res = '<p class="information">Aucun inscrit n\'a de nom commençant par '.$_REQUEST['lettre'].'</p>';
|
162 |
$res = '<p class="information">Aucun inscrit n\'a de nom commençant par '.$_REQUEST['lettre'].'</p>'."\n";
|
162 |
}
|
163 |
}
|
163 |
return $res;
|
164 |
return $res;
|
164 |
}
|
165 |
}
|
Line 165... |
Line 166... |
165 |
|
166 |
|
166 |
|
167 |
|
167 |
function carto_formulaire ($titre_mail="", $corps = "") {
|
168 |
function carto_formulaire ($titre_mail="", $corps = "") {
|
168 |
$res = '<h2 class="chapo">'.ANN_ENVOYER_MAIL.'</h2>'."\n";
|
169 |
$res = '<h2 class="chapo">'.ANN_ENVOYER_MAIL.'</h2>'."\n";
|
169 |
$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>' ;
|
170 |
$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>'."\n";
|
170 |
$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>' ;
|
171 |
$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>'."\n";
|
171 |
$res .= '<table>'."\n"
|
172 |
$res .= '<table>'."\n".
|
172 |
.'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n"
|
173 |
'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n".
|
173 |
.'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$GLOBALS['titre_mail'].'"/></td>'."\n"
|
174 |
'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$GLOBALS['titre_mail'].'"/></td>'."\n".
|
174 |
.'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.' : </td>'."\n"
|
175 |
'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.' : </td>'."\n".
|
175 |
.'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$GLOBALS['corps'].'</textarea></td>'."\n"
|
176 |
'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$GLOBALS['corps'].'</textarea></td>'."\n".
|
176 |
.'</tr><tr><td></td><td align="center">';
|
177 |
'</tr><tr><td></td><td align="center">';
|
177 |
$res.='<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />';
|
178 |
$res .= '<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />'."\n";
|
178 |
$res .= '</td>'."\n";
|
179 |
$res .= '</td>'."\n";
|
179 |
$res .= '</tr>'."\n";
|
180 |
$res .= '</tr>'."\n";
|
180 |
$res .= '</table>'."\n";
|
181 |
$res .= '</table>'."\n";
|
181 |
$res .= '</form>'."\n";
|
182 |
$res .= '</form>'."\n";
|
Line 182... |
Line 183... |
182 |
return $res ;
|
183 |
return $res;
|
183 |
}
|
184 |
}
|
184 |
|
185 |
|
185 |
|
186 |
|
186 |
/** function carto_texte_cocher ()
|
187 |
/** function carto_texte_cocher ()
|
187 |
*
|
- |
|
188 |
*
|
188 |
*
|
189 |
* @return string HTML
|
189 |
*
|
190 |
*/
|
190 |
* @return string HTML
|
- |
|
191 |
*/
|
191 |
|
192 |
function carto_texte_cocher () {
|
192 |
function carto_texte_cocher () {
|
193 |
$res .= '<div class="texte">'.ANN_CHECK_UNCHECK."\n";
|
Line 193... |
Line 194... |
193 |
$res .= '<div class="texte">'.ANN_CHECK_UNCHECK ;
|
194 |
$res .= ' <input type="checkbox" name="selecttotal" onclick="javascript:setCheckboxes(\'formmail\');"/>'."\n";
|
194 |
$res .= " <input type=\"checkbox\" name=\"selecttotal\" onclick=\"javascript:setCheckboxes('formmail');\"/></div>";
|
195 |
$res .= '</div>';
|
195 |
return $res ;
|
196 |
return $res;
|
196 |
}
|
197 |
}
|
197 |
|
198 |
|
198 |
|
- |
|
199 |
/** envoie_mail()
|
199 |
|
200 |
*
|
200 |
/** envoie_mail()
|
- |
|
201 |
*
|
201 |
*
|
202 |
*
|
202 |
* @return envoie l'email
|
203 |
* @return envoie l'email
|
203 |
*/
|
204 |
*/
|
204 |
|
205 |
function envoie_mail () {
|
205 |
function envoie_mail () {
|
206 |
$requete = 'SELECT '.ANN_CHAMPS_MAIL.' '.
|
206 |
$requete = "select ".ANN_CHAMPS_MAIL." from ".ANN_ANNUAIRE.
|
207 |
'FROM '.ANN_ANNUAIRE.' '.
|
207 |
" where ".ANN_CHAMPS_ID."='".$GLOBALS['AUTH']->getAuthData (ANN_CHAMPS_ID)."'";
|
208 |
'WHERE '.ANN_CHAMPS_ID.' = "'.$GLOBALS['AUTH']->getAuthData(ANN_CHAMPS_ID).'" ';
|
Line 208... |
Line 209... |
208 |
$resultat = $GLOBALS['ann_db']->query($requete);
|
209 |
$resultat = $GLOBALS['ann_db']->query($requete);
|
209 |
if (DB::isError($resultat)) {
|
210 |
if (DB::isError($resultat)) {
|
210 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
|
211 |
die($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
|
211 |
}
|
212 |
}
|
212 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
213 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
213 |
$entete = "From: <".$ligne[ANN_CHAMPS_MAIL].">\n";
|
214 |
$entete = 'From: <'.$ligne[ANN_CHAMPS_MAIL].">\n";
|
214 |
|
215 |
|
Line 215... |
Line 216... |
215 |
$_POST['corps'] .= ANN_PIED_MESSAGE;
|
216 |
$_POST['corps'] .= "\n".ANN_PIED_MESSAGE;
|
216 |
$_POST['corps'] = stripslashes($_POST['corps']) ;
|
217 |
$_POST['corps'] = stripslashes($_POST['corps']);
|
217 |
$liste = "" ;
|
218 |
$liste = '';
|
Line 218... |
Line 219... |
218 |
foreach ($_POST['select'] as $key => $value) {
|
219 |
foreach ($_POST['select'] as $key => $value) {
|
219 |
mail ($value, stripslashes($_POST['titre_mail']), $_POST['corps'] , $entete) ;
|
220 |
mail($value, stripslashes($_POST['titre_mail']), $_POST['corps'] , $entete);
|
220 |
$liste .= $value."\n" ;
|
221 |
$liste .= $value."\n";
|
221 |
}
|
222 |
}
|
222 |
|
223 |
|
223 |
$_POST['corps'] .= "\n----------------------------------------------------------------------------";
|
224 |
$_POST['corps'] .= "\n----------------------------------------------------------------------------";
|
224 |
$_POST['corps'] .= "\n".ANN_MESSAGE_APPLI."\n" ;
|
225 |
$_POST['corps'] .= "\n".ANN_MESSAGE_APPLI."\n" ;
|