Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: annuaire.fonct.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
|
22 |
// CVS : $Id: annuaire.fonct.php,v 1.2 2005-09-29 16:13:54 alexandre_tb Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Fonctions du module annuaire
|
24 |
* Fonctions du module annuaire
|
25 |
*
|
25 |
*
|
26 |
* Fonctions du module annuaire
|
26 |
* Fonctions du module annuaire
|
27 |
*
|
27 |
*
|
Line 29... |
Line 29... |
29 |
//Auteur original :
|
29 |
//Auteur original :
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
31 |
//Autres auteurs :
|
31 |
//Autres auteurs :
|
32 |
*@author Aucun
|
32 |
*@author Aucun
|
33 |
*@copyright Tela-Botanica 2000-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
34 |
*@version $Revision: 1.1 $
|
34 |
*@version $Revision: 1.2 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
Line 37... |
Line 37... |
37 |
|
37 |
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
Line 67... |
Line 67... |
67 |
$res .= '</tr></table></div>'."\n";
|
67 |
$res .= '</tr></table></div>'."\n";
|
Line 68... |
Line 68... |
68 |
|
68 |
|
69 |
// si une lettre est selectionne
|
69 |
// si une lettre est selectionne
|
70 |
if (!empty($_REQUEST['lettre'])) {
|
70 |
if (!empty($_REQUEST['lettre'])) {
|
71 |
$requete = 'SELECT '.INS_CHAMPS_ID;
|
71 |
$requete = 'SELECT '.INS_CHAMPS_ID;
|
72 |
foreach($GLOBALS['annuaire_champs_visibles']['champs_db'] as $i) {
|
72 |
foreach($GLOBALS['annuaire_champs_visibles']['champs_db'] as $i) {
|
73 |
$requete .= ', '.$i;
|
73 |
$requete .= ', '.$i;
|
74 |
}
|
74 |
}
|
75 |
$requete .= ' FROM '.INS_ANNUAIRE.' WHERE ';
|
75 |
$requete .= ' FROM '.INS_ANNUAIRE.' WHERE ';
|
76 |
if ($_REQUEST['lettre'] != 'tous') {
|
76 |
if ($_REQUEST['lettre'] != 'tous') {
|
77 |
$requete .= INS_CHAMPS_NOM.' LIKE "'.$_REQUEST['lettre'].'%"';
|
77 |
$requete .= INS_CHAMPS_NOM.' LIKE "'.$_REQUEST['lettre'].'%"';
|
78 |
} else {
|
78 |
} else {
|
79 |
$requete .= '1';
|
- |
|
80 |
}
|
- |
|
81 |
$requete .= ' ORDER BY '.INS_CHAMPS_NOM ;
|
- |
|
82 |
$resultat = $GLOBALS['ins_db']->query($requete);
|
- |
|
83 |
if ($resultat->numRows()>0) {
|
- |
|
84 |
$i=0;
|
- |
|
85 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
86 |
$donnees_membres[$i++]=$ligne;
|
79 |
$requete .= '1';
|
- |
|
80 |
}
|
- |
|
81 |
$requete .= ' ORDER BY '.INS_CHAMPS_NOM ;
|
- |
|
82 |
$resultat = $GLOBALS['ins_db']->query($requete);
|
- |
|
83 |
if ($resultat->numRows()>0) {
|
- |
|
84 |
$i=0;
|
- |
|
85 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
86 |
$donnees_membres[$i++]=$ligne;
|
87 |
}
|
87 |
}
|
- |
|
88 |
$res .= listes_inscrit($donnees_membres, $GLOBALS['annuaire_champs_visibles']['label_champs']);
|
88 |
$res .= listes_inscrit($donnees_membres, $GLOBALS['annuaire_champs_visibles']['label_champs']);
|
89 |
} else {
|
- |
|
90 |
$res .= ANN_PAS_D_INSCRITS;
|
89 |
} else {$res .= ANN_PAS_D_INSCRITS;}
|
91 |
}
|
90 |
}
|
92 |
}
|
91 |
return $res ;
|
93 |
return $res ;
|
Line 92... |
Line 94... |
92 |
}
|
94 |
}
|
Line 154... |
Line 156... |
154 |
*
|
156 |
*
|
155 |
* @return envoie l'email
|
157 |
* @return envoie l'email
|
156 |
*/
|
158 |
*/
|
Line 157... |
Line 159... |
157 |
|
159 |
|
158 |
function envoie_mail_depuis_annuaire() {
|
160 |
function envoie_mail_depuis_annuaire() {
|
159 |
$requete = "select ".ANN_CHAMPS_MAIL." from ".ANN_ANNUAIRE.
|
161 |
$requete = "select ".INS_CHAMPS_MAIL." from ".INS_ANNUAIRE.
|
160 |
" where ".ANN_CHAMPS_ID."='".$GLOBALS['AUTH']->getAuthData (ANN_CHAMPS_ID)."'";
|
162 |
" where ".INS_CHAMPS_ID."='".$GLOBALS['AUTH']->getAuthData (INS_CHAMPS_ID)."'";
|
161 |
$resultat = $GLOBALS['ann_db']->query($requete);
|
163 |
$resultat = $GLOBALS['ins_db']->query($requete);
|
162 |
if (DB::isError($resultat)) {
|
164 |
if (DB::isError($resultat)) {
|
163 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
|
165 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
|
164 |
}
|
166 |
}
|
165 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
167 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
Line 166... |
Line 168... |
166 |
$entete = "From: <".$ligne[ANN_CHAMPS_MAIL].">\n";
|
168 |
$entete = "From: <".$ligne[INS_CHAMPS_MAIL].">\n";
|
167 |
|
169 |
|
168 |
$_POST['corps'] .= ANN_PIED_MESSAGE;
|
170 |
$_POST['corps'] .= ANN_PIED_MESSAGE;
|
169 |
$_POST['corps'] = stripslashes($_POST['corps']) ;
|
171 |
$_POST['corps'] = stripslashes($_POST['corps']) ;
|
- |
|
172 |
$liste = "" ;
|
- |
|
173 |
$liste_numero = implode (',', $_POST['select']) ;
|
- |
|
174 |
$requete_liste_mail = 'select '.INS_CHAMPS_MAIL.' from '.INS_ANNUAIRE.' where '.INS_CHAMPS_ID.
|
- |
|
175 |
' in ('.$liste_numero.')' ;
|
- |
|
176 |
$resultat_liste_mail = $GLOBALS['ins_db']->query($requete_liste_mail);
|
170 |
$liste = "" ;
|
177 |
|
171 |
foreach ($_POST['select'] as $key => $value) {
|
178 |
while ($ligne_liste_mail = $resultat_liste_mail->fetchRow(DB_FETCHMODE_ASSOC)) {
|
172 |
mail ($value, stripslashes($_POST['titre_mail']), $_POST['corps'] , $entete) ;
|
179 |
mail ($ligne_liste_mail[INS_CHAMPS_MAIL], stripslashes($_POST['titre_mail']), $_POST['corps'] , $entete) ;
|
Line 173... |
Line 180... |
173 |
$liste .= $value."\n" ;
|
180 |
$liste .= $ligne_liste_mail[INS_CHAMPS_MAIL]."\n" ;
|
174 |
}
|
181 |
}
|
Line 175... |
Line 182... |
175 |
|
182 |
|
176 |
$_POST['corps'] .= "\n----------------------------------------------------------------------------";
|
183 |
$_POST['corps'] .= "\n----------------------------------------------------------------------------";
|
177 |
$_POST['corps'] .= "\n".ANN_MESSAGE_ENVOYE_A." :\n $liste" ;
|
184 |
$_POST['corps'] .= "\n".ANN_MESSAGE_ENVOYE_A." :\n $liste" ;
|
178 |
|
185 |
|
179 |
mail (CAR_MAIL_ADMIN, stripslashes($_POST['titre_mail']), $_POST['corps'], $entete);
|
186 |
mail (INS_MAIL_ADMIN_APRES_INSCRIPTION, stripslashes($_POST['titre_mail']), $_POST['corps'], $entete);
|
Line 180... |
Line 187... |
180 |
$_POST['corps'] = '';
|
187 |
$_POST['corps'] = '';
|
181 |
$_POST['titre_mail'] = '';
|
188 |
$_POST['titre_mail'] = '';
|
182 |
return '<div>'.ANN_MAIL_ENVOYER.'</div>' ;
|
189 |
return '<div>'.ANN_MAIL_ENVOYER.'</div>' ;
|
- |
|
190 |
}
|
- |
|
191 |
|
- |
|
192 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
183 |
}
|
193 |
*
|
184 |
|
194 |
* $Log: not supported by cvs2svn $
|
185 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
195 |
* Revision 1.1 2005/09/22 14:02:49 ddelon
|
186 |
*
|
196 |
* nettoyage annuaire et php5
|
187 |
* $Log: not supported by cvs2svn $
|
197 |
*
|