| Line 8... |
Line 8... |
| 8 |
// | Les fonctions de annuaire_moteur.php |
|
8 |
// | Les fonctions de annuaire_moteur.php |
|
| 9 |
// +--------------------------------------------------------------------------------+
|
9 |
// +--------------------------------------------------------------------------------+
|
| 10 |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
|
10 |
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
|
| 11 |
// +--------------------------------------------------------------------------------+
|
11 |
// +--------------------------------------------------------------------------------+
|
| 12 |
//
|
12 |
//
|
| 13 |
// $Id: annuaire_backoffice.fonct.php,v 1.7 2006-12-01 16:02:16 florian Exp $
|
13 |
// $Id: annuaire_backoffice.fonct.php,v 1.8 2007-01-04 16:33:09 alexandre_tb Exp $
|
| Line 14... |
Line 14... |
| 14 |
|
14 |
|
| 15 |
|
15 |
|
| 16 |
/** function mkengine ()
|
16 |
/** function mkengine ()
|
| Line 20... |
Line 20... |
| 20 |
* @return
|
20 |
* @return
|
| 21 |
*/
|
21 |
*/
|
| Line 22... |
Line 22... |
| 22 |
|
22 |
|
| 23 |
include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php' ;
|
23 |
include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php' ;
|
| - |
|
24 |
include_once PAP_CHEMIN_API_PEAR.'HTML/Table.php';
|
| Line 24... |
Line 25... |
| 24 |
include_once PAP_CHEMIN_API_PEAR.'HTML/Table.php';
|
25 |
include_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php';
|
| 25 |
|
26 |
|
| 26 |
function mkengine()
|
27 |
function mkengine()
|
| 27 |
{
|
28 |
{
|
| Line 72... |
Line 73... |
| 72 |
}
|
73 |
}
|
| Line 73... |
Line 74... |
| 73 |
|
74 |
|
| 74 |
$ret = '';
|
75 |
$ret = '';
|
| 75 |
$ret .= '<h1>'.AM_L_TITRE.'</h1>'."\n" ;
|
76 |
$ret .= '<h1>'.AM_L_TITRE.'</h1>'."\n" ;
|
| - |
|
77 |
// construction du moteur de str
|
| Line -... |
Line 78... |
| - |
|
78 |
$ret .= '<div>';
|
| - |
|
79 |
|
| - |
|
80 |
// Le formulaire de recherche avec QuickForm
|
| - |
|
81 |
$formulaire = new HTML_QuickForm('formulaire_recherche', 'post', str_replace('&', '&', $GLOBALS['ins_url']->getURL()));
|
| - |
|
82 |
|
| 76 |
// construction du moteur de str
|
83 |
$formulaire->addElement('text', 'recherche', AM_L_RECHERCHER);
|
| 77 |
|
84 |
|
| Line 78... |
Line -... |
| 78 |
$ret .= '<form action="'.$GLOBALS['ins_url']->getURL().'" method="post">'."\n";
|
- |
|
| 79 |
$ret .= '<table summary="recherche">'."\n";
|
- |
|
| 80 |
|
- |
|
| 81 |
// ligne de recherche
|
- |
|
| 82 |
$ret .= "<tr>\n";
|
85 |
$requete = 'select GC_ID, GC_NAME from gen_COUNTRY where GC_LOCALE="fr"';
|
| Line 83... |
Line -... |
| 83 |
$ret .= "<td>".AM_L_RECHERCHER." :\n</td>\n<td>";
|
- |
|
| 84 |
$ret .= form_mk_chaineI(isset ($_REQUEST['recherche']) ? stripslashes($_REQUEST['recherche']) : '', "recherche")." ";
|
86 |
$pays = &$GLOBALS['ins_db']->getAssoc ($requete);
|
| 85 |
$ret .= '</td><td colspan="4">'.AM_L_PAYS." : \n" ;
|
- |
|
| 86 |
|
87 |
|
| - |
|
88 |
$pays = array_merge (array('tous' => 'Tous les pays'), $pays);
|
| 87 |
// formulaire contenant les pays, avec par défaut soit le pays en cours
|
89 |
|
| 88 |
// soit "tous les pays"
|
- |
|
| 89 |
$liste_pays = new ListeDePays($GLOBALS['ins_db']) ;
|
90 |
if (DB::isError($pays)) {
|
| 90 |
$tableau_pays = $liste_pays->getListePays(INS_LANGUE_DEFAUT) ;
|
91 |
return $pays->getMessage().'<br />'.$pays->getDebugInfo();
|
| 91 |
|
92 |
}
|
| 92 |
$ret .= "<select name=\"pays\">\n" ;
|
- |
|
| 93 |
$ret .= "<option value=\"tous\">Tous les pays</option>\n" ;
|
93 |
|
| 94 |
foreach ($tableau_pays as $codeIso => $labelPays) {
|
- |
|
| 95 |
$ret .= '<option value="'.$codeIso.'"' ;
|
94 |
$select = new HTML_QuickForm_select ('pays', AM_L_PAYS, $pays, array ('class' => 'projet_asso')) ;
|
| 96 |
if (!empty($pays)) {
|
- |
|
| 97 |
if ($pays == $codeIso) $ret .= " selected" ;
|
- |
|
| 98 |
}
|
- |
|
| 99 |
$ret .= '>'.$labelPays.'</option>'."\n" ;
|
95 |
$formulaire->addElement($select) ;
|
| 100 |
}
|
- |
|
| 101 |
$ret .= "</select>\n" ;
|
96 |
$formulaire->addElement('text', 'nom', AM_L_NOM);
|
| 102 |
$ret .= "</td></tr>\n" ;
|
97 |
$formulaire->addElement('text', 'prenom', AM_L_PRENOM);
|
| 103 |
|
98 |
$formulaire->addElement('text', 'ville', AM_L_VILLE);
|
| - |
|
99 |
|
| 104 |
$ret .= "<tr>\n";
|
100 |
if (defined('INS_CHAMPS_NOM_DEPARTEMENT')) {
|
| 105 |
$ret .= "<td>".AM_L_NOM." :\n</td><td>";
|
101 |
$departement = & $GLOBALS['ins_db']->getAssoc('select GFD_ID, CONCAT(GFD_ID,\' - \',GFD_NAME) as GFD_NAME from gen_FRENCH_DPT');
|
| - |
|
102 |
$departement = array_merge (array ('tous' => 'Tous'), $departement);
|
| 106 |
$ret .= form_mk_chaineI(isset ($_REQUEST['nom']) ? stripslashes($_REQUEST['nom']) : '', "nom")." </td>\n<td>" ;
|
103 |
|
| 107 |
$ret .= AM_L_PRENOM." :</td>\n<td>".form_mk_chaineI(isset ($_REQUEST['prenom']) ? stripslashes($_REQUEST['prenom']) : '', "prenom")." </td>\n<td class=\"insLabel\">" ;
|
104 |
$select_dpt = new HTML_QuickForm_select ('departement', AM_L_DEPARTEMENT, $departement, array ('class' => 'projet_asso')) ;
|
| 108 |
$ret .= AM_L_VILLE." :</td>\n<td>".form_mk_chaineI(isset ($_REQUEST['ville']) ? stripslashes($_REQUEST['ville']) : '', "ville")." </td>" ;
|
105 |
$formulaire->addElement($select_dpt);
|
| 109 |
$ret .= "</tr><tr>\n" ;
|
- |
|
| 110 |
$ret .= "<td>".AM_L_DEPARTEMENT." : </td>\n<td>" ;
|
106 |
}
|
| 111 |
|
- |
|
| 112 |
// Construction du <select> des départements
|
107 |
$formulaire->addElement('text', 'mail', AM_L_MAIL);
|
| 113 |
if (defined('INS_CHAMPS_NOM_DEPARTEMENT')) {
|
108 |
|
| 114 |
$requete_dpt = 'select '.INS_CHAMPS_ID_DEPARTEMENT.', '.INS_CHAMPS_NOM_DEPARTEMENT.' from '.INS_TABLE_DPT ;
|
- |
|
| 115 |
$resultat_dpt = $GLOBALS['ins_db']->query($requete_dpt) ;
|
109 |
$grp = array(20 => 20, 50 => 50, 100 => 100) ;
|
| 116 |
if (DB::isError($resultat_dpt)) {
|
110 |
$select_grp = new HTML_QuickForm_select ('T_REPONSE', '', $grp, array ('class' => 'projet_asso')) ;
|
| 117 |
echo 'Echec de la requete<br />'.$requete_dpt.'<br />'.$resultat_dpt->getMessage();
|
- |
|
| 118 |
}
|
111 |
$formulaire->addElement($select_grp);
|
| 119 |
$ret .= "<select name=\"dept\">\n" ;
|
- |
|
| 120 |
$ret .= "<option value=\"tous\">tous</option>\n" ;
|
- |
|
| 121 |
while ($ligne_dpt = $resultat_dpt->fetchRow(DB_FETCHMODE_ASSOC)) {
|
112 |
$formulaire->addElement('submit', 'bouton', AM_L_RECHERCHER);
|
| 122 |
$ret .= '<option value="'.$ligne_dpt[INS_CHAMPS_ID_DEPARTEMENT].'"' ;
|
- |
|
| 123 |
if (isset ($_REQUEST['dept']) && $_REQUEST['dept'] == $ligne_dpt[INS_CHAMPS_ID_DEPARTEMENT]) $ret .= " selected" ;
|
113 |
foreach ($mes_vars as $key=>$value) {
|
| 124 |
$ret .= '>'.$ligne_dpt[INS_CHAMPS_ID_DEPARTEMENT].' - '.$ligne_dpt[INS_CHAMPS_NOM_DEPARTEMENT].'</option>'."\n" ;
|
- |
|
| 125 |
}
|
114 |
if (isset($_POST[$value])) {
|
| 126 |
$ret .= "</select></td>\n" ;
|
115 |
$default[$value] = $_POST[$value] ;
|
| 127 |
}
|
116 |
}
|
| Line 128... |
Line -... |
| 128 |
$ret .= '<td>'.AM_L_MAIL.' : </td><td colspan="3">'.form_mk_chaineI(isset ($_REQUEST['mail']) ? stripslashes($_REQUEST['mail']) : '', "mail")."</td>\n" ;
|
- |
|
| 129 |
$ret .= "</tr>" ;
|
- |
|
| 130 |
|
- |
|
| 131 |
// Les statuts des inscrits
|
- |
|
| 132 |
|
- |
|
| 133 |
$ret .= "<tr>\n";
|
- |
|
| 134 |
$ret .= "<td>\n";
|
- |
|
| 135 |
$ret .= AM_L_GRP_RES." : </td>" ;
|
- |
|
| 136 |
$ret .= '<td>'.$pager->getperpageselectbox (50 , 200, 50 , false ,'%d').'</td>'."\n" ;
|
- |
|
| Line 137... |
Line 117... |
| 137 |
$ret .= '<td colspan="4">'."\n";
|
117 |
}
|
| 138 |
$ret .= "<input type=\"submit\" value=\"".AM_L_RECHERCHER."\" name =\"bouton\">\n";
|
118 |
$formulaire->setDefaults($_POST);
|
| 139 |
$ret .= "</td></tr></table></form>\n";
|
119 |
|
| 140 |
|
120 |
$ret .= '<br />'.$formulaire->toHTML();
|
| Line 232... |
Line 212... |
| 232 |
.'">'.AM_L_MAIL_SELECTION."</a></div>\n" ;
|
212 |
.'">'.AM_L_MAIL_SELECTION."</a></div>\n" ;
|
| Line 233... |
Line 213... |
| 233 |
|
213 |
|
| 234 |
return $ret;
|
214 |
return $ret;
|
| Line 235... |
Line -... |
| 235 |
}
|
- |
|
| 236 |
|
- |
|
| 237 |
/** function form_mk_chaineI () Renvoie une balise de type <input>
|
- |
|
| 238 |
*
|
- |
|
| 239 |
* @param string l'attribut value de la balise
|
- |
|
| 240 |
* @param string l'attibut name de la balise
|
- |
|
| 241 |
* @param string la classe CSS
|
- |
|
| 242 |
* @return string HTML
|
- |
|
| 243 |
*/
|
- |
|
| 244 |
function form_mk_chaineI($value="", $name, $class="insInputForm")
|
- |
|
| 245 |
{
|
- |
|
| 246 |
return "<input type=\"text\" size=\"15\" value=\"$value\" name=\"$name\" class=\"$class\">";
|
- |
|
| 247 |
}
|
- |
|
| 248 |
|
- |
|
| 249 |
function form_mk_select($value="", $name="", $class="insInputForm") {
|
- |
|
| 250 |
$res = "<select name=\"$name\" class=\"$class\">\n" ;
|
- |
|
| 251 |
$res .= "<option value=\"1\"" ;
|
- |
|
| 252 |
if ($value == 1) $res .= " selected" ;
|
- |
|
| 253 |
$res .= ">Cotisants</option>\n" ;
|
- |
|
| 254 |
$res .= "<option value=\"2\"" ;
|
- |
|
| 255 |
if ($value == 2) $res .= " selected" ;
|
- |
|
| 256 |
$res .= ">Non cotisants</option>\n" ;
|
- |
|
| 257 |
$res .= "<option value=\"3\"" ;
|
- |
|
| 258 |
if ($value == 3 || $value == "") $res .= " selected" ;
|
- |
|
| 259 |
$res .= ">Tous</option>\n" ;
|
- |
|
| 260 |
$res .= "</select>\n" ;
|
- |
|
| Line 261... |
Line 215... |
| 261 |
return $res ;
|
215 |
}
|
| 262 |
}
|
216 |
|
| Line 263... |
Line 217... |
| 263 |
|
217 |
|
| Line 387... |
Line 341... |
| 387 |
return mkengine();
|
341 |
return mkengine();
|
| 388 |
}
|
342 |
}
|
| 389 |
}
|
343 |
}
|
| 390 |
return $formulaire->toHTML();
|
344 |
return $formulaire->toHTML();
|
| 391 |
}
|
345 |
}
|
| 392 |
?>
|
346 |
?>
|
| 393 |
|
347 |
|