39,24 → 39,25 |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
|
include_once "HTML/QuickForm.php" ; |
|
|
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
|
|
function AUTH_formulaire_login() { |
$res = ''; |
|
$url = preg_replace ('/&/', '&', $GLOBALS['ann_url']->getURL()) ; |
|
$res .= '<p>'.ANN_IDENTIFICATION_PRESENTATION_XHTML.'</p>'."\n" ; |
|
$form = new HTML_QuickForm ('inscription', 'post', $url) ; |
$form->addElement ('text', 'username', ANN_EMAIL) ; |
$form->addElement ('password', 'password', ANN_MOT_DE_PASSE) ; |
$form->addElement('submit', 'valider', ANN_VALIDER); |
|
$res .= $form->toHTML() ; |
|
$res .= "<div>".ANN_TEXTE_PERDU."</div>\n" ; |
return $res; |
} |
|
66,31 → 67,41 |
* |
* @return string HTML |
*/ |
|
function parcourrirAnnu($event) { |
|
$res = '<div><table><tr>'; |
$res = '<p id="annuaire_alphabet">'; |
|
// ecrire toutes les lettres avec un lien |
// Alphabet pour la rechercher par lettre du nom des inscrits |
for ($i = 65 ; $i <91 ; $i++) { |
$res .= '<td><a style="font-size:15px;" href="'.$GLOBALS['ann_url']->getURL().'&lettre='; |
$res .= chr($i) ; |
$res .= '">'; |
$res .= chr($i) ; |
$res .= "</a></td>\n"; |
$GLOBALS['ann_url']->addQueryString('lettre', chr($i)); |
$url_lettre = $GLOBALS['ann_url']->getURL(); |
$GLOBALS['ann_url']->removeQueryString('lettre'); |
$res .= '<a href="'.$url_lettre.'">'.chr($i).'</a> '."\n"; |
} |
$res .= "</tr></table></div>\n"; |
if (ANN_TOUS_BOOL) { |
$GLOBALS['ann_url']->addQueryString('lettre', 'tous'); |
$url_lettre = $GLOBALS['ann_url']->getURL(); |
$GLOBALS['ann_url']->removeQueryString('lettre'); |
$res .= '<a href="'.$url_lettre.'">'.'Tous'.'</a>'."\n"; |
} |
$res .= '</p>'."\n"; |
|
// si une lettre est selectionne |
// Si une lettre est sélectionnée |
if (empty($_REQUEST['lettre'])) { |
$_REQUEST['lettre'] = ANN_LETTRE_DEFAUT; |
} |
if (!empty($_REQUEST['lettre'])) { |
$requete = "SELECT ".ANN_ANNUAIRE.".*, ".ANN_TABLE_PAYS.".* FROM ".ANN_ANNUAIRE.",".ANN_TABLE_PAYS." WHERE ".ANN_CHAMPS_PAYS." = ".ANN_GC_ID." AND "; |
if ($_REQUEST['lettre'] != "tous") $requete .= " ".ANN_CHAMPS_NOM." LIKE \"".$_REQUEST['lettre']."%\"" ; |
$requete = "SELECT ".ANN_ANNUAIRE.".*, ".ANN_TABLE_PAYS.".* FROM ".ANN_ANNUAIRE.",".ANN_TABLE_PAYS." WHERE ".ANN_CHAMPS_PAYS." = ".ANN_GC_ID." "; |
if ($_REQUEST['lettre'] != 'tous') { |
$requete .= " AND ".ANN_CHAMPS_NOM." LIKE \"".$_REQUEST['lettre']."%\"" ; |
} |
$requete .= " ORDER BY ".ANN_CHAMPS_NOM ; |
|
$res .= listes_inscrit ($requete, $GLOBALS['ann_url']->getURL(), $select, '', $GLOBALS['ann_db'], $niveau = 'pays').carto_texte_cocher(). |
carto_formulaire($_POST['titre'], $_POST['corps']) ; |
$res .= listes_inscrit ($requete, $GLOBALS['ann_url']->getURL(), $select, '', $GLOBALS['ann_db'], $niveau = 'pays'). |
carto_texte_cocher(). |
carto_formulaire($_POST['titre'], $_POST['corps']) ; |
} |
return $res ; |
return $res; |
} |
|
/** |
99,76 → 110,81 |
* |
* @return Renvoie le code HTML de la liste des inscrits |
*/ |
|
function listes_inscrit ($requete, $url, $select, $argument, &$db, $niveau = 'pays') { |
$res = "<div>"; |
$res .= "<form action=\"$url?mailer=1&lettre=".$_REQUEST['lettre']."\" method=\"post\" name=\"formmail\">\n |
<table id=\"table_inscrit\" class=\"table_cadre\">\n |
<colgroup> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
</colgroup> |
<thead>\n |
<th> </th> |
<th>".ANN_NOM."</th> |
<th>".ANN_PRENOM."</th> |
<th>".ANN_DATE_INS."</th> |
<th>".ANN_CP."</th> |
<th>".ANN_VILLE."</th> |
<th>".ANN_PAYS."</th> |
</thead>"; |
|
$resultat= $GLOBALS['ann_db']->query($requete); |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ; |
} |
$indic=0; |
$i=1; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
if ($indic==0) { |
$res.="<tr class=\"ligne_impaire\">\n"; |
$indic=1; |
} |
else { |
$res.="<tr class=\"ligne_paire\">\n"; |
$indic=0; |
} |
$res.="<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[ANN_CHAMPS_MAIL]."\"></td>\n |
<td>".strtoupper($ligne[ANN_CHAMPS_NOM])." </td>\n |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[ANN_CHAMPS_PRENOM]))))." </td>\n |
<td>".date("d m Y", strtotime($ligne[ANN_CHAMPS_DATE_INS]))." </td>\n |
<td>".$ligne[ANN_CHAMPS_CODE_POSTAL]." </td>\n |
<td>".strtoupper($ligne[ANN_CHAMPS_VILLE])." </td>\n |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM])))))." </td>\n" ; |
$res .= "</tr>\n"; |
} |
$res .= "</table></div>\n"; |
return $res ; |
$resultat = $GLOBALS['ann_db']->query($requete); |
(DB::isError($resultat)) ? die($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) : ''; |
|
if ($resultat->numRows() > 0) { |
$res = "<form action=\"$url?mailer=1&lettre=".$_REQUEST['lettre']."\" method=\"post\" name=\"formmail\">\n"; |
$res .= '<div id="annuaire" class="conteneur_table"> |
<table id="table_inscrit" class="table_cadre"> |
<colgroup> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
</colgroup> |
<thead class="entete_fixe"> |
<tr> |
<th> </th> |
<th>'.ANN_NOM.'</th> |
<th>'.ANN_PRENOM.'</th> |
<th>'.ANN_DATE_INS.'</th> |
<th>'.ANN_CP.'</th> |
<th>'.ANN_VILLE.'</th> |
<th>'.ANN_PAYS.'</th> |
</tr> |
</thead> |
<tbody class="contenu_deroulant">'; |
$indic = 0; |
$i = 1; |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
if ($indic==0) { |
$res.="<tr class=\"ligne_impaire\">\n"; |
$indic=1; |
} else { |
$res.="<tr class=\"ligne_paire\">\n"; |
$indic=0; |
} |
$res.= "<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[ANN_CHAMPS_MAIL]."\" /></td>\n |
<td>".strtoupper($ligne[ANN_CHAMPS_NOM])." </td>\n |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[ANN_CHAMPS_PRENOM]))))." </td>\n |
<td>".date("d m Y", strtotime($ligne[ANN_CHAMPS_DATE_INS]))." </td>\n |
<td>".$ligne[ANN_CHAMPS_CODE_POSTAL]." </td>\n |
<td>".strtoupper($ligne[ANN_CHAMPS_VILLE])." </td>\n |
<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM])))))." </td>\n" ; |
$res .= "</tr>\n"; |
} |
$res .= "</tbody></table></div>\n"; |
} else { |
$res = '<p class="information">Aucun inscrit n\'a de nom commençant par '.$_REQUEST['lettre'].'</p>'; |
} |
return $res; |
} |
|
|
function carto_formulaire ($titre_mail="", $corps = "") { |
global $HTTP_USER_AGENT ; |
$res = "<h2 class=\"chapo\">".ANN_ENVOYER_MAIL."</h2>\n"; |
$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>' ; |
$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>' ; |
$res = '<div id="redaction">'."\n"; |
$res .= '<div id="redaction_tete"></div>'."\n"; |
$res .= '<h2 class="chapo">'.ANN_ENVOYER_MAIL.'</h2>'."\n"; |
$res .= '<table>'."\n" |
.'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n" |
.'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$GLOBALS['titre_mail'].'"></td>'."\n" |
.'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$GLOBALS['titre_mail'].'"/></td>'."\n" |
.'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.' : </td>'."\n" |
.'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$GLOBALS['corps'].'</textarea></td>'."\n" |
.'</tr><tr><td></td><td align="center">'; |
if (ereg ("Gecko",$HTTP_USER_AGENT)) { |
$res.='<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />'; |
} else { |
$res.='<input class="spip_bouton" type="submit" onclick="javascript:confirmer();" value="'.ANN_ENVOYER.'" />'; |
} |
$res.="</td>\n</tr>\n</table>\n</form>\n"; |
$res .='<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />'; |
$res .= '</td>'."\n"; |
$res .= '</tr>'."\n"; |
$res .= '</table>'."\n"; |
$res .= '</form>'."\n"; |
$res .= '<div id="redaction_pied"/></div>'."\n"; |
$res .= '</div>'."\n"; |
$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>' ; |
$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>' ; |
return $res ; |
} |
|
181,7 → 197,7 |
|
function carto_texte_cocher () { |
$res .= '<div class="texte">'.ANN_CHECK_UNCHECK ; |
$res .= " <input type=\"checkbox\" name=\"selecttotal\" onclick=\"javascript:setCheckboxes('formmail');\"></div>"; |
$res .= " <input type=\"checkbox\" name=\"selecttotal\" onclick=\"javascript:setCheckboxes('formmail');\"/></div>"; |
return $res ; |
} |
|
193,8 → 209,8 |
*/ |
|
function envoie_mail () { |
$requete = "select ".ANN_CHAMPS_MAIL." from ".ANN_ANNUAIRE. |
" where ".ANN_CHAMPS_ID."='".$GLOBALS['AUTH']->getAuthData (ANN_CHAMPS_ID)."'"; |
$requete = "select ".ANN_CHAMPS_MAIL." from ".ANN_ANNUAIRE. |
" where ".ANN_CHAMPS_ID."='".$GLOBALS['AUTH']->getAuthData (ANN_CHAMPS_ID)."'"; |
$resultat = $GLOBALS['ann_db']->query($requete); |
if (DB::isError($resultat)) { |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()); |
219,24 → 235,4 |
$_POST['titre_mail'] = ''; |
return '<div class="information">'.ANN_MAIL_ENVOYER.'</div>' ; |
} |
|
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: annuaire.fonct.php,v $ |
* Revision 1.1 2005/03/24 08:46:07 alex |
* version initiale |
* |
* Revision 1.2 2005/01/06 15:18:31 alex |
* modification de la fonction de formulaire d'authentification |
* |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex |
* Import initial |
* |
* Revision 1.1 2005/01/03 17:18:49 alex |
* retour vers la liste des participants après un ajout. |
* |
* |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |