Subversion Repositories Applications.bazar

Rev

Rev 220 | Rev 222 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 220 Rev 221
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
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: bazar.fonct.rss.php,v 1.74 2007-03-28 15:54:32 florian Exp $
22
// CVS : $Id: bazar.fonct.rss.php,v 1.75 2007-04-04 08:51:01 florian Exp $
23
/**
23
/**
24
* 
24
* 
25
*@package bazar
25
*@package bazar
26
//Auteur original :
26
//Auteur original :
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
29
//Autres auteurs :
29
//Autres auteurs :
30
*@copyright     Tela-Botanica 2000-2006
30
*@copyright     Tela-Botanica 2000-2006
31
*@version       $Revision: 1.74 $
31
*@version       $Revision: 1.75 $
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
*/
33
*/
34
 
34
 
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
// |                                            ENTETE du PROGRAMME                                       |
36
// |                                            ENTETE du PROGRAMME                                       |
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
 
38
 
39
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.class.php';
39
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.class.php';
40
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.php';
40
require_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.php';
41
 
41
 
42
 
42
 
43
/** baz_valeur_template() - Renvoi des valeurs inscrite dans le fichier de template
43
/** baz_valeur_template() - Renvoi des valeurs inscrite dans le fichier de template
44
*
44
*
45
* @param   string valeur du template de bazar_nature
45
* @param   string valeur du template de bazar_nature
46
*
46
*
47
* @return   mixed  tableau contenant les champs du fichier template
47
* @return   mixed  tableau contenant les champs du fichier template
48
*/
48
*/
49
function baz_valeurs_template($valeur_template) {
49
function baz_valeurs_template($valeur_template) {
50
	//Parcours du fichier de templates, pour mettre les champs specifiques
50
	//Parcours du fichier de templates, pour mettre les champs specifiques
51
	$tableau= array();
51
	$tableau= array();
52
	$nblignes=0;
52
	$nblignes=0;
53
	$chaine = explode ("\n", $valeur_template);
53
	$chaine = explode ("\n", $valeur_template);
54
	array_pop($chaine);
54
	array_pop($chaine);
55
	foreach ($chaine as $ligne)  {
55
	foreach ($chaine as $ligne)  {
56
		$souschaine = explode ("***", $ligne) ;
56
		$souschaine = explode ("***", $ligne) ;
57
		$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
57
		$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
58
		if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
58
		if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
59
		else {$tableau[$nblignes]['nom_bdd'] ='';}
59
		else {$tableau[$nblignes]['nom_bdd'] ='';}
60
		if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
60
		if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
61
		else {$tableau[$nblignes]['label'] ='';}
61
		else {$tableau[$nblignes]['label'] ='';}
62
		if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
62
		if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
63
		else {$tableau[$nblignes]['limite1'] ='';}
63
		else {$tableau[$nblignes]['limite1'] ='';}
64
		if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
64
		if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
65
		else {$tableau[$nblignes]['limite2'] ='';}
65
		else {$tableau[$nblignes]['limite2'] ='';}
66
		if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
66
		if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
67
		else {$tableau[$nblignes]['defaut'] ='';}
67
		else {$tableau[$nblignes]['defaut'] ='';}
68
		if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
68
		if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
69
		else {$tableau[$nblignes]['table_source'] ='';}
69
		else {$tableau[$nblignes]['table_source'] ='';}
70
		if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
70
		if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
71
		else {$tableau[$nblignes]['id_source'] ='';}
71
		else {$tableau[$nblignes]['id_source'] ='';}
72
		if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
72
		if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
73
		else {$tableau[$nblignes]['obligatoire'] ='';}
73
		else {$tableau[$nblignes]['obligatoire'] ='';}
74
		if (isset($souschaine[9])) $tableau[$nblignes]['recherche'] = trim($souschaine[9]);
74
		if (isset($souschaine[9])) $tableau[$nblignes]['recherche'] = trim($souschaine[9]);
75
		else {$tableau[$nblignes]['recherche'] ='';}
75
		else {$tableau[$nblignes]['recherche'] ='';}
76
		
76
		
77
		
77
		
78
		// traitement des cases à cocher, dans ce cas la, on a une table de jointure entre la table
78
		// traitement des cases à cocher, dans ce cas la, on a une table de jointure entre la table
79
		// de liste et la table bazar_fiche (elle porte un nom du genre bazar_ont_***)
79
		// de liste et la table bazar_fiche (elle porte un nom du genre bazar_ont_***)
80
		// dans le template, à la place d'un nom de champs dans 'nom_bdd', on a un nom de table
80
		// dans le template, à la place d'un nom de champs dans 'nom_bdd', on a un nom de table
81
		// et 2 noms de champs séparés par un virgule ex : bazar_ont_theme,bot_id_theme,bot_id_fiche
81
		// et 2 noms de champs séparés par un virgule ex : bazar_ont_theme,bot_id_theme,bot_id_fiche
82
		
82
		
83
		if (isset($tableau[$nblignes]['nom_bdd']) && preg_match('/,/', $tableau[$nblignes]['nom_bdd'])) {
83
		if (isset($tableau[$nblignes]['nom_bdd']) && preg_match('/,/', $tableau[$nblignes]['nom_bdd'])) {
84
			$tableau_info_jointe = explode (',', $tableau[$nblignes]['nom_bdd']) ;
84
			$tableau_info_jointe = explode (',', $tableau[$nblignes]['nom_bdd']) ;
85
			$tableau[$nblignes]['table_jointe'] = $tableau_info_jointe[0] ;
85
			$tableau[$nblignes]['table_jointe'] = $tableau_info_jointe[0] ;
86
			$tableau[$nblignes]['champs_id_fiche'] = $tableau_info_jointe[1] ;
86
			$tableau[$nblignes]['champs_id_fiche'] = $tableau_info_jointe[1] ;
87
			$tableau[$nblignes]['champs_id_table_jointe'] = $tableau_info_jointe[2] ;		
87
			$tableau[$nblignes]['champs_id_table_jointe'] = $tableau_info_jointe[2] ;		
88
		}
88
		}
89
		$nblignes++;
89
		$nblignes++;
90
	}
90
	}
91
	return $tableau;
91
	return $tableau;
92
}
92
}
93
 
93
 
94
/**  baz_voir_fiches() - Permet de visualiser en detail une liste de fiche  au format XHTML
94
/**  baz_voir_fiches() - Permet de visualiser en detail une liste de fiche  au format XHTML
95
*
95
*
96
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli)
96
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli)
97
* @global integer Tableau d(Identifiant des fiches à afficher
97
* @global integer Tableau d(Identifiant des fiches à afficher
98
*
98
*
99
* @return   string  HTML
99
* @return   string  HTML
100
*/
100
*/
101
function baz_voir_fiches($danslappli, $idfiches=array()) {
101
function baz_voir_fiches($danslappli, $idfiches=array()) {
102
	$res='';
102
	$res='';
103
	foreach($idfiches as $idfiche) {
103
	foreach($idfiches as $idfiche) {
104
			$res.=baz_voir_fiche($danslappli, $idfiche);
104
			$res.=baz_voir_fiche($danslappli, $idfiche);
105
	}
105
	}
106
	return $res;
106
	return $res;
107
}
107
}
108
 
108
 
109
 
109
 
110
/**  baz_voir_fiche() - Permet de visualiser en detail une fiche  au format XHTML
110
/**  baz_voir_fiche() - Permet de visualiser en detail une fiche  au format XHTML
111
*
111
*
112
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de départ de l'appli) si a 1
112
* @global boolean Rajoute des informations internes a l'application (date de modification, lien vers la page de départ de l'appli) si a 1
113
* @global integer Identifiant de la fiche a afficher
113
* @global integer Identifiant de la fiche a afficher
114
*
114
*
115
* @return   string  HTML
115
* @return   string  HTML
116
*/
116
*/
117
function baz_voir_fiche($danslappli, $idfiche='') {
117
function baz_voir_fiche($danslappli, $idfiche='') {
118
	$res='';
118
	$res='';
119
	if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
119
	if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
120
	if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;	
120
	if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;	
121
	$url= $GLOBALS['_BAZAR_']['url'];
121
	$url= $GLOBALS['_BAZAR_']['url'];
122
	$url->addQueryString('action', BAZ_VOIR_FICHE);
122
	$url->addQueryString('action', BAZ_VOIR_FICHE);
123
	$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
123
	$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
124
	$url = preg_replace ('/&amp;/', '&', $url->getURL()) ;
124
	$url = preg_replace ('/&amp;/', '&', $url->getURL()) ;
125
	
125
	
126
	//cas ou la fiche a été validee
126
	//cas ou la fiche a ete validee
127
	if (isset($_GET['publiee'])) {
127
	if (isset($_GET['publiee'])) {
128
		publier_fiche($_GET['publiee']);			
128
		publier_fiche($_GET['publiee']);			
129
	}
129
	}
130
	
130
	
131
	//cas on une structure s'approprie une ressource
131
	//cas on une structure s'approprie une ressource
132
	if (isset($_GET['appropriation'])) {
132
	if (isset($_GET['appropriation'])) {
133
		if ($_GET['appropriation']==1) {
133
		if ($_GET['appropriation']==1) {
134
			$requete = 'INSERT INTO bazar_appropriation VALUES ('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID).')';
134
			$requete = 'INSERT INTO bazar_appropriation VALUES ('.$GLOBALS['_BAZAR_']['id_fiche'].', '.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID).')';
135
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
135
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
136
		}
136
		}
137
		elseif ($_GET['appropriation']==0) {
137
		elseif ($_GET['appropriation']==0) {
138
			$requete = 'DELETE FROM bazar_appropriation WHERE  ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
138
			$requete = 'DELETE FROM bazar_appropriation WHERE  ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
139
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
139
			$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
140
		}
140
		}
141
	}
141
	}
142
		
142
		
143
	//cas ou un commentaire a été entre
143
	//cas ou un commentaire a ete entre
144
	if (isset($_POST['Nom'])) {
144
	if (isset($_POST['Nom'])) {
145
		$requete = 'INSERT INTO bazar_commentaires VALUES ('.
145
		$requete = 'INSERT INTO bazar_commentaires VALUES ('.
146
					baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']).
146
					baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']).
147
					', '.$GLOBALS['_BAZAR_']['id_fiche'].', "'.$_POST['Nom'].'", "'.$_POST['Commentaire'].
147
					', '.$GLOBALS['_BAZAR_']['id_fiche'].', "'.$_POST['Nom'].'", "'.$_POST['Commentaire'].
148
					'", NOW() )';
148
					'", NOW() )';
149
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
149
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
150
	}
150
	}
151
	//cas ou un commentaire va etre supprime
151
	//cas ou un commentaire va etre supprime
152
	elseif (isset($_GET['id_commentaire'])) {
152
	elseif (isset($_GET['id_commentaire'])) {
153
		$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1';
153
		$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1';
154
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
154
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
155
	}
155
	}
156
	else {
156
	else {
157
		if (isset($_GET['action'])) {
157
		if (isset($_GET['action'])) {
158
			if ($_GET['action']==BAZ_VOIR_FICHE) {
158
			if ($_GET['action']==BAZ_VOIR_FICHE) {
159
				//sinon on met a jour le nb de visites pour la fiche, puisque c'est une simple consultation
159
				//sinon on met a jour le nb de visites pour la fiche, puisque c'est une simple consultation
160
				$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
160
				$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
161
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
161
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
162
			}
162
			}
163
		}
163
		}
164
	}
164
	}
165
	$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
165
	$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
166
	
166
	
167
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
167
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
168
	(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
168
	(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete))
169
	    : '';
169
	    : '';
170
	
170
	
171
	$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
171
	$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
172
	if (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce'] = $ligne['bf_ce_nature'];
172
	if (!isset($GLOBALS['_BAZAR_']['typeannonce'])) $GLOBALS['_BAZAR_']['typeannonce'] = $ligne['bf_ce_nature'];
173
	
-
 
-
 
173
	if (!isset($GLOBALS['_BAZAR_']['fiche_valide'])) $GLOBALS['_BAZAR_']['fiche_valide'] = $ligne['bf_statut_fiche'];
174
	//on verifie si l'utilisateur est administrateur
174
	//on verifie si l'utilisateur est administrateur
175
	$est_admin=0;
175
	$est_admin=0;
176
	$requete='SELECT bn_id_nature, bn_template, bn_commentaire FROM bazar_nature WHERE bn_id_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
176
	$requete='SELECT bn_id_nature, bn_template, bn_commentaire, bn_label_class FROM bazar_nature WHERE bn_id_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'];
177
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
177
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
178
	if (DB::isError($resultat)) {
178
	if (DB::isError($resultat)) {
179
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
179
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
180
	}
180
	}
181
	$result = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
181
	$result = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
182
	$id_nature = $result['bn_id_nature'];
182
	$id_nature = $result['bn_id_nature'];
183
	if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $result['bn_template'];
183
	if (!isset($GLOBALS['_BAZAR_']['template'])) $GLOBALS['_BAZAR_']['template'] = $result['bn_template'];
184
	if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $result['bn_commentaire'];
184
	if (!isset($GLOBALS['_BAZAR_']['commentaire'])) $GLOBALS['_BAZAR_']['commentaire'] = $result['bn_commentaire'];
-
 
