Subversion Repositories Applications.papyrus

Rev

Rev 810 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 810 Rev 1186
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.4 2006-04-10 14:01:36 florian Exp $
22
// CVS : $Id: annuaire.fonct.php,v 1.5 2007-01-04 16:34:31 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.4 $
34
*@version       $Revision: 1.5 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 95... Line 95...
95
									' : </td>'."\n".
95
									' : </td>'."\n".
96
                                    '<td style="padding:5px;text-align:left;">{element}</td>'."\n".
96
                                    '<td style="padding:5px;text-align:left;">{element}</td>'."\n".
97
                                    '</tr>'."\n" );
97
                                    '</tr>'."\n" );
98
    $squelette->setElementTemplate( '<tr>'."\n".'<td colspan=2 style="padding:5px;">{label}{element}</td>'."\n".'</tr>'."\n", 'bouton_rechercher');
98
    $squelette->setElementTemplate( '<tr>'."\n".'<td colspan=2 style="padding:5px;">{label}{element}</td>'."\n".'</tr>'."\n", 'bouton_rechercher');
Line 99... Line 99...
99
    
99
    
100
    $option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
-
 
101
                        '1' => INS_PERSONNES,
100
    // La liste deroulante pour choisir entre structure et individus
102
                        '2' => INS_STRUCTURES);
-
 
Line -... Line 101...
-
 
101
    // uniquement si la constante INS_FORMULAIRE_STRUCTURE vaut 1
-
 
102
    
-
 
103
    if (INS_FORMULAIRE_STRUCTURE == 1) {
-
 
104
	    $option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
-
 
105
	                        '1' => INS_PERSONNES,
-
 
106
	                        '2' => INS_STRUCTURES);
103
    $form->addElement('select', 'nom_type', INS_JE_RECHERCHE, $option_type);
107
	    $form->addElement('select', 'nom_type', INS_JE_RECHERCHE, $option_type);
104
    
108
    }
105
    //requete pour recuperer la liste des pays
109
    //requete pour recuperer la liste des pays
106
    $requete = 'SELECT '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' FROM '.INS_TABLE_PAYS.' WHERE '.INS_CHAMPS_I18N_PAYS.'="fr-FR"';
110
    $requete = 'SELECT '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' FROM '.INS_TABLE_PAYS.' WHERE '.INS_CHAMPS_I18N_PAYS.'="fr-FR"';
107
	$resultat = $GLOBALS['ins_db']->query($requete) ;
111
	$resultat = $GLOBALS['ins_db']->query($requete) ;
Line 135... Line 139...
135
	$form->setDefaults($defauts);
139
	$form->setDefaults($defauts);
Line 136... Line 140...
136
	
140
	
137
	//affichage du formulaire
141
	//affichage du formulaire
Line -... Line 142...
-
 
142
	$res .=$form->toHtml();
-
 
143
	
-
 
144
	include_once INS_CHEMIN_APPLI.'/bibliotheque/bottin.class.php';
-
 
145
	// On ajoute la liste des lettres cliquables
-
 
146
	$lettre = new lettresAlphabet($GLOBALS['ins_url']) ;
138
	$res .=$form->toHtml();
147
	$res .= $lettre->toHMTL();
139
	
148
	
140
	//on teste si l'on affiche le resultat de la recherche ou 
149
	//on teste si l'on affiche le resultat de la recherche ou 
141
	if (isset($_POST['nom_type'])) {
150
	if (isset($_POST['nom_type'])) {
142
		$requete = 'SELECT '.INS_CHAMPS_ID.', '.INS_CHAMPS_NOM.', '.INS_CHAMPS_PRENOM.', '.INS_CHAMPS_VILLE.', '.INS_CHAMPS_CODE_POSTAL;
151
		$requete = 'SELECT '.INS_CHAMPS_ID.', '.INS_CHAMPS_NOM.', '.INS_CHAMPS_PRENOM.', '.INS_CHAMPS_VILLE.', '.INS_CHAMPS_CODE_POSTAL;
Line 174... Line 183...
174
			$requete .= '('.INS_CHAMPS_NOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
183
			$requete .= '('.INS_CHAMPS_NOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
175
						' OR '.INS_CHAMPS_PRENOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
184
						' OR '.INS_CHAMPS_PRENOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
176
						' OR '.INS_CHAMPS_SIGLE_STRUCTURE.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
185
						' OR '.INS_CHAMPS_SIGLE_STRUCTURE.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
177
						' OR '.INS_CHAMPS_DESCRIPTION.' LIKE "%'.$_POST['nom_annuaire'].'%") ';
186
						' OR '.INS_CHAMPS_DESCRIPTION.' LIKE "%'.$_POST['nom_annuaire'].'%") ';
178
		}
187
		}
-
 
188
		if (isset($_GET['lettre'])) {
-
 
189
			$requete .= 'AND '.INS_CHAMPS_NOM.'like "'.$_GET['lettre'].'%"';
-
 
190
		}
179
		if (!$req_where) $requete .= '1';
191
		if (!$req_where) $requete .= '1';
180
		$requete .=' ORDER BY '.INS_CHAMPS_NOM;
192
		$requete .=' ORDER BY '.INS_CHAMPS_NOM;
181
		$resultat = $GLOBALS['ins_db']->query($requete);
193
		$resultat = $GLOBALS['ins_db']->query($requete);
182
		if ($resultat->numRows()>0) {
194
		if ($resultat->numRows()>0) {
183
			$res .='<h2>'.INS_RESULTATS_RECHERCHE.' ('.$resultat->numRows().' '.INS_ENTREES.')</h2>'."\n";
195
			$res .='<h2>'.INS_RESULTATS_RECHERCHE.' ('.$resultat->numRows().' '.INS_ENTREES.')</h2>'."\n";
Line 291... Line 303...
291
}
303
}
Line 292... Line 304...
292
 
304
 
293
/* +--Fin du code ----------------------------------------------------------------------------------------+
305
/* +--Fin du code ----------------------------------------------------------------------------------------+
294
*
306
*
-
 
307
* $Log: not supported by cvs2svn $
-
 
308
* Revision 1.4  2006/04/10 14:01:36  florian
-
 
309
* uniformisation de l'appli bottin: plus qu'un fichier de fonctions
295
* $Log: not supported by cvs2svn $
310
*
296
* Revision 1.3  2006/04/04 12:23:05  florian
311
* Revision 1.3  2006/04/04 12:23:05  florian
297
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
312
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
298
*
313
*
299
* Revision 1.2  2005/09/29 16:13:54  alexandre_tb
314
* Revision 1.2  2005/09/29 16:13:54  alexandre_tb