185
	if (!isset($GLOBALS['_BAZAR_']['class'])) $GLOBALS['_BAZAR_']['class'] = $result['bn_label_class'];
185
	if ($GLOBALS['AUTH']->getAuth()) {
186
	if ($GLOBALS['AUTH']->getAuth()) {
186
		if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='administrateur')
187
		if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='administrateur')
187
		     or(niveau_droit('0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur'))
188
		     or(niveau_droit('0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur'))
188
		{
189
		{
189
		        $est_admin=1;
190
		        $est_admin=1;
190
		}
191
		}
191
	}
192
	}
-
 
193
	//debut de la fiche
-
 
194
	$res .= '<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
192
	//affiche le titre sous forme d'image
195
	//affiche le titre sous forme d'image
193
	if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') {
196
	if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') {
194
		$res .= '<img id="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$result['bn_label_nature'].'" />'.'<br />'."\n";
197
		$res .= '<img class="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$result['bn_label_nature'].'" />'.'<br />'."\n";
195
	}
198
	}
196
	//affiche le texte sinon
199
	//affiche le texte sinon
197
	else {
200
	else {
198
		//$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
201
		$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
199
	}
202
	}
200
	$res .= '<div class="BAZ_cadre_fiche">'."\n";
-
 
201
	
-
 
202
	$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ;
203
	$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ;
203
	//si le template existe, on genere le template
204
	//si le template existe, on genere le template
204
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
205
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
205
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
206
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
206
		$res .=genere_fiche($ligne);
207
		$res .=genere_fiche($ligne);
207
	}
208
	}
208
	//on affiche ligne par ligne sinon
209
	//on affiche ligne par ligne sinon
209
	else {
210
	else {
210
		//cas d'une image personnalisée
211
		//cas d'une image personalisee
211
		if (isset($ligne['bf_url_image'])) {
212
		if (isset($ligne['bf_url_image'])) {
212
			$res .= '<div id="fiche_image">'."\n";
213
			$res .= '<div class="BAZ_fiche_image BAZ_fiche_image_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
213
			$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
214
			$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
214
			$res .= '</div>'."\n";
215
			$res .= '</div>'."\n";
215
		}
216
		}
216
		//cas d'une image par défaut
217
		//cas d'une image par defaut
217
		elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') {
218
		elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') {
218
			$res .= '<div id="fiche_image">'."\n";
219
			$res .= '<div class="BAZ_fiche_image BAZ_fiche_image_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
219
			$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_logo'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n";
220
			$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_logo'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\n";
220
			$res .= '</div>'."\n";
221
			$res .= '</div>'."\n";
221
		}
222
		}
222
		$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n";
223
		$res .= '<h1 class="BAZ_fiche_titre BAZ_fiche_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.$ligne['bf_titre'].'</h1>'."\n";
223
		$res .= '<div id="BAZ_description">'.nl2br($ligne['bf_description']).'</div>'."\n";
224
		$res .= '<div class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'.nl2br($ligne['bf_description']).'</div>'."\n";
224
		$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']);
225
		$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']);
225
		for ($i=0; $i<count($tableau); $i++) {
226
		for ($i=0; $i<count($tableau); $i++) {
226
			if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) {
227
			if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) {
227
				$val=$tableau[$i]['nom_bdd'];
228
				$val=$tableau[$i]['nom_bdd'];
228
				if (!in_array($val, array ('bf_titre', 'bf_description'))) {
229
				if (!in_array($val, array ('bf_titre', 'bf_description'))) {
229
					if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) {
230
					if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) {
230
						$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
231
						$res .= '<div class="BAZ_rubrique  BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'."\n".'<span class="BAZ_label" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
231
						$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n";
232
						$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="'.$tableau[$i]['nom_bdd'].'_description"> '.nl2br($ligne[$val]).'</span>'."\n".'</div>'."\n";
232
					}
233
					}
233
				}
234
				}
234
			}
235
			}
235
			elseif ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
236
			elseif ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
236
				//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id				
237
				//pour les champs renseignes par une liste, on va chercher le label de la liste, plutot que l'id				
237
				$requete = 'SELECT blv_label FROM bazar_fiche_valeur_liste, bazar_liste_valeurs WHERE bfvl_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].
238
				$requete = 'SELECT blv_label FROM bazar_fiche_valeur_liste, bazar_liste_valeurs WHERE bfvl_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].
238
				' AND  bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND bfvl_valeur=blv_valeur AND blv_ce_liste='.$tableau[$i]['nom_bdd'].' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"';
239
				' AND  bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND bfvl_valeur=blv_valeur AND blv_ce_liste='.$tableau[$i]['nom_bdd'].' AND blv_ce_i18n="'.$GLOBALS['_BAZAR_']['langue'].'"';
239
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
240
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
240
				if (DB::isError ($resultat)) {
241
				if (DB::isError ($resultat)) {
241
					die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
242
					die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
242
				}
243
				}
243
				$val='';$nb=0;
244
				$val='';$nb=0;
244
				while ($tab = $resultat->fetchRow()) {
245
				while ($tab = $resultat->fetchRow()) {
245
					if ($nb>0) $val .= ', ';
246
					if ($nb>0) $val .= ', ';
246
					$val .= $tab[0];
247
					$val .= $tab[0];
247
					$nb++;
248
					$nb++;
248
				}				
249
				}				
249
				if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
250
				if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
250
					$res .= '<span class="rubrique" id="rubrique_'.$tableau[$i]['nom_bdd'].'">'.$tableau[$i]['label'].':</span>'."\n";
251
					$res .= '<div class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'."\n".'<span class="BAZ_label" id="rubrique_'.$tableau[$i]['nom_bdd'].'">'.$tableau[$i]['label'].':</span>'."\n";
251
					$res .= '<span class="description" id="description_'.$tableau[$i]['nom_bdd'].'"> '.$val.'</span>'."\n".'<br />'."\n";
252
					$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="description_'.$tableau[$i]['nom_bdd'].'"> '.$val.'</span>'."\n".'</div>'."\n";
252
				}
253
				}
253
			}
254
			}
254
			elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
255
			elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
255
				$val=$tableau[$i]['nom_bdd'];
256
				$val=$tableau[$i]['nom_bdd'];
256
				if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) {
257
				if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) {
257
					if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') {
258
					if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') {
258
						$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
259
						$res .= '<div class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'."\n".'<span class="BAZ_label" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
259
						$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n";
260
						$res .= '<span class="BAZ_texte BAZ_texte_'.$GLOBALS['_BAZAR_']['class'].'" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'</div>'."\n";
260
					}
261
					}
261
				}		
262
				}		
262
			}
263
			}
263
			elseif ( $tableau[$i]['type']=='wikini' ) {
264
			elseif ( $tableau[$i]['type']=='wikini' ) {
264
				$res .= '<div class="lien_wikini"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n";
265
				$res .= '<div class="BAZ_lien_wikini BAZ_lien_wikini_'.$GLOBALS['_BAZAR_']['class'].'"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n";
265
			}
266
			}
266
		}
267
		}
267
	//afficher les liens pour l'annonce
268
	//afficher les liens pour l'annonce
268
	$requete = 'SELECT  bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
269
	$requete = 'SELECT  bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
269
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
270
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
270
	if (DB::isError($resultat)) {
271
	if (DB::isError($resultat)) {
271
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
272
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
272
	}
273
	}
273
	if ($resultat->numRows()>0) {
274
	if ($resultat->numRows()>0) {
274
		$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n";
275
		$res .= '<span class="BAZ_label BAZ_label_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LIEN_INTERNET.':</span>'."\n";
275
		$res .= '<span class="description">'."\n";
276
		$res .= '<span class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
276
		$res .= '<ul>'."\n";
277
		$res .= '<ul class="BAZ_liste BAZ_liste_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
277
		while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
278
		while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
278
			$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n";
279
			$res .= '<li class="BAZ_liste_lien BAZ_liste_lien_'.$GLOBALS['_BAZAR_']['class'].'"><a href="'.$ligne1['bu_url'].'" class="BAZ_lien" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n";
279
		}
280
		}
280
		$res .= '</ul></span>'."\n";
281
		$res .= '</ul></span>'."\n";
281
	}
282
	}
282
	
283
	
283
	//afficher les fichiers pour l'annonce
284
	//afficher les fichiers pour l'annonce
284
	$requete = 'SELECT  bfj_description, bfj_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
285
	$requete = 'SELECT  bfj_description, bfj_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
285
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
286
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
286
	if (DB::isError($resultat)) {
287
	if (DB::isError($resultat)) {
287
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
288
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
288
	}
289
	}
289
	if ($resultat->numRows()>0) {
290
	if ($resultat->numRows()>0) {
290
		$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n";
291
		$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n";
291
		$res .= '<span class="description">'."\n";
292
		$res .= '<span class="BAZ_description BAZ_description_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
292
		$res .= '<ul>'."\n";
293
		$res .= '<ul>'."\n";
293
		while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
294
		while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
294
			$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n";
295
			$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n";
295
		}
296
		}
296
		$res .= '</ul></span>'."\n";
297
		$res .= '</ul></span>'."\n";
297
	}
298
	}
298
	$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
299
	$res .= '<div class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
299
	$res .= '<div class="bulle_corps">'."\n";
300
	$res .= '<div class="BAZ_infos_fiche BAZ_infos_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
300
	
-
 
-
 
301
	$res .= '<span class="BAZ_nb_vues BAZ_nb_vues_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_NB_VUS.$ligne['bf_nb_consultations'].BAZ_FOIS.'</span><br />'."\n";
301
	//affichage du redacteur de la fiche
302
	//affichage du redacteur de la fiche
302
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.
303
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.
303
					' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'];
304
					' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'];
304
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
305
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
305
	if (DB::isError($resultat)) {
306
	if (DB::isError($resultat)) {
306
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
307
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
307
	}
308
	}
308
	while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
309
	while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
309
		$res .= BAZ_FICHE_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n";
310
		$res .= BAZ_FICHE_NUMERO.$GLOBALS['_BAZAR_']['id_fiche'].BAZ_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n";
310
	}
-
 
311
	$res .= BAZ_NB_VUS.'<strong>'.$ligne['bf_nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
-
 
312
	$res .= '</div>'."\n";
-
 
313
	$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
-
 
314
	$res .= '<div id="BAZ_bas_page">';
-
 
315
	}
311
	}
316
	
312
	
317
	//informations complementaires (id fiche, etat publication,... )
313
	//informations complementaires (id fiche, etat publication,... )
318
	if ($danslappli==1) {
314
	if ($danslappli==1) {
319
		if ($ligne['bf_statut_fiche']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1) {
315
		if ($GLOBALS['_BAZAR_']['fiche_valide']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1) {
320
			if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && $ligne['bf_date_fin_validite_fiche'] != '0000-00-00') {
316
			if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && $ligne['bf_date_fin_validite_fiche'] != '0000-00-00') {
321
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.
317
			$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.
322
					' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.
318
					' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.
323
					BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n";
319
					BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n";
324
			}
320
			}
325
		}
321
		}
326
		elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) {
322
		elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $GLOBALS['_BAZAR_']['fiche_valide']!=1) {
327
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON;							
323
			$res .= '<span class="BAZ_rubrique  BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_PUBLIEE.':</span> '.BAZ_NON.'<br />'."\n";
-
 
324
		}
-
 
325
		//affichage des infos et du lien pour la mise a jour de la fiche
-
 
326
		if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) {			
-
 
327
			$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_creation">'.BAZ_DATE_CREATION.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_creation_fiche']))."\n";
-
 
328
			$res .= '<span class="BAZ_rubrique BAZ_rubrique_'.$GLOBALS['_BAZAR_']['class'].'" id="date_mise_a_jour">'.BAZ_DATE_MAJ.'</span> '.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n";
-
 
329
		}
-
 
330
		$res .= '</div>'."\n";
-
 
331
		if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) {	
-
 
332
			$res .='<div class="BAZ_actions_fiche BAZ_actions_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
328
			if ( $est_admin ) {
333
			if ( $est_admin ) {
329
				$res .= '&nbsp;&nbsp;&nbsp;<strong>'.BAZ_VALIDER_PUBLICATION.'&nbsp;:&nbsp;</strong>'."\n";
334
				$res .= '<ul>'."\n";
330
				$lien_publie = &$GLOBALS['_BAZAR_']['url'];
335
				$lien_publie = &$GLOBALS['_BAZAR_']['url'];
331
				$lien_publie->addQueryString('action', BAZ_VOIR_FICHE);
336
				$lien_publie->addQueryString('action', BAZ_VOIR_FICHE);
332
				$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
337
				$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
333
				$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']);
338
				$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']);
-
 
339
				if ($GLOBALS['_BAZAR_']['fiche_valide']==0||$GLOBALS['_BAZAR_']['fiche_valide']==2) {
334
				$lien_publie->addQueryString('publiee', 1);
340
					$lien_publie->addQueryString('publiee', 1);
335
				$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a>&nbsp;/&nbsp;';
341
					$label_publie=BAZ_VALIDER_LA_FICHE;
336
				$lien_publie->removeQueryString('publiee');
342
					$class_publie='_valider';
-
 
343
				} elseif ($GLOBALS['_BAZAR_']['fiche_valide']==1) {
337
				$lien_publie->addQueryString('publiee', 0);
344
					$lien_publie->addQueryString('publiee', 0);
-
 
345
					$label_publie=BAZ_INVALIDER_LA_FICHE;
-
 
346
					$class_publie='_invalider';
-
 
347
				}
338
				$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n";
348
				$res .= '<li class="BAZ_liste'.$class_publie.'"><a href="'.$lien_publie->getURL().'">'.$label_publie.'</a></li>'."\n";				
339
				$lien_publie->removeQueryString('publiee');
349
				$lien_publie->removeQueryString('publiee');
340
			}
350
			}
341
			$res .= '<br />'."\n";
-
 
342
		}
-
 
343
		//affichage des infos pouvant interesser les admins
-
 
344
		if ( $est_admin ) {
-
 
345
			$res .= '<span class="rubrique" id="numero_fiche">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
-
 
346
			$res .= '<span class="rubrique" id="date_creation">'.BAZ_DATE_CREATION.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n";			
-
 
347
		}		
-
 
348
		//affichage des infos et du lien pour la mise a jour de la fiche
-
 
349
		if ( $est_admin || $GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID) ) {			
-
 
350
			$res .= '<span class="rubrique" id="date_mise_a_jour">'.BAZ_DATE_MAJ.' :</span> '.strftime('%d.%m.%Y &agrave; %H:%M',strtotime($ligne['bf_date_maj_fiche']))."\n";
-
 
351
			$lien_modifier=$GLOBALS['_BAZAR_']['url'];
351
			$lien_modifier=$GLOBALS['_BAZAR_']['url'];
352
			$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER);
352
			$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER);
353
			$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
353
			$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
354
			$lien_modifier->addQueryString('typeannonce', $ligne['bf_ce_nature']);
354
			$lien_modifier->addQueryString('typeannonce', $ligne['bf_ce_nature']);
355
			$res .= '&nbsp;&nbsp;&nbsp;<a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n";
355
			$res .= '<li class="BAZ_liste_modifier"><a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a></li>'."\n";
-
 
356
			$lien_supprimer=$GLOBALS['_BAZAR_']['url'];
-
 
357
			$lien_supprimer->addQueryString('action', BAZ_ACTION_SUPPRESSION);
-
 
358
			$lien_supprimer->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
-
 
359
			$lien_supprimer->addQueryString('typeannonce', $ligne['bf_ce_nature']);
-
 
360
			$res .= '<li class="BAZ_liste_supprimer"><a href="'.$lien_supprimer->getURL().'" id="supprimer_fiche">'.BAZ_SUPPRIMER_LA_FICHE.'</a></li>'."\n";
-
 
361
			$res .= '</ul>'."\n";
-
 
362
			$res .= '</div>'."\n";
356
		}
363
		}
357
	}
364
	}
-
 
365
	
358
	$res .= '</div>'."\n";
366
	$res .= '</div>'."\n";
-
 
367
	}
359
	$res .= '</div>'."\n";
368
	$res .= '</div>'."\n";
360
	
369
	
361
	//on ajoute les appropriations, s'il le faut
370
	//on ajoute les appropriations, s'il le faut
362
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) {
371
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) {
363
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
372
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
364
		$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n";		
373
		$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h2>'."\n";		
365
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.' FROM bazar_appropriation,'.BAZ_ANNUAIRE.' WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.BAZ_CHAMPS_ID.' ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
374
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.' FROM bazar_appropriation,'.BAZ_ANNUAIRE.' WHERE ba_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' AND ba_ce_id_structure='.BAZ_CHAMPS_ID.' ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
366
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
375
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
367
		if (DB::isError ($resultat)) {
376
		if (DB::isError ($resultat)) {
368
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
377
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
369
		}
378
		}
370
		$possede_ressource=0;
379
		$possede_ressource=0;
371
		if ($resultat->numRows()>0) {
380
		if ($resultat->numRows()>0) {
372
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
381
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
373
			if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
382
			if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
374
			else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
383
			else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
375
			$res .= '<ul>'."\n";
384
			$res .= '<ul>'."\n";
376
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
385
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
377
				$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&amp;voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n";
386
				$res .= '<li><a href="'.BAZ_URL_ANNUAIRE.'&amp;voir_fiche='.$ligne[BAZ_CHAMPS_ID].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[BAZ_CHAMPS_NOM].'</a></li>'."\n";
378
				if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
387
				if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
379
			}
388
			}
380
			$res .= '</ul><br />'."\n";
389
			$res .= '</ul><br />'."\n";
381
		}
390
		}
382
		else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
391
		else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
383
		$res .='<p class="bulle_corps">'."\n";
392
		$res .='<p class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
384
		$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
393
		$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
385
		$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
394
		$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
386
		$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);			
395
		$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);			
387
		if ($possede_ressource) {
396
		if ($possede_ressource) {
388
			$lien_appropriation->addQueryString('appropriation', 0);
397
			$lien_appropriation->addQueryString('appropriation', 0);
389
			$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n";
398
			$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n";
390
			$lien_appropriation->removeQueryString('appropriation');
399
			$lien_appropriation->removeQueryString('appropriation');
391
		}
400
		}
392
		elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
401
		elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
393
			$lien_appropriation->addQueryString('appropriation', 1);
402
			$lien_appropriation->addQueryString('appropriation', 1);
394
			$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
403
			$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
395
			$lien_appropriation->removeQueryString('appropriation');
404
			$lien_appropriation->removeQueryString('appropriation');
396
		}
405
		}
397
		elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
406
		elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
398
			$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
407
			$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
399
		}
408
		}
400
		elseif (!$GLOBALS['AUTH']->getAuth()) {
409
		elseif (!$GLOBALS['AUTH']->getAuth()) {
401
			$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
410
			$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
402
		}
411
		}
403
		$res .='</p>'."\n";
412
		$res .='</p>'."\n";
404
		$res .= '</div>'."\n";
413
		$res .= '</div>'."\n";
405
	}
414
	}
406
	
415
	
407
	//on ajoute les commentaires, s'il le faut
416
	//on ajoute les commentaires, s'il le faut
408
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) {
417
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) {
409
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
418
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche BAZ_cadre_fiche_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
410
		$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n";
419
		$res .= '<h2 class="BAZ_titre BAZ_titre_'.$GLOBALS['_BAZAR_']['class'].'">'.BAZ_LES_COMMENTAIRES.'</h2>'."\n";
411
		$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
420
		$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
412
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
421
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
413
		if (DB::isError ($resultat)) {
422
		if (DB::isError ($resultat)) {
414
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
423
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
415
		}
424
		}
416
		if ($resultat->numRows()>0) {
425
		if ($resultat->numRows()>0) {
417
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
426
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
418
			if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
427
			if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
419
			else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
428
			else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
420
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
429
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
421
				$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
-
 
422
				$res .= '<div class="bulle_corps">'."\n";
430
				$res .= '<div class="BAZ_bulle_corps BAZ_bulle_corps_'.$GLOBALS['_BAZAR_']['class'].'">'."\n";
423
				//affichage du commentaire
431
				//affichage du commentaire
424
				$res .= $ligne['bc_commentaire'].'<br />'."\n";
432
				$res .= $ligne['bc_commentaire'].'<br />'."\n";
425
				$res .= '</div>'."\n";
-
 
426
				$res .= '<div class="bulle_bas">'."\n";
-
 
427
				$res .= '<div style="font-size:9px;margin-left:10px;">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.$ligne['bc_date'].'</div>'."\n";
433
				$res .= '<div class="BAZ_commentaire_admin">'.BAZ_PAR.' : <strong>'.$ligne['bc_nom'].'</strong>'.BAZ_ECRIT_LE.strftime('%d.%m.%Y %H:%M',strtotime($ligne['bc_date']));
428
				//pour les identifies seulement, administrateurs de la rubrique ou superadmins
434
				//pour les identifies seulement, administrateurs de la rubrique ou superadmins
429
				if ($est_admin==1) {
435
				if ($est_admin==1) {
430
					$url_comment= $GLOBALS['_BAZAR_']['url'];
436
					$url_comment= $GLOBALS['_BAZAR_']['url'];
431
					$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
437
					$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
432
					$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
438
					$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
433
					$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
439
					$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
434
					$res .= '<a href="'.$url_comment->getURL().'" style="font-size:9px;float:right;">'.BAZ_SUPPRIMER.'</a>'."\n";
440
					$res .= '&nbsp;&nbsp;<a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n";
435
				}
441
				}
436
				$res .= '</div>'."\n";
442
				$res .= '</div>'."\n";
-
 
443
				$res .= '</div>'."\n";			
437
			}
444
			}
438
		}
445
		}
439
		else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
446
		else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
440
		
447
		
441
		//formulaire des commentaires
448
		//formulaire des commentaires
442
		$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
449
		$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
443
		$squelette =& $form_commentaire->defaultRenderer();
450
		$squelette =& $form_commentaire->defaultRenderer();
444
		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
451
		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
445
		$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
452
		$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
446
										'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
453
										'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
447
									    '</label><br />'."\n".'{element}<br />'."\n");
454
									    '</label><br />'."\n".'{element}<br />'."\n");
448
		$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
455
		$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
449
		$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
456
		$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
450
		$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
457
		$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
451
		$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
458
		$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
452
		require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
459
		require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
453
		$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
460
		$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
454
		$form_commentaire->addElement($formtexte) ;
461
		$form_commentaire->addElement($formtexte) ;
455
		$option=array('style'=>'border:1px solid #000;');
462
		$option=array('style'=>'border:1px solid #000;');
456
		$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
463
		$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
457
		$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
464
		$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
458
		$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
465
		$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
459
		$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
466
		$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
460
		$res .= $form_commentaire->toHTML();
467
		$res .= $form_commentaire->toHTML();
461
		$res .= '</div>'."\n";
468
		$res .= '</div>'."\n";
462
	}
469
	}
463
	
470
	
464
	// Nettoyage de l'url
471
	// Nettoyage de l'url
465
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
472
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
466
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
473
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
467
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_commentaire');
474
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_commentaire');
468
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
475
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
469
	return $res ;
476
	return $res ;
470
}
477
}
471
 
478
 
472
 
479
 
473
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
480
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
474
*
481
*
475
*   On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
482
*   On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
476
*   et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher 
483
*   et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher 
477
*
484
*
478
*   @param  string   le contenu du flux RSS
485
*   @param  string   le contenu du flux RSS
479
*   @param  boolean  afficher ou non la description
486
*   @param  boolean  afficher ou non la description
480
*   @param  string  choisir le format de date: jmah (12/02/2004 12h34) jmh (12/02 12h34) jma (12/02/2004) jm (12/02) ou rien
487
*   @param  string  choisir le format de date: jmah (12/02/2004 12h34) jmh (12/02 12h34) jma (12/02/2004) jm (12/02) ou rien
481
*
488
*
482
*   @return  string    le code HTML
489
*   @return  string    le code HTML
483
*/
490
*/
484
function RSSversHTML($rss, $voirdesc, $formatdate, $affichenb) {
491
function RSSversHTML($rss, $voirdesc, $formatdate, $affichenb) {
485
	if ($rss!='') {
492
	if ($rss!='') {
486
		$rawitems='';$title='';$url='';$cat='';$date='';
493
		$rawitems='';$title='';$url='';$cat='';$date='';
487
		$res='';
494
		$res='';
488
		if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
495
		if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
489
			$items = explode('<item>', $rawitems[0]);
496
			$items = explode('<item>', $rawitems[0]);
490
			$res.='<ul id="BAZ_liste_fiche">'."\n";
497
			$res.='<ul id="BAZ_liste_fiche">'."\n";
491
			for( $i = 0; $i < count($items)-1; $i++ ) {
498
			for( $i = 0; $i < count($items)-1; $i++ ) {
492
				eregi('<title>(.*)</title>',$items[$i+1], $title );
499
				eregi('<title>(.*)</title>',$items[$i+1], $title );
493
				eregi('<link>(.*)</link>',$items[$i+1], $url );
500
				eregi('<link>(.*)</link>',$items[$i+1], $url );
494
				eregi('<description>(.*)</description>',$items[$i+1], $cat);
501
				eregi('<description>(.*)</description>',$items[$i+1], $cat);
495
				eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
502
				eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
496
				$res.='<li>';
503
				$res.='<li>';
497
				if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
504
				if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
498
				if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
505
				if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
499
				if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
506
				if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
500
				if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
507
				if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
501
				$res.='<a href="'.preg_replace ('/&amp;/', '&', $url[1]).'">'.$title[1].'</a>';
508
				$res.='<a href="'.preg_replace ('/&amp;/', '&', $url[1]).'">'.$title[1].'</a>';
502
				if ($voirdesc) {$res.=$cat[1];}
509
				if ($voirdesc) {$res.=$cat[1];}
503
				// Ajout du bouton supprimer pour les superadministrateur
510
				// Ajout du bouton supprimer pour les superadministrateur
504
				if (($GLOBALS['AUTH']->getAuth() && niveau_droit(0,$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')and($url[1]!='#')) {
511
				if (($GLOBALS['AUTH']->getAuth() && niveau_droit(0,$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')and($url[1]!='#')) {
505
					$mon_url = preg_replace ('/&amp;/', '&', $url[1]) ; 
512
					$mon_url = preg_replace ('/&amp;/', '&', $url[1]) ; 
506
					$url_suppr = new Net_URL(preg_replace ('/&amp;/', '&', $mon_url)) ;
513
					$url_suppr = new Net_URL(preg_replace ('/&amp;/', '&', $mon_url)) ;
507
					$url_suppr->addQueryString('action', BAZ_ACTION_SUPPRESSION) ;
514
					$url_suppr->addQueryString('action', BAZ_ACTION_SUPPRESSION) ;
508
		        	$res .= ' ( <a href="'.$url_suppr->getURL().
515
		        	$res .= ' ( <a href="'.$url_suppr->getURL().
509
							'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.' ?\');">'.
516
							'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.' ?\');">'.
510
							BAZ_SUPPRIMER.'</a> )'."\n" ;
517
							BAZ_SUPPRIMER.'</a> )'."\n" ;
511
					}
518
					}
512
				$res.='</li>'."\n";
519
				$res.='</li>'."\n";
513
			}
520
			}
514
			$res.='</ul>'."\n";
521
			$res.='</ul>'."\n";
515
			if ($affichenb==1) {
522
			if ($affichenb==1) {
516
				//une annonce trouvee, on accorde au singulier
523
				//une annonce trouvee, on accorde au singulier
517
				if (((count($items)-1)==1)and($title!=BAZ_PAS_D_ANNONCES)) {
524
				if (((count($items)-1)==1)and($title!=BAZ_PAS_D_ANNONCES)) {
518
					$res = '<br /><h4>'.BAZ_IL_Y_A.' 1 '.BAZ_FICHE_CORRESPONDANTE.'</h4><br />'."\n".$res;
525
					$res = '<br /><h4>'.BAZ_IL_Y_A.' 1 '.BAZ_FICHE_CORRESPONDANTE.'</h4><br />'."\n".$res;
519
				}
526
				}
520
				//plusieures annonces trouvees, on accorde au pluriel
527
				//plusieures annonces trouvees, on accorde au pluriel
521
				else {
528
				else {
522
					$res = '<br /><h4>'.BAZ_IL_Y_A.(count($items)-1).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n".$res;
529
					$res = '<br /><h4>'.BAZ_IL_Y_A.(count($items)-1).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n".$res;
523
				}
530
				}
524
			}
531
			}
525
			//cas des fiches pas trouvées
532
			//cas des fiches pas trouvées
526
			if (((count($items)-1)==1)and($title[1]==BAZ_PAS_D_ANNONCES)) {
533
			if (((count($items)-1)==1)and($title[1]==BAZ_PAS_D_ANNONCES)) {
527
				$res = '<br /><h4>'.BAZ_PAS_D_ANNONCES.'</h4><br />'."\n";
534
				$res = '<br /><h4>'.BAZ_PAS_D_ANNONCES.'</h4><br />'."\n";
528
			}  
535
			}  
529
		}
536
		}
530
	}
537
	}
531
	else $res = BAZ_PAS_D_ANNONCES;
538
	else $res = BAZ_PAS_D_ANNONCES;
532
	
539
	
533
	// Nettoyage de l'url
540
	// Nettoyage de l'url
534
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
541
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
535
	
542
	
536
	return $res;
543
	return $res;
537
}
544
}
538
 
545
 
539
/** gen_RSS() - generer un fichier de flux RSS par type d'annonce 
546
/** gen_RSS() - generer un fichier de flux RSS par type d'annonce 
540
*
547
*
541
* @param   string Le type de l'annonce (laisser vide pour tout type d'annonce)
548
* @param   string Le type de l'annonce (laisser vide pour tout type d'annonce)
542
* @param   integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
549
* @param   integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
543
* @param   integer L'identifiant de l'emetteur (laisser vide pour tous)
550
* @param   integer L'identifiant de l'emetteur (laisser vide pour tous)
544
* @param   integer L'etat de validation de l'annonce (laisser 1 pour les annonces validees, 0 pour les non-validees)
551
* @param   integer L'etat de validation de l'annonce (laisser 1 pour les annonces validees, 0 pour les non-validees)
545
* @param   string La requete SQL personnalisee
552
* @param   string La requete SQL personnalisee
546
* @param   integer La categorie des fiches bazar
553
* @param   integer La categorie des fiches bazar
547
*
554
*
548
* @return  string Le code du flux RSS
555
* @return  string Le code du flux RSS
549
*/
556
*/
550
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='') {
557
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='') {
551
	// generation de la requete MySQL personnalisee
558
	// generation de la requete MySQL personnalisee
552
	$req_where=0;
559
	$req_where=0;
553
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description,  bn_label_nature, bf_date_creation_fiche '.
560
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description,  bn_label_nature, bf_date_creation_fiche '.
554
				'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
561
				'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
555
	if ($valide!=2) {
562
	if ($valide!=2) {
556
		$requete .= 'bf_statut_fiche='.$valide;
563
		$requete .= 'bf_statut_fiche='.$valide;
557
		$req_where=1;
564
		$req_where=1;
558
	}
565
	}
559
	$nomflux=html_entity_decode(BAZ_DERNIERE_ACTU);
566
	$nomflux=html_entity_decode(BAZ_DERNIERE_ACTU);
560
	if (!is_array ($typeannonce) && $typeannonce!='' and $typeannonce!='toutes') {
567
	if (!is_array ($typeannonce) && $typeannonce!='' and $typeannonce!='toutes') {
561
		if ($req_where==1) {$requete .= ' AND ';}
568
		if ($req_where==1) {$requete .= ' AND ';}
562
		$requete .= 'bf_ce_nature='.$typeannonce.' and bf_ce_nature=bn_id_nature ';;
569
		$requete .= 'bf_ce_nature='.$typeannonce.' and bf_ce_nature=bn_id_nature ';;
563
		$req_where=1;
570
		$req_where=1;
564
		//le nom du flux devient le type d'annonce
571
		//le nom du flux devient le type d'annonce
565
		$requete_nom_flux = 'select bn_label_nature from bazar_nature where bn_id_nature = '.$typeannonce;
572
		$requete_nom_flux = 'select bn_label_nature from bazar_nature where bn_id_nature = '.$typeannonce;
566
		$nomflux = $GLOBALS['_BAZAR_']['db']->getOne($requete_nom_flux) ;
573
		$nomflux = $GLOBALS['_BAZAR_']['db']->getOne($requete_nom_flux) ;
567
	}
574
	}
568
	// Cas où il y plusieurs type d annonce demande
575
	// Cas où il y plusieurs type d annonce demande
569
	if (is_array ($typeannonce)) {
576
	if (is_array ($typeannonce)) {
570
		if ($req_where==1) {$requete .= ' AND ';}
577
		if ($req_where==1) {$requete .= ' AND ';}
571
		$requete .= 'bf_ce_nature IN (' ;
578
		$requete .= 'bf_ce_nature IN (' ;
572
		$chaine = '';
579
		$chaine = '';
573
		foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
580
		foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
574
		$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; 
581
		$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; 
575
		$requete .= ') and bf_ce_nature=bn_id_nature ';
582
		$requete .= ') and bf_ce_nature=bn_id_nature ';
576
	}
583
	}
577
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
584
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
578
	if ($valide!=0) {
585
	if ($valide!=0) {
579
		
586
		
580
		if ($utilisateur->isSuperAdmin()) {
587
		if ($utilisateur->isSuperAdmin()) {
581
			$req_where=1;
588
			$req_where=1;
582
		} else {
589
		} else {
583
			if ($req_where==1) {
590
			if ($req_where==1) {
584
				$requete .= ' AND ';
591
				$requete .= ' AND ';
585
			}
592
			}
586
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
593
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
587
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
594
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
588
		}
595
		}
589
	}
596
	}
590
	else $nomflux .= BAZ_A_MODERER;
597
	else $nomflux .= BAZ_A_MODERER;
591
	if ($emetteur!='' && $emetteur!='tous') {
598
	if ($emetteur!='' && $emetteur!='tous') {
592
		if ($req_where==1) {$requete .= ' AND ';}
599
		if ($req_where==1) {$requete .= ' AND ';}
593
		$requete .= 'bf_ce_utilisateur='.$emetteur;
600
		$requete .= 'bf_ce_utilisateur='.$emetteur;
594
		$req_where=1;
601
		$req_where=1;
595
		//requete pour afficher le nom de la structure
602
		//requete pour afficher le nom de la structure
596
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
603
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
597
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
604
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
598
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
605
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
599
		if (DB::isError($resultat)) {
606
		if (DB::isError($resultat)) {
600
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
607
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
601
		}
608
		}
602
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
609
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
603
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
610
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
604
	}
611
	}
605
	if ($requeteSQL!='') {
612
	if ($requeteSQL!='') {
606
		if ($req_where==1) {$requete .= ' AND ';}
613
		if ($req_where==1) {$requete .= ' AND ';}
607
		$requete .= '('.$requeteSQL.')';
614
		$requete .= '('.$requeteSQL.')';
608
		$req_where=1;
615
		$req_where=1;
609
	}
616
	}
610
	if ($categorie_nature!='') {
617
	if ($categorie_nature!='') {
611
		if ($req_where==1) {$requete .= ' AND ';}
618
		if ($req_where==1) {$requete .= ' AND ';}
612
		$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') and bf_ce_nature=bn_id_nature ';
619
		$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') and bf_ce_nature=bn_id_nature ';
613
		$req_where=1;
620
		$req_where=1;
614
	}
621
	}
615
	
622
	
616
	$requete .= ' ORDER BY   bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
623
	$requete .= ' ORDER BY   bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
617
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
624
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
618
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
625
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
619
	if (DB::isError($resultat)) {
626
	if (DB::isError($resultat)) {
620
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
627
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
621
	}
628
	}
622
	
629
	
623
	include_once PAP_CHEMIN_API_PEAR . 'XML/Util.php' ;
630
	include_once PAP_CHEMIN_API_PEAR . 'XML/Util.php' ;
624
	
631
	
625
	// passage en utf-8 --julien
632
	// passage en utf-8 --julien
626
	// --
633
	// --
627
	
634
	
628
	// setlocale() pour avoir les formats de date valides (w3c) --julien
635
	// setlocale() pour avoir les formats de date valides (w3c) --julien
629
	setlocale(LC_TIME, "C");
636
	setlocale(LC_TIME, "C");
630
	
637
	
631
	$xml = XML_Util::getXMLDeclaration('1.0', 'UTF-8', 'yes') ; 
638
	$xml = XML_Util::getXMLDeclaration('1.0', 'UTF-8', 'yes') ; 
632
	$xml .= "\r\n  ";
639
	$xml .= "\r\n  ";
633
	$xml .= XML_Util::createStartElement ('rss', array('version' => '2.0')) ;
640
	$xml .= XML_Util::createStartElement ('rss', array('version' => '2.0')) ;
634
	$xml .= "\r\n    ";
641
	$xml .= "\r\n    ";
635
	$xml .= XML_Util::createStartElement ('channel');
642
	$xml .= XML_Util::createStartElement ('channel');
636
	$xml .= "\r\n      ";
643
	$xml .= "\r\n      ";
637
	$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode($nomflux)));
644
	$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode($nomflux)));
638
	$xml .= "\r\n      ";
645
	$xml .= "\r\n      ";
639
	$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
646
	$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
640
	$xml .= "\r\n      ";
647
	$xml .= "\r\n      ";
641
	$xml .= XML_Util::createTag ('description', null, BAZ_RSS_DESCRIPTIONSITE);
648
	$xml .= XML_Util::createTag ('description', null, BAZ_RSS_DESCRIPTIONSITE);
642
	$xml .= "\r\n      ";
649
	$xml .= "\r\n      ";
643
	$xml .= XML_Util::createTag ('language', null, 'fr-FR');
650
	$xml .= XML_Util::createTag ('language', null, 'fr-FR');
644
	$xml .= "\r\n      ";
651
	$xml .= "\r\n      ";
645
	$xml .= XML_Util::createTag ('copyright', null, 'Copyright (c) '. date('Y') .' '. BAZ_RSS_NOMSITE);
652
	$xml .= XML_Util::createTag ('copyright', null, 'Copyright (c) '. date('Y') .' '. BAZ_RSS_NOMSITE);
646
	$xml .= "\r\n      ";
653
	$xml .= "\r\n      ";
647
	$xml .= XML_Util::createTag ('lastBuildDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT'));
654
	$xml .= XML_Util::createTag ('lastBuildDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT'));
648
	$xml .= "\r\n      ";
655
	$xml .= "\r\n      ";
649
	$xml .= XML_Util::createTag ('docs', null, 'http://www.stervinou.com/projets/rss/');
656
	$xml .= XML_Util::createTag ('docs', null, 'http://www.stervinou.com/projets/rss/');
650
	$xml .= "\r\n      ";
657
	$xml .= "\r\n      ";
651
	$xml .= XML_Util::createTag ('category', null, BAZ_RSS_CATEGORIE);
658
	$xml .= XML_Util::createTag ('category', null, BAZ_RSS_CATEGORIE);
652
	$xml .= "\r\n      ";
659
	$xml .= "\r\n      ";
653
	$xml .= XML_Util::createTag ('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
660
	$xml .= XML_Util::createTag ('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
654
	$xml .= "\r\n      ";
661
	$xml .= "\r\n      ";
655
	$xml .= XML_Util::createTag ('webMaster', null, BAZ_RSS_WEBMASTER);
662
	$xml .= XML_Util::createTag ('webMaster', null, BAZ_RSS_WEBMASTER);
656
	$xml .= "\r\n      ";
663
	$xml .= "\r\n      ";
657
	$xml .= XML_Util::createTag ('ttl', null, '60');
664
	$xml .= XML_Util::createTag ('ttl', null, '60');
658
	$xml .= "\r\n      ";
665
	$xml .= "\r\n      ";
659
	$xml .= XML_Util::createStartElement ('image');
666
	$xml .= XML_Util::createStartElement ('image');
660
	$xml .= "\r\n        ";
667
	$xml .= "\r\n        ";
661
		$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode(BAZ_RSS_NOMSITE)));
668
		$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode(BAZ_RSS_NOMSITE)));
662
		$xml .= "\r\n        ";
669
		$xml .= "\r\n        ";
663
		$xml .= XML_Util::createTag ('url', null, BAZ_RSS_LOGOSITE);
670
		$xml .= XML_Util::createTag ('url', null, BAZ_RSS_LOGOSITE);
664
		$xml .= "\r\n        ";
671
		$xml .= "\r\n        ";
665
		$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
672
		$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
666
		$xml .= "\r\n      ";
673
		$xml .= "\r\n      ";
667
	$xml .= XML_Util::createEndElement ('image');
674
	$xml .= XML_Util::createEndElement ('image');
668
	if ($resultat->numRows() > 0) {
675
	if ($resultat->numRows() > 0) {
669
		// Creation des items : titre + lien + description + date de publication
676
		// Creation des items : titre + lien + description + date de publication
670
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
677
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
671
			$xml .= "\r\n      ";
678
			$xml .= "\r\n      ";
672
			$xml .= XML_Util::createStartElement ('item');
679
			$xml .= XML_Util::createStartElement ('item');
673
			$xml .= "\r\n        ";
680
			$xml .= "\r\n        ";
674
			$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode(($ligne['bf_titre']))));
681
			$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode(($ligne['bf_titre']))));
675
			$xml .= "\r\n        ";
682
			$xml .= "\r\n        ";
676
			$lien=$GLOBALS['_BAZAR_']['url'];
683
			$lien=$GLOBALS['_BAZAR_']['url'];
677
			$lien->addQueryString('action', BAZ_VOIR_FICHE);
684
			$lien->addQueryString('action', BAZ_VOIR_FICHE);
678
			$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
685
			$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
679
			$xml .= XML_Util::createTag ('link', null, utf8_encode(html_entity_decode($lien->getURL())));
686
			$xml .= XML_Util::createTag ('link', null, utf8_encode(html_entity_decode($lien->getURL())));
680
			$xml .= "\r\n        ";
687
			$xml .= "\r\n        ";
681
			$xml .= XML_Util::createTag ('guid', null, utf8_encode(html_entity_decode($lien->getURL())));
688
			$xml .= XML_Util::createTag ('guid', null, utf8_encode(html_entity_decode($lien->getURL())));
682
			$xml .= "\r\n        ";
689
			$xml .= "\r\n        ";
683
			$xml .= XML_Util::createStartElement ('description');
690
			$xml .= XML_Util::createStartElement ('description');
684
			$xml .= "\r\n          ";
691
			$xml .= "\r\n          ";
685
			if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
692
			if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
686
				$xml .= XML_Util::createCDataSection ( utf8_encode(html_entity_decode(($ligne['bf_description']))));
693
				$xml .= XML_Util::createCDataSection ( utf8_encode(html_entity_decode(($ligne['bf_description']))));
687
			}
694
			}
688
			$xml .= "\r\n        ";
695
			$xml .= "\r\n        ";
689
			$xml .= XML_Util::createEndElement ('description');
696
			$xml .= XML_Util::createEndElement ('description');
690
			$xml .= "\r\n        ";
697
			$xml .= "\r\n        ";
691
			if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && 
698
			if ($ligne['bf_date_debut_validite_fiche'] != '0000-00-00' && 
692
			$ligne['bf_date_debut_validite_fiche']>$ligne['bf_date_creation_fiche']) {
699
			$ligne['bf_date_debut_validite_fiche']>$ligne['bf_date_creation_fiche']) {
693
				$date_pub =  $ligne['bf_date_debut_validite_fiche'];	
700
				$date_pub =  $ligne['bf_date_debut_validite_fiche'];	
694
			} else $date_pub = $ligne['bf_date_creation_fiche'] ;
701
			} else $date_pub = $ligne['bf_date_creation_fiche'] ;
695
			$xml .= XML_Util::createTag ('pubDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
702
			$xml .= XML_Util::createTag ('pubDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
696
			$xml .= "\r\n      ";
703
			$xml .= "\r\n      ";
697
			$xml .= XML_Util::createEndElement ('item');
704
			$xml .= XML_Util::createEndElement ('item');
698
		}
705
		}
699
	}
706
	}
700
	else {//pas d'annonces
707
	else {//pas d'annonces
701
		$xml .= "\r\n      ";
708
		$xml .= "\r\n      ";
702
		$xml .= XML_Util::createStartElement ('item');
709
		$xml .= XML_Util::createStartElement ('item');
703
		$xml .= "\r\n          ";
710
		$xml .= "\r\n          ";
704
		$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode(BAZ_PAS_D_ANNONCES)));
711
		$xml .= XML_Util::createTag ('title', null, utf8_encode(html_entity_decode(BAZ_PAS_D_ANNONCES)));
705
		$xml .= "\r\n          ";
712
		$xml .= "\r\n          ";
706
		$xml .= XML_Util::createTag ('link', null, utf8_encode(html_entity_decode($GLOBALS['_BAZAR_']['url']->getUrl())));
713
		$xml .= XML_Util::createTag ('link', null, utf8_encode(html_entity_decode($GLOBALS['_BAZAR_']['url']->getUrl())));
707
		$xml .= "\r\n          ";
714
		$xml .= "\r\n          ";
708
		$xml .= XML_Util::createTag ('guid', null, utf8_encode(html_entity_decode($GLOBALS['_BAZAR_']['url']->getUrl())));
715
		$xml .= XML_Util::createTag ('guid', null, utf8_encode(html_entity_decode($GLOBALS['_BAZAR_']['url']->getUrl())));
709
		$xml .= "\r\n          ";
716
		$xml .= "\r\n          ";
710
		$xml .= XML_Util::createTag ('description', null, utf8_encode(html_entity_decode(BAZ_PAS_D_ANNONCES)));
717
		$xml .= XML_Util::createTag ('description', null, utf8_encode(html_entity_decode(BAZ_PAS_D_ANNONCES)));
711
		$xml .= "\r\n          ";
718
		$xml .= "\r\n          ";
712
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT',strtotime("01/01/%Y")));
719
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT',strtotime("01/01/%Y")));
713
		$xml .= "\r\n      ";
720
		$xml .= "\r\n      ";
714
		$xml .= XML_Util::createEndElement ('item');
721
		$xml .= XML_Util::createEndElement ('item');
715
	}
722
	}
716
	$xml .= "\r\n    ";
723
	$xml .= "\r\n    ";
717
	$xml .= XML_Util::createEndElement ('channel');
724
	$xml .= XML_Util::createEndElement ('channel');
718
	$xml .= "\r\n  ";
725
	$xml .= "\r\n  ";
719
	$xml .= XML_Util::createEndElement('rss') ;
726
	$xml .= XML_Util::createEndElement('rss') ;
720
 
727
 
721
	// Nettoyage de l'url
728
	// Nettoyage de l'url
722
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
729
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
723
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
730
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
724
	
731
	
725
	return $xml;
732
	return $xml;
726
}
733
}
727
 
734
 
728
 
735
 
729
/** baz_liste() Formate la liste de toutes les annonces actuelles
736
/** baz_liste() Formate la liste de toutes les annonces actuelles
730
*
737
*
731
*   @return  string    le code HTML a afficher
738
*   @return  string    le code HTML a afficher
732
*/
739
*/
733
function baz_liste($typeannonce='toutes') {
740
function baz_liste($typeannonce='toutes') {
734
	//creation du lien pour le formulaire de recherche
741
	//creation du lien pour le formulaire de recherche
735
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
742
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
736
	if (isset($_REQUEST['recherche_avancee'])) $GLOBALS['_BAZAR_']['url']->addQueryString ('recherche_avancee', $_REQUEST['recherche_avancee']);
743
	if (isset($_REQUEST['recherche_avancee'])) $GLOBALS['_BAZAR_']['url']->addQueryString ('recherche_avancee', $_REQUEST['recherche_avancee']);
737
	$lien_formulaire = preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
744
	$lien_formulaire = preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
738
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
745
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
739
	$squelette =& $formtemplate->defaultRenderer();
746
	$squelette =& $formtemplate->defaultRenderer();
740
   	$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
747
   	$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
741
    $squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'.
748
    $squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'.
742
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
749
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
743
    								' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
750
    								' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
744
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
751
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
745
                                    '</td>'."\n".'</tr>'."\n");
752
                                    '</td>'."\n".'</tr>'."\n");
746
 	$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label}&nbsp;{element}</strong>'."\n".
753
 	$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label}&nbsp;{element}</strong>'."\n".
747
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
754
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
748
  	$squelette->setElementTemplate( '<tr><td colspan="2">{label}{element}</td></tr>'."\n", 'rechercher');
755
  	$squelette->setElementTemplate( '<tr><td colspan="2">{label}{element}</td></tr>'."\n", 'rechercher');
749
  	  	
756
  	  	
750
 	$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
757
 	$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
751
	//Traduction de champs requis
758
	//Traduction de champs requis
752
	$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
759
	$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
753
	$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);	
760
	$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);	
754
	
761
	
755
		
762
		
756
	//cas du formulaire de recherche proposant de chercher parmis tous les types d'annonces 
763
	//cas du formulaire de recherche proposant de chercher parmis tous les types d'annonces 
757
	//requete pour obtenir l'id et le label des types d'annonces
764
	//requete pour obtenir l'id et le label des types d'annonces
758
	$requete = 'SELECT bn_id_nature, bn_label_nature '.
765
	$requete = 'SELECT bn_id_nature, bn_label_nature '.
759
	           'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
766
	           'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
760
			   'ORDER BY bn_label_nature ASC';
767
			   'ORDER BY bn_label_nature ASC';
761
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
768
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
762
	if (DB::isError($resultat)) {
769
	if (DB::isError($resultat)) {
763
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
770
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
764
	}
771
	}
765
	//on récupère le nb de types de fiches, pour plus tard
772
	//on recupere le nb de types de fiches, pour plus tard
766
	$nb_type_de_fiches=$resultat->numRows();
773
	$nb_type_de_fiches=$resultat->numRows();
767
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
774
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
768
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
775
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
769
		$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
776
		$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
770
		$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
777
		$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
771
	}
778
	}
772
	if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
779
	if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
773
		$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
780
		$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
774
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
781
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
775
						'onchange' => 'javascript:this.form.submit();');
782
						'onchange' => 'javascript:this.form.submit();');
776
		$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
783
		$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
777
		if (isset($_REQUEST['nature'])) {
784
		if (isset($_REQUEST['nature'])) {
778
			$defauts=array('nature'=>$_REQUEST['nature']);
785
			$defauts=array('nature'=>$_REQUEST['nature']);
779
			$formtemplate->setDefaults($defauts);
786
			$formtemplate->setDefaults($defauts);
780
		}		
787
		}		
781
	}
788
	}
782
	//cas du type d'annonces prédéfini 
789
	//cas du type d'annonces predefini 
783
	else {
790
	else {
784
		if ($nb_type_de_fiches==1) {
791
		if ($nb_type_de_fiches==1) {
785
			$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select);
792
			$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select);
786
			$GLOBALS['_BAZAR_']['id_typeannonce']=key($type_annonce_select);
793
			$GLOBALS['_BAZAR_']['id_typeannonce']=key($type_annonce_select);
787
		}
794
		}
788
		$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
795
		$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
789
	}
796
	}
790
 
797
 
791
	//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche
798
	//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche
792
	// dans le but de construire l'élément de formulaire select avec les noms des émetteurs de fiche	
799
	// dans le but de construire l'element de formulaire select avec les noms des emetteurs de fiche	
793
	if (BAZ_RECHERCHE_PAR_EMETTEUR) {
800
	if (BAZ_RECHERCHE_PAR_EMETTEUR) {
794
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
801
		$requete = 'SELECT DISTINCT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
795
		           'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ;
802
		           'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ;
796
	
803
	
797
		$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and';	
804
		$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and';	
798
	
805
	
799
		$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' ';
806
		$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' ';
800
	    if (!isset($_REQUEST['nature'])) {
807
	    if (!isset($_REQUEST['nature'])) {
801
	    		if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) {
808
	    		if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) {
802
	    			$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" ';
809
	    			$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" ';
803
	    		} 
810
	    		} 
804
		}
811
		}
805
		else {
812
		else {
806
	    		if ($_REQUEST['nature']!='toutes') {
813
	    		if ($_REQUEST['nature']!='toutes') {
807
	    			$requete .= 'AND bf_ce_nature='.$_REQUEST['nature'].' ';
814
	    			$requete .= 'AND bf_ce_nature='.$_REQUEST['nature'].' ';
808
	    		}
815
	    		}
809
	    }
816
	    }
810
	    
817
	    
811
	    $requete .= 'ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
818
	    $requete .= 'ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
812
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
819
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
813
		if (DB::isError($resultat)) {
820
		if (DB::isError($resultat)) {
814
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
821
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
815
		}
822
		}
816
		$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
823
		$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
817
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
824
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
818
			$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
825
			$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
819
		}
826
		}
820
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
827
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
821
		$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
828
		$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
822
	} else {
829
	} else {
823
		$formtemplate->addElement ('hidden', 'personnes', 'tous') ;
830
		$formtemplate->addElement ('hidden', 'personnes', 'tous') ;
824
	}
831
	}
825
	
832
	
826
		//pour les super-administrateurs, on peut voir les annonces non validées
833
		//pour les super-administrateurs, on peut voir les annonces non validees
827
	//on verifie si l'utilisateur est administrateur
834
	//on verifie si l'utilisateur est administrateur
828
	$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
835
	$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
829
 
836
 
830
	if ($utilisateur->isSuperAdmin()) {
837
	if ($utilisateur->isSuperAdmin()) {
831
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
838
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
832
		$valide_select[0] = BAZ_FICHES_PAS_VALIDEES;
839
		$valide_select[0] = BAZ_FICHES_PAS_VALIDEES;
833
		$valide_select[1] = BAZ_FICHES_VALIDEES;
840
		$valide_select[1] = BAZ_FICHES_VALIDEES;
834
		$valide_select[2] = BAZ_LES_DEUX;
841
		$valide_select[2] = BAZ_LES_DEUX;
835
		$formtemplate->addElement ('select', 'valides', BAZ_VALIDE, $valide_select, $option) ; 
842
		$formtemplate->addElement ('select', 'valides', BAZ_VALIDE, $valide_select, $option) ; 
836
		$defauts=array('valides'=>1);
843
		$defauts=array('valides'=>1);
837
		$formtemplate->setDefaults($defauts);
844
		$formtemplate->setDefaults($defauts);
838
	}
845
	}
839
	
846
	
840
	//champs texte pour entrer les mots cles
847
	//champs texte pour entrer les mots cles
841
	$option=array('maxlength'=>60,'style'=>'border:1px solid #000;width:200px;font:12px Myriad, Arial, sans-serif;');
848
	$option=array('maxlength'=>60,'style'=>'border:1px solid #000;width:200px;font:12px Myriad, Arial, sans-serif;');
842
	$formtemplate->addElement('text', 'recherche_mots_cles', BAZ_MOT_CLE, $option) ;
849
	$formtemplate->addElement('text', 'recherche_mots_cles', BAZ_MOT_CLE, $option) ;
843
	
850
	
844
	//option cachee pour savoir si le formulaire a ete appele deja 
851
	//option cachee pour savoir si le formulaire a ete appele deja 
845
	$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ;
852
	$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ;
846
	
853
	
847
	// Ajout des options si un type de fiche a ete choisie
854
	// Ajout des options si un type de fiche a ete choisie
848
	if ( (isset($_REQUEST['nature']) && $_REQUEST['nature'] != 'toutes') || (isset($GLOBALS['_BAZAR_']['categorie_nature']) && $nb_type_de_fiches==1)) {
855
	if ( (isset($_REQUEST['nature']) && $_REQUEST['nature'] != 'toutes') || (isset($GLOBALS['_BAZAR_']['categorie_nature']) && $nb_type_de_fiches==1)) {
849
		if ( BAZ_MOTEUR_RECHERCHE_AVANCEE || ( isset($_REQUEST['recherche_avancee'])&&$_REQUEST['recherche_avancee']==1) ) { 
856
		if ( BAZ_MOTEUR_RECHERCHE_AVANCEE || ( isset($_REQUEST['recherche_avancee'])&&$_REQUEST['recherche_avancee']==1) ) { 
850
			if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') {
857
			if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') {
851
				$champs_requete = '' ;
858
				$champs_requete = '' ;
852
				if (!isset($_REQUEST['nature']) || $_REQUEST['nature'] == '') {
859
				if (!isset($_REQUEST['nature']) || $_REQUEST['nature'] == '') {
853
					$_REQUEST['nature'] = $tableau_typeannonces[0];
860
					$_REQUEST['nature'] = $tableau_typeannonces[0];
854
				}
861
				}
855
			}
862
			}
856
			// Recuperation du template
863
			// Recuperation du template
857
			$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
864
			$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
858
			$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
865
			$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
859
			if (DB::isError($resultat)) {
866
			if (DB::isError($resultat)) {
860
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
867
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
861
			}
868
			}
862
			
869
			
863
			if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
870
			if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
864
				foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
871
				foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
865
				$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '0');
872
				$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '0');
866
				$lien_recherche_de_base = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_DE_BASE.'</a><br />';
873
				$lien_recherche_de_base = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_DE_BASE.'</a><br />';
867
				//lien recherche de base
874
				//lien recherche de base
868
				labelhtml($formtemplate,'',$lien_recherche_de_base,'','','','','');		
875
				labelhtml($formtemplate,'',$lien_recherche_de_base,'','','','','');		
869
			}
876
			}
870
			
877
			
871
			$tableau = baz_valeurs_template($resultat) ;
878
			$tableau = baz_valeurs_template($resultat) ;
872
			for ($i=0; $i<count($tableau); $i++) {
879
			for ($i=0; $i<count($tableau); $i++) {
873
				if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
880
				if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
874
					$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
881
					$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
875
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ;
882
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ;
876
				}
883
				}
877
			}
884
			}
878
			
885
			
879
		}
886
		}
880
		else {
887
		else {
881
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
888
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
882
			$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '1');
889
			$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '1');
883
			$lien_recherche_avancee = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_AVANCEE.'</a><br />';
890
			$lien_recherche_avancee = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_AVANCEE.'</a><br />';
884
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->removeQueryString($cle);
891
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->removeQueryString($cle);
885
		}		 	
892
		}		 	
886
	}
893
	}
887
	
894
	
888
	//lien recherche avancee
895
	//lien recherche avancee
889
	if (isset($lien_recherche_avancee)) {
896
	if (isset($lien_recherche_avancee)) {
890
		labelhtml($formtemplate,'',$lien_recherche_avancee,'','','','','');
897
		labelhtml($formtemplate,'',$lien_recherche_avancee,'','','','','');
891
	}
898
	}
892
	
899
	
893
	//Bouton de validation du formulaire
900
	//Bouton de validation du formulaire
894
	$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;');	
901
	$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;');	
895
	$formtemplate->addElement('submit', 'rechercher', BAZ_RECHERCHER, $option);
902
	$formtemplate->addElement('submit', 'rechercher', BAZ_RECHERCHER, $option);
896
	
903
	
897
	//affichage du formulaire
904
	//affichage du formulaire
898
	//$res.=$formtemplate->toHTML()."\n";
905
	//$res.=$formtemplate->toHTML()."\n";
899
	
906
	
900
 
907
 
901
	// Ajout de la table bazar_fiche_liste_valeur dans le from de la requete
908
	// Ajout de la table bazar_fiche_liste_valeur dans le from de la requete
902
	$case_coche = false ;
909
	$case_coche = false ;
903
	$nb_jointures=0;
910
	$nb_jointures=0;
904
	$requeteFrom = '' ;
911
	$requeteFrom = '' ;
905
	$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature=bf_ce_nature AND ' ;
912
	$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'].' AND bn_id_nature=bf_ce_nature AND ' ;
906
	$requeteWhereListe = '' ;
913
	$requeteWhereListe = '' ;
907
	
914
	
908
 	if ( isset($tableau) ) {
915
 	if ( isset($tableau) ) {
909
	 	for ($i = 0; $i < count ($tableau); $i++) {
916
	 	for ($i = 0; $i < count ($tableau); $i++) {
910
			if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') {
917
			if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') {
911
				$nb_jointures++;
918
				$nb_jointures++;
912
				$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ;			
919
				$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ;			
913
				if (isset($_REQUEST[$nom_liste]) && is_array($_REQUEST[$nom_liste])) {
920
				if (isset($_REQUEST[$nom_liste]) && is_array($_REQUEST[$nom_liste])) {
914
					$case_coche = true;
921
					$case_coche = true;
915
					$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($nb_jointures) ;
922
					$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($nb_jointures) ;
916
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
923
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
917
					$requeteWhere .= ' bfvl'.($nb_jointures).'.bfvl_ce_fiche=bf_id_fiche AND ';
924
					$requeteWhere .= ' bfvl'.($nb_jointures).'.bfvl_ce_fiche=bf_id_fiche AND ';
918
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur IN (' ;
925
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur IN (' ;
919
					$chaine = '';
926
					$chaine = '';
920
					//var_dump($_REQUEST[$nom_liste]);
927
					//var_dump($_REQUEST[$nom_liste]);
921
					foreach ($_REQUEST[$nom_liste] as $cle =>$valeur) {
928
					foreach ($_REQUEST[$nom_liste] as $cle =>$valeur) {
922
						if ($valeur == 1) {						
929
						if ($valeur == 1) {						
923
							$chaine .= '"'.$cle.'",' ;
930
							$chaine .= '"'.$cle.'",' ;
924
						}
931
						}
925
					}	
932
					}	
926
					$requeteWhereListe .= substr ($chaine, 0, strlen ($chaine)-1) ;
933
					$requeteWhereListe .= substr ($chaine, 0, strlen ($chaine)-1) ;
927
					$requeteWhereListe .= ') AND ';									
934
					$requeteWhereListe .= ') AND ';									
928
				} else {
935
				} else {
929
					if (isset ($_REQUEST[$nom_liste]) && $_REQUEST[$nom_liste]!=0) {
936
					if (isset ($_REQUEST[$nom_liste]) && $_REQUEST[$nom_liste]!=0) {
930
						$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($nb_jointures) ;
937
						$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($nb_jointures) ;
931
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
938
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
932
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur='.$_REQUEST[$nom_liste].' AND ';
939
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur='.$_REQUEST[$nom_liste].' AND ';
933
						$requeteWhere .= ' bfvl'.($nb_jointures).'.bfvl_ce_fiche=bf_id_fiche AND ';
940
						$requeteWhere .= ' bfvl'.($nb_jointures).'.bfvl_ce_fiche=bf_id_fiche AND ';
934
						$case_coche = true;
941
						$case_coche = true;
935
					}
942
					}
936
				}
943
				}
937
			}
944
			}
938
		}
945
		}
939
 	}
946
 	}
940
	if ($case_coche) {
947
	if ($case_coche) {
941
		 $requeteWhere .= $requeteWhereListe;
948
		 $requeteWhere .= $requeteWhereListe;
942
	}
949
	}
943
	if (isset($_REQUEST['nature']) && $_REQUEST['nature']!='' && $_REQUEST['nature']!='toutes') {
950
	if (isset($_REQUEST['nature']) && $_REQUEST['nature']!='' && $_REQUEST['nature']!='toutes') {
944
		$requeteWhere = 'bf_ce_nature="'.$_REQUEST['nature'].'" AND '.$requeteWhere;
951
		$requeteWhere = 'bf_ce_nature="'.$_REQUEST['nature'].'" AND '.$requeteWhere;
945
	}
952
	}
946
	
953
	
947
	if (BAZ_UTILISE_TEMPLATE) {
954
	if (BAZ_UTILISE_TEMPLATE) {
948
		// Appel du template n 1
955
		// Appel du template n 1
949
		include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php' ;
956
		include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php' ;
950
	
957
	
951
		$template = new bazarTemplate ($GLOBALS['_BAZAR_']['db']) ;
958
		$template = new bazarTemplate ($GLOBALS['_BAZAR_']['db']) ;
952
		$chaine = $template->getTemplate(1, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['categorie_nature']);
959
		$chaine = $template->getTemplate(1, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['categorie_nature']);
953
		if (bazarTemplate::isError ($chaine)) return $chaine->getMessage() ;
960
		if (bazarTemplate::isError ($chaine)) return $chaine->getMessage() ;
954
		ob_start();
961
		ob_start();
955
		eval ($chaine) ;
962
		eval ($chaine) ;
956
		$res .= ob_get_contents();
963
		$res .= ob_get_contents();
957
		ob_end_clean() ;
964
		ob_end_clean() ;
958
	} else {
965
	} else {
959
    	$res .= $formtemplate->toHTML();
966
    	$res .= $formtemplate->toHTML();
960
    	if (!isset($_REQUEST['recherche_effectuee'])) {
967
    	if (!isset($_REQUEST['recherche_effectuee'])) {
961
        	$res .= '<p class="zone_info">'.BAZ_ENTRER_VOS_CRITERES_DE_RECHERCHE.'</p>'."\n";
968
        	$res .= '<p class="zone_info">'.BAZ_ENTRER_VOS_CRITERES_DE_RECHERCHE.'</p>'."\n";
962
        	$GLOBALS['_BAZAR_']['url']->addQueryString('action',BAZ_VOIR_FLUX_RSS);
969
        	$GLOBALS['_BAZAR_']['url']->addQueryString('action',BAZ_VOIR_FLUX_RSS);
963
        	$GLOBALS['_BAZAR_']['url']->addQueryString('annonce',$GLOBALS['_BAZAR_']['id_typeannonce']);
970
        	$GLOBALS['_BAZAR_']['url']->addQueryString('annonce',$GLOBALS['_BAZAR_']['id_typeannonce']);
964
	        if ($GLOBALS['_BAZAR_']['categorie_nature']!=0) $GLOBALS['_BAZAR_']['url']->addQueryString('categorie_nature',$GLOBALS['_BAZAR_']['categorie_nature']);
971
	        if ($GLOBALS['_BAZAR_']['categorie_nature']!=0) $GLOBALS['_BAZAR_']['url']->addQueryString('categorie_nature',$GLOBALS['_BAZAR_']['categorie_nature']);
965
        	$res .= '{{Syndication titre="Derni&egrave;res actualit&eacute;s" url="'.$GLOBALS['_BAZAR_']['url']->getURL().'" nb=10 nouvellefenetre=0 formatdate="'.BAZ_FORMAT_DATE_DEFAUT.'"}}';
972
        	$res .= '{{Syndication titre="Derni&egrave;res actualit&eacute;s" url="'.$GLOBALS['_BAZAR_']['url']->getURL().'" nb=10 nouvellefenetre=0 formatdate="'.BAZ_FORMAT_DATE_DEFAUT.'"}}';
966
    	}
973
    	}
967
	}
974
	}
968
	
975
	
969
 
976
 
970
	
977
	
971
	//affichage des resultats de la recherche si le formulaire a ete envoye
978
	//affichage des resultats de la recherche si le formulaire a ete envoye
972
	$requeteSQL='';
979
	$requeteSQL='';
973
	if (isset($_REQUEST['recherche_effectuee'])) {
980
	if (isset($_REQUEST['recherche_effectuee'])) {
974
		//preparation de la requete pour trouver les mots cles
981
		//preparation de la requete pour trouver les mots cles
975
		if (($_REQUEST['recherche_mots_cles']!='')and($_REQUEST['recherche_mots_cles']!=BAZ_MOT_CLE)) {
982
		if (($_REQUEST['recherche_mots_cles']!='')and($_REQUEST['recherche_mots_cles']!=BAZ_MOT_CLE)) {
976
			//decoupage des mots cles
983
			//decoupage des mots cles
977
			$recherche = split(' ', $_REQUEST['recherche_mots_cles']) ;
984
			$recherche = split(' ', $_REQUEST['recherche_mots_cles']) ;
978
			$nbmots=count($recherche);
985
			$nbmots=count($recherche);
979
			$requeteSQL=''; 
986
			$requeteSQL=''; 
980
			for ($i=0; $i<$nbmots; $i++) {
987
			for ($i=0; $i<$nbmots; $i++) {
981
				if ($i>0) $requeteSQL.=' OR ';
988
				if ($i>0) $requeteSQL.=' OR ';
982
				$requeteSQL.='bf_titre LIKE "%'.$recherche[$i].'%" OR bf_description LIKE "%'.$recherche[$i].'%" ';
989
				$requeteSQL.='bf_titre LIKE "%'.$recherche[$i].'%" OR bf_description LIKE "%'.$recherche[$i].'%" ';
983
			}
990
			}
984
		}
991
		}
985
		if (!isset($_REQUEST['nature'])) {
992
		if (!isset($_REQUEST['nature'])) {
986
			if (!isset ($GLOBALS['_BAZAR_']['id_nature'])) $typedefiches = $tableau_typeannonces;
993
			if (!isset ($GLOBALS['_BAZAR_']['id_nature'])) $typedefiches = $tableau_typeannonces;
987
			else $typedefiches = $GLOBALS['_BAZAR_']['id_nature'] ; 
994
			else $typedefiches = $GLOBALS['_BAZAR_']['id_nature'] ; 
988
		} else {
995
		} else {
989
			$typedefiches = $_REQUEST['nature'] ;
996
			$typedefiches = $_REQUEST['nature'] ;
990
			if ($typedefiches == 'toutes') $typedefiches = $tableau_typeannonces ;
997
			if ($typedefiches == 'toutes') $typedefiches = $tableau_typeannonces ;
991
		}
998
		}
992
		if ($typeannonce!='toutes') $typedefiches=$typeannonce;
999
		if ($typeannonce!='toutes') $typedefiches=$typeannonce;
993
		if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];}
1000
		if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];}
994
		else {$valides=1;}
1001
		else {$valides=1;}
995
		//generation de la liste de flux a afficher
1002
		//generation de la liste de flux a afficher
996
		if (!isset($_REQUEST['personne'])) $_REQUEST['personne']='tous';
1003
		if (!isset($_REQUEST['personnes'])) $_REQUEST['personnes']='tous';
997
		$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personne'], $valides, $requeteSQL, $requeteFrom, $requeteWhere);		
1004
		$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personnes'], $valides, $requeteSQL, $requeteFrom, $requeteWhere);		
998
	}
1005
	}
999
	
1006
	
1000
	// Nettoyage de l'url
1007
	// Nettoyage de l'url
1001
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1008
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1002
	$GLOBALS['_BAZAR_']['url']->removeQueryString('annonce');
1009
	$GLOBALS['_BAZAR_']['url']->removeQueryString('annonce');
1003
	$GLOBALS['_BAZAR_']['url']->removeQueryString('categorie_nature');
1010
	$GLOBALS['_BAZAR_']['url']->removeQueryString('categorie_nature');
1004
	$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_avancee');
1011
	$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_avancee');
1005
	
1012
	
1006
	return $res;
1013
	return $res;
1007
}
1014
}
1008
 
1015
 
1009
/**
1016
/**
1010
 * Cette fonction renvoie du HTML
1017
 * Cette fonction renvoie du HTML
1011
 */
1018
 */
1012
function baz_liste_pagine_HTML($typeannonce, $nbitem, $emetteur, $valide, $requeteSQL = '', $requeteFrom = '', $requeteWhere = '') {	
1019
function baz_liste_pagine_HTML($typeannonce, $nbitem, $emetteur, $valide, $requeteSQL = '', $requeteFrom = '', $requeteWhere = '') {	
1013
	// generation de la requete MySQL personnalisee
1020
	// generation de la requete MySQL personnalisee
1014
	$req_where=0;
1021
	$req_where=0;
1015
	$requete = 'SELECT * '.
1022
	$requete = 'SELECT * '.
1016
				'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere;
1023
				'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere;
1017
	if ($valide!=2) {
1024
	if ($valide!=2) {
1018
		if ($req_where==1) {$requete .= ' AND ';}
1025
		if ($req_where==1) {$requete .= ' AND ';}
1019
		$req_where=1;
1026
		$req_where=1;
1020
		$requete .= 'bf_statut_fiche='.$valide;		
1027
		$requete .= 'bf_statut_fiche='.$valide;		
1021
	} else {
1028
	} else {
1022
		$requete .= '1 ' ;
1029
		$requete .= '1 ' ;
1023
	}
1030
	}
1024
	
1031
	
1025
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
1032
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
1026
	if ($valide!=0) {
1033
	if ($valide!=0) {
1027
		if ($utilisateur->isSuperAdmin()) {
1034
		if ($utilisateur->isSuperAdmin()) {
1028
			$req_where=1;
1035
			$req_where=1;
1029
		} else {
1036
		} else {
1030
			if ($req_where==1) {$requete .= ' AND ';}
1037
			if ($req_where==1) {$requete .= ' AND ';}
1031
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
1038
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
1032
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
1039
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
1033
			$req_where=1;
1040
			$req_where=1;
1034
		}
1041
		}
1035
	}
1042
	}
1036
	if ($emetteur!='' && $emetteur!='tous') {
1043
	if ($emetteur!='' && $emetteur!='tous') {
1037
		if ($req_where==1) {$requete .= ' AND ';}
1044
		if ($req_where==1) {$requete .= ' AND ';}
1038
		$requete .= 'bf_ce_utilisateur='.$emetteur;
1045
		$requete .= 'bf_ce_utilisateur='.$emetteur;
1039
		$req_where=1;
1046
		$req_where=1;
1040
		//requete pour afficher le nom de la structure
-
 
1041
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
-
 
1042
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
-
 
1043
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
-
 
1044
		if (DB::isError($resultat)) {
-
 
1045
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
-
 
1046
		}
-
 
1047
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
-
 
1048
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
-
 
1049
	}
1047
	}
1050
	if ($requeteSQL!='') {
1048
	if ($requeteSQL!='') {
1051
		if ($req_where==1) {$requete .= ' AND ';}
1049
		if ($req_where==1) {$requete .= ' AND ';}
1052
		$requete .= '('.$requeteSQL.')';
1050
		$requete .= '('.$requeteSQL.')';
1053
		$req_where=1;
1051
		$req_where=1;
1054
	}
1052
	}
1055
	$requete .= ' ORDER BY  bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
1053
	$requete .= ' ORDER BY  bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
1056
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
1054
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
1057
	
-
 
1058
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1055
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1059
	if (DB::isError($resultat)) {
1056
	if (DB::isError($resultat)) {
1060
		return  $resultat->getMessage().'<br /><br />'.$resultat->getDebugInfo() ;
1057
		return  $resultat->getMessage().'<br /><br />'.$resultat->getDebugInfo() ;
1061
	}
1058
	}
1062
	$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n";
1059
	$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n";
-
 
1060
	//$res .= 'requete: '. $requete. '<br />';
1063
	$res .= '<ul>' ;
1061
	$res .= '<ul>' ;
1064
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE);
1062
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE);
1065
	
1063
	
1066
	$donnees = array();
1064
	$donnees = array();
1067
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
1065
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
1068
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne['bf_id_fiche']) ;
1066
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne['bf_id_fiche']) ;
1069
		array_push ($donnees, $ligne);		
1067
		array_push ($donnees, $ligne);		
1070
	}
1068
	}
1071
	// Mise en place du Pager
1069
	// Mise en place du Pager
1072
	include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php';
1070
	include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php';
1073
	$params = array(
1071
	$params = array(
1074
    'mode'       => BAZ_MODE_DIVISION,
1072
    'mode'       => BAZ_MODE_DIVISION,
1075
    'perPage'    => BAZ_NOMBRE_RES_PAR_PAGE,
1073
    'perPage'    => BAZ_NOMBRE_RES_PAR_PAGE,
1076
    'delta'      => BAZ_DELTA,
1074
    'delta'      => BAZ_DELTA,
1077
    'httpMethod' => 'GET',
1075
    'httpMethod' => 'GET',
1078
    'extraVars' => array_merge($_POST, $_GET),
1076
    'extraVars' => array_merge($_POST, $_GET),
1079
    'altNext' => BAZ_SUIVANT,
1077
    'altNext' => BAZ_SUIVANT,
1080
    'altPrev' => BAZ_PRECEDENT,
1078
    'altPrev' => BAZ_PRECEDENT,
1081
    'nextImg' => BAZ_SUIVANT,
1079
    'nextImg' => BAZ_SUIVANT,
1082
    'prevImg' => BAZ_PRECEDENT,
1080
    'prevImg' => BAZ_PRECEDENT,
1083
    'itemData'   => $donnees
1081
    'itemData'   => $donnees
1084
	);
1082
	);
1085
	$pager = & Pager::factory($params);
1083
	$pager = & Pager::factory($params);
1086
	$data  = $pager->getPageData();
1084
	$data  = $pager->getPageData();
1087
	$links = $pager->getLinks();
1085
	$links = $pager->getLinks();
1088
    
1086
    
1089
    if (BAZ_UTILISE_TEMPLATE) {
1087
    if (BAZ_UTILISE_TEMPLATE) {
1090
		//Appel du template n 2
1088
		//Appel du template n 2
1091
		include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php' ;
1089
		include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php' ;
1092
		$template = new bazarTemplate ($GLOBALS['_BAZAR_']['db']) ;
1090
		$template = new bazarTemplate ($GLOBALS['_BAZAR_']['db']) ;
1093
		$chaine = $template->getTemplate(2, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['categorie_nature']);
1091
		$chaine = $template->getTemplate(2, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['categorie_nature']);
1094
		if (bazarTemplate::isError ($chaine)) return $chaine->getMessage() ;
1092
		if (bazarTemplate::isError ($chaine)) return $chaine->getMessage() ;
1095
		ob_start();
1093
		ob_start();
1096
		eval ($chaine) ;
1094
		eval ($chaine) ;
1097
		$res .= ob_get_contents();
1095
		$res .= ob_get_contents();
1098
		ob_end_clean() ;
1096
		ob_end_clean() ;
1099
    } else {
1097
    } else {
1100
    	$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1098
    	$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1101
    	foreach ($data as $valeur) {
1099
    	foreach ($data as $valeur) {
-
 
1100
	        $res .='<li class="BAZ_'.$valeur['bn_label_class'].'">'."\n";
1102
	        $GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $valeur['bf_id_fiche']) ;
1101
	        $GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $valeur['bf_id_fiche']) ;
1103
	        $GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ;
-
 
1104
	        $res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur['bf_titre'].'</a>'."\n";
-
 
1105
	        if ($utilisateur->isSuperAdmin() || $GLOBALS['id_user']==$valeur['bf_ce_utilisateur']) {
1102
	        if ($utilisateur->isSuperAdmin() || $GLOBALS['id_user']==$valeur['bf_ce_utilisateur']) {
1106
	            $GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_MODIFIER);
1103
	            $GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_MODIFIER);
1107
	            $GLOBALS['_BAZAR_']['url']->addQueryString('typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']);
1104
	            $GLOBALS['_BAZAR_']['url']->addQueryString('typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']);
1108
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('personnes');
1105
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('personnes');
1109
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_effectuee');
1106
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_effectuee');
1110
	            $res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a>&nbsp;';
1107
	            $res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a>&nbsp;'."\n";
1111
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1108
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1112
	            $GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_SUPPRESSION);
1109
	            $GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_SUPPRESSION);
1113
	            $res .='<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a>';
1110
	            $res .='<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a>&nbsp;'."\n";
1114
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1111
	            $GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1115
	        }
1112
	        }
-
 
1113
	        $GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ;
-
 
1114
			$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur['bf_titre'].'</a>'."\n";
-
 
1115
	        $res .='</li>'."\n";
1116
	    }
1116
	    }
1117
	    $res .= '</ul>'."\n".'<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1117
	    $res .= '</ul>'."\n".'<div class="bazar_numero">'.$pager->links.'</div>'."\n";
1118
    }
1118
    }
1119
	
1119
	
1120
 
1120
 
1121
	// Nettoyage de l'url
1121
	// Nettoyage de l'url
1122
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1122
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1123
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
1123
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
1124
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
1124
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
1125
	$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_avancee');
1125
	$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_avancee');
1126
 
1126
 
1127
	return $res ;
1127
	return $res ;
1128
}
1128
}
1129
 
1129
 
1130
/* +--Fin du code ----------------------------------------------------------------------------------------+
1130
/* +--Fin du code ----------------------------------------------------------------------------------------+
1131
*
1131
*
1132
* $Log: not supported by cvs2svn $
1132
* $Log: not supported by cvs2svn $
-
 
1133
* Revision 1.74  2007/03/28 15:54:32  florian
-
 
1134
* correction de bugs
-
 
1135
*
1133
* Revision 1.73  2007/03/28 10:01:47  florian
1136
* Revision 1.73  2007/03/28 10:01:47  florian
1134
* ajout de la constante BAZ_UTILISE_TEMPLATE, pour utiliser ou non les templates pour l'affichage du moteur de recherche
1137
* ajout de la constante BAZ_UTILISE_TEMPLATE, pour utiliser ou non les templates pour l'affichage du moteur de recherche
1135
*
1138
*
1136
* Revision 1.72  2007/03/28 08:51:22  neiluj
1139
* Revision 1.72  2007/03/28 08:51:22  neiluj
1137
* passage des flux RSS en UTF-8
1140
* passage des flux RSS en UTF-8
1138
* ajout de l'indentation du code
1141
* ajout de l'indentation du code
1139
* Vérification validation w3c = OK
1142
* Vérification validation w3c = OK
1140
*
1143
*
1141
* Revision 1.71  2007/03/19 15:17:37  alexandre_tb
1144
* Revision 1.71  2007/03/19 15:17:37  alexandre_tb
1142
* correction de la requete de recherche
1145
* correction de la requete de recherche
1143
*
1146
*
1144
* Revision 1.70  2007/03/08 15:12:13  jp_milcent
1147
* Revision 1.70  2007/03/08 15:12:13  jp_milcent
1145
* Fusion avec la livraison Menes : 08 mars 2007
1148
* Fusion avec la livraison Menes : 08 mars 2007
1146
*
1149
*
1147
* Revision 1.60.2.11  2007/03/07 17:20:19  jp_milcent
1150
* Revision 1.60.2.11  2007/03/07 17:20:19  jp_milcent
1148
* Ajout du nettoyage systématique des URLs.
1151
* Ajout du nettoyage systématique des URLs.
1149
*
1152
*
1150
* Revision 1.60.2.10  2007/03/06 09:41:15  alexandre_tb
1153
* Revision 1.60.2.10  2007/03/06 09:41:15  alexandre_tb
1151
* backport de corrections de bugs de la branche principale
1154
* backport de corrections de bugs de la branche principale
1152
*
1155
*
1153
* Revision 1.69  2007/03/06 09:39:00  alexandre_tb
1156
* Revision 1.69  2007/03/06 09:39:00  alexandre_tb
1154
* correction de bug sur les jointures et sur les flux rss
1157
* correction de bug sur les jointures et sur les flux rss
1155
*
1158
*
1156
* Revision 1.68  2007/03/05 10:27:06  alexandre_tb
1159
* Revision 1.68  2007/03/05 10:27:06  alexandre_tb
1157
* ajout d identifiant dans les span qui affiche le detail d une fiche.
1160
* ajout d identifiant dans les span qui affiche le detail d une fiche.
1158
* ajout d un modele pour les fiches -> du code a ete deplace dans
1161
* ajout d un modele pour les fiches -> du code a ete deplace dans
1159
* bazar_template
1162
* bazar_template
1160
*
1163
*
1161
* Revision 1.67  2007/02/28 10:18:56  alexandre_tb
1164
* Revision 1.67  2007/02/28 10:18:56  alexandre_tb
1162
* backport de bug depuis la 1.60 de menes
1165
* backport de bug depuis la 1.60 de menes
1163
*
1166
*
1164
* Revision 1.60.2.9  2007/02/27 15:32:40  alexandre_tb
1167
* Revision 1.60.2.9  2007/02/27 15:32:40  alexandre_tb
1165
* utilisation de la fonction xmlEntities pour transformer les &amp; en &#...;
1168
* utilisation de la fonction xmlEntities pour transformer les &amp; en &#...;
1166
* fixe les plantages des flux rss lorsque des guillemets ou des esperluettes étaient présents
1169
* fixe les plantages des flux rss lorsque des guillemets ou des esperluettes étaient présents
1167
*
1170
*
1168
* Revision 1.60.2.8  2007/02/27 15:11:00  alexandre_tb
1171
* Revision 1.60.2.8  2007/02/27 15:11:00  alexandre_tb
1169
* correction d une jointure dans la requete pour les flux rss
1172
* correction d une jointure dans la requete pour les flux rss
1170
* utilisation de la librairie XML_Util de pear pour generer le flux RSS -> plus clair
1173
* utilisation de la librairie XML_Util de pear pour generer le flux RSS -> plus clair
1171
*
1174
*
1172
* Revision 1.60.2.7  2007/02/15 17:39:00  jp_milcent
1175
* Revision 1.60.2.7  2007/02/15 17:39:00  jp_milcent
1173
* Remise dans le code d'un bogue...
1176
* Remise dans le code d'un bogue...
1174
* A corriger!
1177
* A corriger!
1175
*
1178
*
1176
* Revision 1.60.2.6  2007/02/15 13:42:16  jp_milcent
1179
* Revision 1.60.2.6  2007/02/15 13:42:16  jp_milcent
1177
* Utilisation de IN à la place du = dans les requêtes traitant les catégories de fiches.
1180
* Utilisation de IN à la place du = dans les requêtes traitant les catégories de fiches.
1178
* Permet d'utiliser la syntaxe 1,2,3 dans la configuration de categorie_nature.
1181
* Permet d'utiliser la syntaxe 1,2,3 dans la configuration de categorie_nature.
1179
*
1182
*
1180
* Revision 1.64  2007/02/02 14:00:41  alexandre_tb
1183
* Revision 1.64  2007/02/02 14:00:41  alexandre_tb
1181
* mise en place d'un template pour l'affichage du moteur de recherche
1184
* mise en place d'un template pour l'affichage du moteur de recherche
1182
*
1185
*
1183
* Revision 1.60.2.5  2007/02/02 13:46:54  alexandre_tb
1186
* Revision 1.60.2.5  2007/02/02 13:46:54  alexandre_tb
1184
* correction bug sur une date
1187
* correction bug sur une date
1185
*
1188
*
1186
* Revision 1.60.2.4  2007/01/30 15:45:01  alexandre_tb
1189
* Revision 1.60.2.4  2007/01/30 15:45:01  alexandre_tb
1187
* affichage de la date de création e la fiche lorsque la date de début de validité n'est plus bonne
1190
* affichage de la date de création e la fiche lorsque la date de début de validité n'est plus bonne
1188
*
1191
*
1189
* Revision 1.60.2.3  2007/01/29 10:53:46  alexandre_tb
1192
* Revision 1.60.2.3  2007/01/29 10:53:46  alexandre_tb
1190
* Mise en place de la constante BAZ_DERNIERES_FICHES pour remplacer le label en francais dans baz_liste
1193
* Mise en place de la constante BAZ_DERNIERES_FICHES pour remplacer le label en francais dans baz_liste
1191
*
1194
*
1192
* Revision 1.63  2007/01/18 14:37:34  alexandre_tb
1195
* Revision 1.63  2007/01/18 14:37:34  alexandre_tb
1193
* backport
1196
* backport
1194
* les dates ne s'affichent pas si elles sont vides.
1197
* les dates ne s'affichent pas si elles sont vides.
1195
* les champs dates propose 4 années avant l'année actuelle
1198
* les champs dates propose 4 années avant l'année actuelle
1196
*
1199
*
1197
* Revision 1.60.2.2  2007/01/17 16:01:27  alexandre_tb
1200
* Revision 1.60.2.2  2007/01/17 16:01:27  alexandre_tb
1198
* les dates ne s'affichent pas si elles sont vides.
1201
* les dates ne s'affichent pas si elles sont vides.
1199
* les champs dates propose 4 années avant l'année actuelle
1202
* les champs dates propose 4 années avant l'année actuelle
1200
*
1203
*
1201
* Revision 1.60.2.1  2007/01/05 14:41:49  alexandre_tb
1204
* Revision 1.60.2.1  2007/01/05 14:41:49  alexandre_tb
1202
* backport ordre d affichage des dernieres news et suppression de la taille des images uploadees
1205
* backport ordre d affichage des dernieres news et suppression de la taille des images uploadees
1203
*
1206
*
1204
* Revision 1.60  2006/10/05 08:53:50  florian
1207
* Revision 1.60  2006/10/05 08:53:50  florian
1205
* amelioration moteur de recherche, correction de bugs
1208
* amelioration moteur de recherche, correction de bugs
1206
*
1209
*
1207
* Revision 1.59  2006/09/21 14:19:39  florian
1210
* Revision 1.59  2006/09/21 14:19:39  florian
1208
* amélioration des fonctions liés au wikini
1211
* amélioration des fonctions liés au wikini
1209
*
1212
*
1210
* Revision 1.58  2006/09/15 12:31:40  alexandre_tb
1213
* Revision 1.58  2006/09/15 12:31:40  alexandre_tb
1211
* correction du nom du flux RSS.
1214
* correction du nom du flux RSS.
1212
*
1215
*
1213
* Revision 1.57  2006/07/25 13:22:27  alexandre_tb
1216
* Revision 1.57  2006/07/25 13:22:27  alexandre_tb
1214
* réorganisation du code, sans grand changement
1217
* réorganisation du code, sans grand changement
1215
*
1218
*
1216
* Revision 1.56  2006/07/18 14:13:35  alexandre_tb
1219
* Revision 1.56  2006/07/18 14:13:35  alexandre_tb
1217
* Ajout d identifiant HTML
1220
* Ajout d identifiant HTML
1218
*
1221
*
1219
* Revision 1.55  2006/07/04 14:29:18  alexandre_tb
1222
* Revision 1.55  2006/07/04 14:29:18  alexandre_tb
1220
* Ajout du bouton supprimer pour les administrateurs
1223
* Ajout du bouton supprimer pour les administrateurs
1221
*
1224
*
1222
* Revision 1.54  2006/07/03 09:51:21  alexandre_tb
1225
* Revision 1.54  2006/07/03 09:51:21  alexandre_tb
1223
* correction du bug recherche sur fiches validés et invalidés.
1226
* correction du bug recherche sur fiches validés et invalidés.
1224
*
1227
*
1225
* Revision 1.53  2006/06/29 10:29:51  florian
1228
* Revision 1.53  2006/06/29 10:29:51  florian
1226
* correction bug moteur de recherche
1229
* correction bug moteur de recherche
1227
*
1230
*
1228
* Revision 1.52  2006/06/02 09:29:07  florian
1231
* Revision 1.52  2006/06/02 09:29:07  florian
1229
* debut d'integration de wikini
1232
* debut d'integration de wikini
1230
*
1233
*
1231
* Revision 1.51  2006/05/23 15:41:27  alexandre_tb
1234
* Revision 1.51  2006/05/23 15:41:27  alexandre_tb
1232
* ajout de la numérotation des pages en haut et en bas ds résultats et ajout d'une div class=bazar_numero pour les entourer
1235
* ajout de la numérotation des pages en haut et en bas ds résultats et ajout d'une div class=bazar_numero pour les entourer
1233
*
1236
*
1234
* Revision 1.50  2006/05/22 09:55:12  alexandre_tb
1237
* Revision 1.50  2006/05/22 09:55:12  alexandre_tb
1235
* ajout de la variable recherche_avancee dans l'action du formulaire
1238
* ajout de la variable recherche_avancee dans l'action du formulaire
1236
*
1239
*
1237
* Revision 1.49  2006/05/19 13:54:11  florian
1240
* Revision 1.49  2006/05/19 13:54:11  florian
1238
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
1241
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
1239
*
1242
*
1240
* Revision 1.48  2006/05/17 09:50:13  alexandre_tb
1243
* Revision 1.48  2006/05/17 09:50:13  alexandre_tb
1241
* Ajout du moteur de recherche évolué et du découpage par page
1244
* Ajout du moteur de recherche évolué et du découpage par page
1242
*
1245
*
1243
* +-- Fin du code ----------------------------------------------------------------------------------------+
1246
* +-- Fin du code ----------------------------------------------------------------------------------------+
1244
*/
1247
*/
1245
?>
1248
?>