Subversion Repositories Applications.bazar

Rev

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

Rev 190 Rev 192
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.67 2007-02-28 10:18:56 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.rss.php,v 1.68 2007-03-05 10:27:06 alexandre_tb 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.67 $
31
*@version       $Revision: 1.68 $
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 été 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 été 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
	
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 FROM bazar_nature WHERE bn_id_nature="'.$GLOBALS['_BAZAR_']['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 ($GLOBALS['AUTH']->getAuth()) {
185
	if ($GLOBALS['AUTH']->getAuth()) {
186
		if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='administrateur')
186
		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'))
187
		     or(niveau_droit('0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur'))
188
		{
188
		{
189
		        $est_admin=1;
189
		        $est_admin=1;
190
		}
190
		}
191
	}
191
	}
192
	//affiche le titre sous forme d'image
192
	//affiche le titre sous forme d'image
193
	if (isset ($GLOBALS['_BAZAR_']['image_titre']) && $GLOBALS['_BAZAR_']['image_titre']!='') {
193
	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";
194
		$res .= '<img id="BAZ_img_titre" src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_titre'].'" alt="'.$result['bn_label_nature'].'" />'.'<br />'."\n";
195
	}
195
	}
196
	//affiche le texte sinon
196
	//affiche le texte sinon
197
	else {
197
	else {
198
		//$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
198
		//$res .= '<h2 class="BAZ_titre">'.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
199
	}
199
	}
200
	$res .= '<div class="BAZ_cadre_fiche">'."\n";
200
	$res .= '<div class="BAZ_cadre_fiche">'."\n";
201
	
201
	
202
	$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ;
202
	$GLOBALS['_BAZAR_']['annonceur'] = $ligne['bf_ce_utilisateur'] ;
203
	//si le template existe, on genere le template
203
	//si le template existe, on genere le template
204
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
204
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
205
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
205
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
206
		$res .=genere_fiche($ligne);
206
		$res .=genere_fiche($ligne);
207
	}
207
	}
208
	//on affiche ligne par ligne sinon
208
	//on affiche ligne par ligne sinon
209
	else {
209
	else {
210
		//cas d'une image personalisée
210
		//cas d'une image personalisée
211
		if (isset($ligne['bf_url_image'])) {
211
		if (isset($ligne['bf_url_image'])) {
212
			$res .= '<div id="fiche_image">'."\n";
212
			$res .= '<div id="fiche_image">'."\n";
213
			$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
213
			$res .= '<img src="client/bazar/upload/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
214
			$res .= '</div>'."\n";
214
			$res .= '</div>'."\n";
215
		}
215
		}
216
		//cas d'une image par défaut
216
		//cas d'une image par défaut
217
		elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') {
217
		elseif (isset ($GLOBALS['_BAZAR_']['image_logo']) && $GLOBALS['_BAZAR_']['image_logo']!='') {
218
			$res .= '<div id="fiche_image">'."\n";
218
			$res .= '<div id="fiche_image">'."\n";
219
			$res .= '<img src="client/bazar/images/'.$GLOBALS['_BAZAR_']['image_logo'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" width="130" height="130" />'."\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 .= '</div>'."\n";
220
			$res .= '</div>'."\n";
221
		}
221
		}
222
		$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n";
222
		$res .= '<h1 id="fiche_titre">'.$ligne['bf_titre'].'</h1>'."\n";
223
		$res .= '<div id="BAZ_description">'.nl2br($ligne['bf_description']).'</div>'."\n";
223
		$res .= '<div id="BAZ_description">'.nl2br($ligne['bf_description']).'</div>'."\n";
224
		$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']);
224
		$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['template']);
225
		for ($i=0; $i<count($tableau); $i++) {
225
		for ($i=0; $i<count($tableau); $i++) {
226
			if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) {
226
			if (isset($ligne[$tableau[$i]['nom_bdd']]) && ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ) ) {
227
				$val=$tableau[$i]['nom_bdd'];
227
				$val=$tableau[$i]['nom_bdd'];
228
				if (!in_array($val, array ('bf_titre', 'bf_description'))) {
228
				if (!in_array($val, array ('bf_titre', 'bf_description'))) {
229
					if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) {
229
					if ($ligne[$val] != '' and $ligne[$val] != BAZ_CHOISIR and $ligne[$val] != BAZ_NON_PRECISE) {
230
						$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
230
						$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
231
						$res .= '<span class="description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n";
231
						$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.nl2br($ligne[$val]).'</span>'."\n".'<br />'."\n";
232
					}
232
					}
233
				}
233
				}
234
			}
234
			}
235
			elseif ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
235
			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				
236
				//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'].
237
				$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'].'"';
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
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
239
				$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
240
				if (DB::isError ($resultat)) {
240
				if (DB::isError ($resultat)) {
241
					die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
241
					die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
242
				}
242
				}
243
				$val='';$nb=0;
243
				$val='';$nb=0;
244
				while ($tab = $resultat->fetchRow()) {
244
				while ($tab = $resultat->fetchRow()) {
245
					if ($nb>0) $val .= ', ';
245
					if ($nb>0) $val .= ', ';
246
					$val .= $tab[0];
246
					$val .= $tab[0];
247
					$nb++;
247
					$nb++;
248
				}				
248
				}				
249
				if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
249
				if ($val != '' and $val != BAZ_CHOISIR and $val != BAZ_NON_PRECISE) {
250
					$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
250
					$res .= '<span class="rubrique" id="rubrique_'.$tableau[$i]['nom_bdd'].'">'.$tableau[$i]['label'].':</span>'."\n";
251
					$res .= '<span class="description"> '.$val.'</span>'."\n".'<br />'."\n";
251
					$res .= '<span class="description" id="description_'.$tableau[$i]['nom_bdd'].'"> '.$val.'</span>'."\n".'<br />'."\n";
252
				}
252
				}
253
			}
253
			}
254
			elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
254
			elseif ( $tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ) {
255
				$val=$tableau[$i]['nom_bdd'];
255
				$val=$tableau[$i]['nom_bdd'];
256
				if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) {
256
				if (!in_array($val, array ('bf_date_debut_validite_fiche', 'bf_date_fin_validite_fiche'))) {
257
					if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') {
257
					if ($ligne[$val] != '' && $ligne[$val] != '0000-00-00') {
258
						$res .= '<span class="rubrique">'.$tableau[$i]['label'].':</span>'."\n";
258
						$res .= '<span class="rubrique" id="'.$tableau[$i]['nom_bdd'].'_rubrique">'.$tableau[$i]['label'].':</span>'."\n";
259
						$res .= '<span class="description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n";
259
						$res .= '<span class="description" id="'.$tableau[$i]['nom_bdd'].'_description"> '.strftime('%d.%m.%Y',strtotime($ligne[$val])).'</span>'."\n".'<br />'."\n";
260
					}
260
					}
261
				}		
261
				}		
262
			}
262
			}
263
			elseif ( $tableau[$i]['type']=='wikini' ) {
263
			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";
264
				$res .= '<div class="lien_wikini"><a href="wikini/'.baz_titre_wiki($ligne["bf_titre"]).'">'.BAZ_ENTRER_PROJET.'</a></div>'."\n";
265
			}
265
			}
266
		}
266
		}
267
	//afficher les liens pour l'annonce
267
	//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'];
268
	$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) ;
269
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
270
	if (DB::isError($resultat)) {
270
	if (DB::isError($resultat)) {
271
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
271
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
272
	}
272
	}
273
	if ($resultat->numRows()>0) {
273
	if ($resultat->numRows()>0) {
274
		$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n";
274
		$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n";
275
		$res .= '<span class="description">'."\n";
275
		$res .= '<span class="description">'."\n";
276
		$res .= '<ul>'."\n";
276
		$res .= '<ul>'."\n";
277
		while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
277
		while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
278
			$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n";
278
			$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n";
279
		}
279
		}
280
		$res .= '</ul></span>'."\n";
280
		$res .= '</ul></span>'."\n";
281
	}
281
	}
282
	
282
	
283
	//afficher les fichiers pour l'annonce
283
	//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'];
284
	$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) ;
285
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
286
	if (DB::isError($resultat)) {
286
	if (DB::isError($resultat)) {
287
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
287
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
288
	}
288
	}
289
	if ($resultat->numRows()>0) {
289
	if ($resultat->numRows()>0) {
290
		$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n";
290
		$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n";
291
		$res .= '<span class="description">'."\n";
291
		$res .= '<span class="description">'."\n";
292
		$res .= '<ul>'."\n";
292
		$res .= '<ul>'."\n";
293
		while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
293
		while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
294
			$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n";
294
			$res .= '<li><a href="client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n";
295
		}
295
		}
296
		$res .= '</ul></span>'."\n";
296
		$res .= '</ul></span>'."\n";
297
	}
297
	}
298
	$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
298
	$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
299
	$res .= '<div class="bulle_corps">'."\n";
299
	$res .= '<div class="bulle_corps">'."\n";
300
	
300
	
301
	//affichage du redacteur de la fiche
301
	//affichage du redacteur de la fiche
302
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.
302
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.
303
					' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'];
303
					' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$ligne['bf_ce_utilisateur'];
304
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
304
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
305
	if (DB::isError($resultat)) {
305
	if (DB::isError($resultat)) {
306
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
306
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
307
	}
307
	}
308
	while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
308
	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";
309
		$res .= BAZ_FICHE_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n";
310
	}
310
	}
311
	$res .= BAZ_NB_VUS.'<strong>'.$ligne['bf_nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
311
	$res .= BAZ_NB_VUS.'<strong>'.$ligne['bf_nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
312
	$res .= '</div>'."\n";
312
	$res .= '</div>'."\n";
313
	$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
313
	$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
314
	$res .= '<div id="BAZ_bas_page">';
314
	$res .= '<div id="BAZ_bas_page">';
315
	}
315
	}
316
	
316
	
317
	//informations complementaires (id fiche, etat publication,... )
317
	//informations complementaires (id fiche, etat publication,... )
318
	if ($danslappli==1) {
318
	if ($danslappli==1) {
319
		if ($ligne['bf_statut_fiche']==1 && $GLOBALS['_BAZAR_']['appropriation']!=1) {
319
		if ($ligne['bf_statut_fiche']==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') {
320
			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.
321
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_DU.
322
					' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_debut_validite_fiche'])).' '.
322
					' '.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";
323
					BAZ_AU.' '.strftime('%d.%m.%Y',strtotime($ligne['bf_date_fin_validite_fiche'])).'<br />'."\n";
324
			}
324
			}
325
		}
325
		}
326
		elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) {
326
		elseif ($GLOBALS['_BAZAR_']['appropriation']!=1 || $ligne['bf_statut_fiche']!=1) {
327
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON;							
327
			$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON;							
328
			if ( $est_admin ) {
328
			if ( $est_admin ) {
329
				$res .= '&nbsp;&nbsp;&nbsp;<strong>'.BAZ_VALIDER_PUBLICATION.'&nbsp;:&nbsp;</strong>'."\n";
329
				$res .= '&nbsp;&nbsp;&nbsp;<strong>'.BAZ_VALIDER_PUBLICATION.'&nbsp;:&nbsp;</strong>'."\n";
330
				$lien_publie = &$GLOBALS['_BAZAR_']['url'];
330
				$lien_publie = &$GLOBALS['_BAZAR_']['url'];
331
				$lien_publie->addQueryString('action', BAZ_VOIR_FICHE);
331
				$lien_publie->addQueryString('action', BAZ_VOIR_FICHE);
332
				$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
332
				$lien_publie->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
333
				$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']);
333
				$lien_publie->addQueryString('typeannonce', $ligne['bf_ce_nature']);
334
				$lien_publie->addQueryString('publiee', 1);
334
				$lien_publie->addQueryString('publiee', 1);
335
				$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a>&nbsp;/&nbsp;';
335
				$res .= '<a href="'.$lien_publie->getURL().'">'.BAZ_OUI.'</a>&nbsp;/&nbsp;';
336
				$lien_publie->removeQueryString('publiee');
336
				$lien_publie->removeQueryString('publiee');
337
				$lien_publie->addQueryString('publiee', 0);
337
				$lien_publie->addQueryString('publiee', 0);
338
				$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n";
338
				$res .='<a href="'.$lien_publie->getURL().'">'.BAZ_NON.'</a>'."\n";
339
				$lien_publie->removeQueryString('publiee');
339
				$lien_publie->removeQueryString('publiee');
340
			}
340
			}
341
			$res .= '<br />'."\n";
341
			$res .= '<br />'."\n";
342
		}
342
		}
343
		//affichage des infos pouvant interesser les admins
343
		//affichage des infos pouvant interesser les admins
344
		if ( $est_admin ) {
344
		if ( $est_admin ) {
345
			$res .= '<span class="rubrique" id="numero_fiche">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
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";			
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
		}		
347
		}		
348
		//affichage des infos et du lien pour la mise a jour de la fiche
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) ) {			
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";
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 .= '&nbsp;&nbsp;&nbsp;<a href="'.$lien_modifier->getURL().'" id="modifier_fiche">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n";
356
		}
356
		}
357
	}
357
	}
358
	$res .= '</div>'."\n";
358
	$res .= '</div>'."\n";
359
	$res .= '</div>'."\n";
359
	$res .= '</div>'."\n";
360
	
360
	
361
	//on ajoute les appropriations, s'il le faut
361
	//on ajoute les appropriations, s'il le faut
362
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) {
362
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['appropriation']==1)) {
363
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
363
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
364
		$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\n";		
364
		$res .= '<h3>'.BAZ_LES_STRUCTURES_POSSEDANT_UNE_RESSOURCE.'</h3>'."\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';
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';
366
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
366
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
367
		if (DB::isError ($resultat)) {
367
		if (DB::isError ($resultat)) {
368
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
368
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
369
		}
369
		}
370
		$possede_ressource=0;
370
		$possede_ressource=0;
371
		if ($resultat->numRows()>0) {
371
		if ($resultat->numRows()>0) {
372
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
372
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
373
			if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
373
			if ($resultat->numRows()==1) $res .= BAZ_STRUCTURE_POSSEDANT.'<br />'."\n";
374
			else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
374
			else $res .= BAZ_STRUCTURES_POSSEDANT.'<br />'."\n";
375
			$res .= '<ul>'."\n";
375
			$res .= '<ul>'."\n";
376
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
376
			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";
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";
378
				if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
378
				if ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)==$ligne[BAZ_CHAMPS_ID]) $possede_ressource=1;
379
			}
379
			}
380
			$res .= '</ul><br />'."\n";
380
			$res .= '</ul><br />'."\n";
381
		}
381
		}
382
		else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
382
		else $res .= BAZ_PAS_D_APPROPRIATION.'<br /><br />'."\n";
383
		$res .='<p class="bulle_corps">'."\n";
383
		$res .='<p class="bulle_corps">'."\n";
384
		$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
384
		$lien_appropriation = $GLOBALS['_BAZAR_']['url'];
385
		$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
385
		$lien_appropriation->addQueryString('action', BAZ_VOIR_FICHE);
386
		$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);			
386
		$lien_appropriation->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);			
387
		if ($possede_ressource) {
387
		if ($possede_ressource) {
388
			$lien_appropriation->addQueryString('appropriation', 0);
388
			$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";
389
			$res .= BAZ_POSSEDE_DEJA_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_VOUS_ENLEVER.'</a>'."\n";
390
			$lien_appropriation->removeQueryString('appropriation');
390
			$lien_appropriation->removeQueryString('appropriation');
391
		}
391
		}
392
		elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
392
		elseif ($GLOBALS['AUTH']->getAuth() && $GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
393
			$lien_appropriation->addQueryString('appropriation', 1);
393
			$lien_appropriation->addQueryString('appropriation', 1);
394
			$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
394
			$res .= BAZ_SI_POSSEDE_RESSOURCE.'<br />'."\n".'<a href="'.$lien_appropriation->getURL().'">'.BAZ_CLIQUER_POUR_APPARAITRE.'</a>'."\n";
395
			$lien_appropriation->removeQueryString('appropriation');
395
			$lien_appropriation->removeQueryString('appropriation');
396
		}
396
		}
397
		elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
397
		elseif ($GLOBALS['AUTH']->getAuth() && !$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_EST_STRUCTURE)) {
398
			$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
398
			$res .= BAZ_IL_FAUT_ETRE_STRUCTURE."\n";
399
		}
399
		}
400
		elseif (!$GLOBALS['AUTH']->getAuth()) {
400
		elseif (!$GLOBALS['AUTH']->getAuth()) {
401
			$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
401
			$res .= BAZ_IL_FAUT_ETRE_IDENTIFIE_STRUCTURE."\n";
402
		}
402
		}
403
		$res .='</p>'."\n";
403
		$res .='</p>'."\n";
404
		$res .= '</div>'."\n";
404
		$res .= '</div>'."\n";
405
	}
405
	}
406
	
406
	
407
	//on ajoute les commentaires, s'il le faut
407
	//on ajoute les commentaires, s'il le faut
408
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) {
408
	if (($danslappli==1)and($GLOBALS['_BAZAR_']['commentaire']==1)) {
409
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
409
		$res .= '<br />'."\n".'<div class="BAZ_cadre_fiche">'."\n";
410
		$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n";
410
		$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n";
411
		$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
411
		$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) ;
412
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
413
		if (DB::isError ($resultat)) {
413
		if (DB::isError ($resultat)) {
414
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
414
			die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
415
		}
415
		}
416
		if ($resultat->numRows()>0) {
416
		if ($resultat->numRows()>0) {
417
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
417
			$res .= BAZ_IL_Y_A.$resultat->numRows().' ';
418
			if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
418
			if ($resultat->numRows()==1) $res .= BAZ_COMMENTAIRE.'<br />'."\n";
419
			else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
419
			else $res .= BAZ_COMMENTAIRES.'<br />'."\n";
420
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
420
			while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
421
				$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
421
				$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
422
				$res .= '<div class="bulle_corps">'."\n";
422
				$res .= '<div class="bulle_corps">'."\n";
423
				//affichage du commentaire
423
				//affichage du commentaire
424
				$res .= $ligne['bc_commentaire'].'<br />'."\n";
424
				$res .= $ligne['bc_commentaire'].'<br />'."\n";
425
				$res .= '</div>'."\n";
425
				$res .= '</div>'."\n";
426
				$res .= '<div class="bulle_bas">'."\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";
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";
428
				//pour les identifies seulement, administrateurs de la rubrique ou superadmins
428
				//pour les identifies seulement, administrateurs de la rubrique ou superadmins
429
				if ($est_admin==1) {
429
				if ($est_admin==1) {
430
					$url_comment= $GLOBALS['_BAZAR_']['url'];
430
					$url_comment= $GLOBALS['_BAZAR_']['url'];
431
					$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
431
					$url_comment->addQueryString('action', BAZ_VOIR_FICHE);
432
					$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
432
					$url_comment->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
433
					$url_comment->addQueryString('id_commentaire', $ligne['bc_id_commentaire']);
433
					$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";
434
					$res .= '<a href="'.$url_comment->getURL().'" style="font-size:9px;float:right;">'.BAZ_SUPPRIMER.'</a>'."\n";
435
				}
435
				}
436
				$res .= '</div>'."\n";
436
				$res .= '</div>'."\n";
437
			}
437
			}
438
		}
438
		}
439
		else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
439
		else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
440
		
440
		
441
		//formulaire des commentaires
441
		//formulaire des commentaires
442
		$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
442
		$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
443
		$squelette =& $form_commentaire->defaultRenderer();
443
		$squelette =& $form_commentaire->defaultRenderer();
444
		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
444
		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
445
		$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
445
		$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
446
										'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
446
										'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
447
									    '</label><br />'."\n".'{element}<br />'."\n");
447
									    '</label><br />'."\n".'{element}<br />'."\n");
448
		$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
448
		$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
449
		$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
449
		$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
450
		$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
450
		$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;');
451
		$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';
452
		require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
453
		$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
453
		$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
454
		$form_commentaire->addElement($formtexte) ;
454
		$form_commentaire->addElement($formtexte) ;
455
		$option=array('style'=>'border:1px solid #000;');
455
		$option=array('style'=>'border:1px solid #000;');
456
		$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
456
		$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
457
		$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
457
		$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
458
		$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
458
		$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
459
		$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
459
		$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
460
		$res .= $form_commentaire->toHTML();
460
		$res .= $form_commentaire->toHTML();
461
		$res .= '</div>'."\n";
461
		$res .= '</div>'."\n";
462
	}
462
	}
463
	
463
	
464
	return $res ;
464
	return $res ;
465
}
465
}
466
 
466
 
467
 
467
 
468
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
468
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
469
*
469
*
470
*   On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
470
*   On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
471
*   et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher 
471
*   et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher 
472
*
472
*
473
*   @param  string   le contenu du flux RSS
473
*   @param  string   le contenu du flux RSS
474
*   @param  boolean  afficher ou non la description
474
*   @param  boolean  afficher ou non la description
475
*   @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
475
*   @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
476
*
476
*
477
*   @return  string    le code HTML
477
*   @return  string    le code HTML
478
*/
478
*/
479
function RSSversHTML($rss, $voirdesc, $formatdate, $affichenb) {
479
function RSSversHTML($rss, $voirdesc, $formatdate, $affichenb) {
480
	if ($rss!='') {
480
	if ($rss!='') {
481
		$rawitems='';$title='';$url='';$cat='';$date='';
481
		$rawitems='';$title='';$url='';$cat='';$date='';
482
		$res='';
482
		$res='';
483
		if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
483
		if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
484
			$items = explode('<item>', $rawitems[0]);
484
			$items = explode('<item>', $rawitems[0]);
485
			$res.='<ul id="BAZ_liste_fiche">'."\n";
485
			$res.='<ul id="BAZ_liste_fiche">'."\n";
486
			for( $i = 0; $i < count($items)-1; $i++ ) {
486
			for( $i = 0; $i < count($items)-1; $i++ ) {
487
				eregi('<title>(.*)</title>',$items[$i+1], $title );
487
				eregi('<title>(.*)</title>',$items[$i+1], $title );
488
				eregi('<link>(.*)</link>',$items[$i+1], $url );
488
				eregi('<link>(.*)</link>',$items[$i+1], $url );
489
				eregi('<description>(.*)</description>',$items[$i+1], $cat);
489
				eregi('<description>(.*)</description>',$items[$i+1], $cat);
490
				eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
490
				eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
491
				$res.='<li>';
491
				$res.='<li>';
492
				if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
492
				if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
493
				if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
493
				if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
494
				if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
494
				if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
495
				if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
495
				if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
496
				$res.='<a href="'.preg_replace ('/&amp;/', '&', $url[1]).'">'.$title[1].'</a>';
496
				$res.='<a href="'.preg_replace ('/&amp;/', '&', $url[1]).'">'.$title[1].'</a>';
497
				if ($voirdesc) {$res.=$cat[1];}
497
				if ($voirdesc) {$res.=$cat[1];}
498
				// Ajout du bouton supprimer pour les superadministrateur
498
				// Ajout du bouton supprimer pour les superadministrateur
499
				if (($GLOBALS['AUTH']->getAuth() && niveau_droit(0,$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')and($url[1]!='#')) {
499
				if (($GLOBALS['AUTH']->getAuth() && niveau_droit(0,$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')and($url[1]!='#')) {
500
					$mon_url = preg_replace ('/&amp;/', '&', $url[1]) ; 
500
					$mon_url = preg_replace ('/&amp;/', '&', $url[1]) ; 
501
					$url_suppr = new Net_URL(preg_replace ('/&amp;/', '&', $mon_url)) ;
501
					$url_suppr = new Net_URL(preg_replace ('/&amp;/', '&', $mon_url)) ;
502
					$url_suppr->addQueryString('action', BAZ_ACTION_SUPPRESSION) ;
502
					$url_suppr->addQueryString('action', BAZ_ACTION_SUPPRESSION) ;
503
		        	$res .= ' ( <a href="'.$url_suppr->getURL().
503
		        	$res .= ' ( <a href="'.$url_suppr->getURL().
504
							'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.' ?\');">'.
504
							'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.' ?\');">'.
505
							BAZ_SUPPRIMER.'</a> )'."\n" ;
505
							BAZ_SUPPRIMER.'</a> )'."\n" ;
506
					}
506
					}
507
				$res.='</li>'."\n";
507
				$res.='</li>'."\n";
508
			}
508
			}
509
			$res.='</ul>'."\n";
509
			$res.='</ul>'."\n";
510
			if ($affichenb==1) {
510
			if ($affichenb==1) {
511
				//une annonce trouvee, on accorde au singulier
511
				//une annonce trouvee, on accorde au singulier
512
				if (((count($items)-1)==1)and($title!=BAZ_PAS_D_ANNONCES)) {
512
				if (((count($items)-1)==1)and($title!=BAZ_PAS_D_ANNONCES)) {
513
					$res = '<br /><h4>'.BAZ_IL_Y_A.' 1 '.BAZ_FICHE_CORRESPONDANTE.'</h4><br />'."\n".$res;
513
					$res = '<br /><h4>'.BAZ_IL_Y_A.' 1 '.BAZ_FICHE_CORRESPONDANTE.'</h4><br />'."\n".$res;
514
				}
514
				}
515
				//plusieures annonces trouvees, on accorde au pluriel
515
				//plusieures annonces trouvees, on accorde au pluriel
516
				else {
516
				else {
517
					$res = '<br /><h4>'.BAZ_IL_Y_A.(count($items)-1).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n".$res;
517
					$res = '<br /><h4>'.BAZ_IL_Y_A.(count($items)-1).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n".$res;
518
				}
518
				}
519
			}
519
			}
520
			//cas des fiches pas trouvées
520
			//cas des fiches pas trouvées
521
			if (((count($items)-1)==1)and($title[1]==BAZ_PAS_D_ANNONCES)) {
521
			if (((count($items)-1)==1)and($title[1]==BAZ_PAS_D_ANNONCES)) {
522
				$res = '<br /><h4>'.BAZ_PAS_D_ANNONCES.'</h4><br />'."\n";
522
				$res = '<br /><h4>'.BAZ_PAS_D_ANNONCES.'</h4><br />'."\n";
523
			}  
523
			}  
524
		}
524
		}
525
	}
525
	}
526
	else $res = BAZ_PAS_D_ANNONCES;
526
	else $res = BAZ_PAS_D_ANNONCES;
527
	
527
	
528
	return $res;
528
	return $res;
529
}
529
}
530
 
530
 
531
/** gen_RSS() - generer un fichier de flux RSS par type d'annonce 
531
/** gen_RSS() - generer un fichier de flux RSS par type d'annonce 
532
*
532
*
533
* @param   string Le type de l'annonce (laisser vide pour tout type d'annonce)
533
* @param   string Le type de l'annonce (laisser vide pour tout type d'annonce)
534
* @param   integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
534
* @param   integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
535
* @param   integer L'identifiant de l'emetteur (laisser vide pour tous)
535
* @param   integer L'identifiant de l'emetteur (laisser vide pour tous)
536
* @param   integer L'etat de validation de l'annonce (laisser 1 pour les annonces validees, 0 pour les non-validees)
536
* @param   integer L'etat de validation de l'annonce (laisser 1 pour les annonces validees, 0 pour les non-validees)
537
* @param   string La requete SQL personnalisee
537
* @param   string La requete SQL personnalisee
538
* @param   integer La categorie des fiches bazar
538
* @param   integer La categorie des fiches bazar
539
*
539
*
540
* @return  string Le code du flux RSS
540
* @return  string Le code du flux RSS
541
*/
541
*/
542
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='') {
542
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='', $requeteSQLFrom = '', $requeteWhereListe = '', $categorie_nature='') {
543
	// generation de la requete MySQL personnalisee
543
	// generation de la requete MySQL personnalisee
544
	$req_where=0;
544
	$req_where=0;
545
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description,  bn_label_nature, bf_date_creation_fiche '.
545
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bf_description,  bn_label_nature, bf_date_creation_fiche '.
546
				'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
546
				'FROM bazar_fiche, bazar_nature '.$requeteSQLFrom.' WHERE '.$requeteWhereListe;
547
	if ($valide!=2) {
547
	if ($valide!=2) {
548
		$requete .= 'bf_statut_fiche='.$valide;
548
		$requete .= 'bf_statut_fiche='.$valide;
549
		$req_where=1;
549
		$req_where=1;
550
	}
550
	}
551
	$nomflux=BAZ_DERNIERE_ACTU;
551
	$nomflux=BAZ_DERNIERE_ACTU;
552
	if (!is_array ($typeannonce) && $typeannonce!='' and $typeannonce!='toutes') {
552
	if (!is_array ($typeannonce) && $typeannonce!='' and $typeannonce!='toutes') {
553
		if ($req_where==1) {$requete .= ' AND ';}
553
		if ($req_where==1) {$requete .= ' AND ';}
554
		$requete .= 'bf_ce_nature='.$typeannonce.' and bf_ce_nature=bn_id_nature ';;
554
		$requete .= 'bf_ce_nature='.$typeannonce.' and bf_ce_nature=bn_id_nature ';;
555
		$req_where=1;
555
		$req_where=1;
556
		//le nom du flux devient le type d'annonce
556
		//le nom du flux devient le type d'annonce
557
		$requete_nom_flux = 'select bn_label_nature from bazar_nature where bn_id_nature='.$typeannonce ;
557
		$requete_nom_flux = 'select bn_label_nature from bazar_nature where bn_id_nature='.$typeannonce ;
558
		$nomflux = $GLOBALS['_BAZAR_']['db']->getOne($requete_nom_flux) ;
558
		$nomflux = $GLOBALS['_BAZAR_']['db']->getOne($requete_nom_flux) ;
559
	}
559
	}
560
	// Cas où il y plusieurs type d annonce demande
560
	// Cas où il y plusieurs type d annonce demande
561
	if (is_array ($typeannonce)) {
561
	if (is_array ($typeannonce)) {
562
		if ($req_where==1) {$requete .= ' AND ';}
562
		if ($req_where==1) {$requete .= ' AND ';}
563
		$requete .= 'bf_ce_nature IN (' ;
563
		$requete .= 'bf_ce_nature IN (' ;
564
		$chaine = '';
564
		$chaine = '';
565
		foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
565
		foreach ($typeannonce as $valeur) $chaine .= '"'.$valeur.'",' ;
566
		$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; 
566
		$requete .= substr ($chaine, 0, strlen ($chaine)-1) ; 
567
		$requete .= ') ';
567
		$requete .= ') ';
568
	}
568
	}
569
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
569
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
570
	if ($valide!=0) {
570
	if ($valide!=0) {
571
		
571
		
572
		if ($utilisateur->isSuperAdmin()) {
572
		if ($utilisateur->isSuperAdmin()) {
573
			$req_where=1;
573
			$req_where=1;
574
		} else {
574
		} else {
575
			if ($req_where==1) {
575
			if ($req_where==1) {
576
				$requete .= ' AND ';
576
				$requete .= ' AND ';
577
			}
577
			}
578
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
578
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
579
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
579
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
580
		}
580
		}
581
	}
581
	}
582
	else $nomflux .= BAZ_A_MODERER;
582
	else $nomflux .= BAZ_A_MODERER;
583
	if ($emetteur!='' && $emetteur!='tous') {
583
	if ($emetteur!='' && $emetteur!='tous') {
584
		if ($req_where==1) {$requete .= ' AND ';}
584
		if ($req_where==1) {$requete .= ' AND ';}
585
		$requete .= 'bf_ce_utilisateur='.$emetteur;
585
		$requete .= 'bf_ce_utilisateur='.$emetteur;
586
		$req_where=1;
586
		$req_where=1;
587
		//requete pour afficher le nom de la structure
587
		//requete pour afficher le nom de la structure
588
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
588
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
589
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
589
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
590
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
590
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
591
		if (DB::isError($resultat)) {
591
		if (DB::isError($resultat)) {
592
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
592
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
593
		}
593
		}
594
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
594
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
595
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
595
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
596
	}
596
	}
597
	if ($requeteSQL!='') {
597
	if ($requeteSQL!='') {
598
		if ($req_where==1) {$requete .= ' AND ';}
598
		if ($req_where==1) {$requete .= ' AND ';}
599
		$requete .= '('.$requeteSQL.')';
599
		$requete .= '('.$requeteSQL.')';
600
		$req_where=1;
600
		$req_where=1;
601
	}
601
	}
602
	if ($categorie_nature!='') {
602
	if ($categorie_nature!='') {
603
		if ($req_where==1) {$requete .= ' AND ';}
603
		if ($req_where==1) {$requete .= ' AND ';}
604
		$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') ';
604
		$requete .= 'bn_ce_id_menu IN ('.$categorie_nature.') ';
605
		$req_where=1;
605
		$req_where=1;
606
	}
606
	}
607
	
607
	
608
	$requete .= ' ORDER BY   bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
608
	$requete .= ' ORDER BY   bf_date_creation_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
609
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
609
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
610
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
610
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
611
	if (DB::isError($resultat)) {
611
	if (DB::isError($resultat)) {
612
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
612
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
613
	}
613
	}
614
	
614
	
615
	function xmlEntities($s){
615
	function xmlEntities($s){
616
		//build first an assoc. array with the entities we want to match
616
		//build first an assoc. array with the entities we want to match
617
		$table1 = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
617
		$table1 = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
618
		
618
		
619
		//now build another assoc. array with the entities we want to replace (numeric entities)
619
		//now build another assoc. array with the entities we want to replace (numeric entities)
620
		foreach ($table1 as $k=>$v){
620
		foreach ($table1 as $k=>$v){
621
		  $table1[$k] = "/$v/";
621
		  $table1[$k] = "/$v/";
622
		  $c = htmlentities($k,ENT_QUOTES,"UTF-8");
622
		  $c = htmlentities($k,ENT_QUOTES,"UTF-8");
623
		  $table2[$c] = "&#".ord($k).";";
623
		  $table2[$c] = "&#".ord($k).";";
624
		}
624
		}
625
		
625
		
626
		//now perform a replacement using preg_replace
626
		//now perform a replacement using preg_replace
627
		//each matched value in array 1 will be replaced with the corresponding value in array 2
627
		//each matched value in array 1 will be replaced with the corresponding value in array 2
628
		$s = preg_replace($table1,$table2,$s);
628
		$s = preg_replace($table1,$table2,$s);
629
		return $s;
629
		return $s;
630
	}
630
	}
631
	
631
	
632
	include_once 'XML/Util.php' ;
632
	include_once 'XML/Util.php' ;
633
 
633
 
634
	$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-1', 'no') ; 
634
	$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-1', 'no') ; 
635
	$xml .= XML_Util::createStartElement ('rss', array('version' => '2.0')) ;
635
	$xml .= XML_Util::createStartElement ('rss', array('version' => '2.0')) ;
636
	$xml .= XML_Util::createStartElement ('channel');
636
	$xml .= XML_Util::createStartElement ('channel');
637
	$xml .= XML_Util::createTag ('title', null, $nomflux, null, false);
637
	$xml .= XML_Util::createTag ('title', null, $nomflux, null, false);
638
	$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
638
	$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
639
	$xml .= XML_Util::createTag ('description', null, BAZ_RSS_DESCRIPTIONSITE);
639
	$xml .= XML_Util::createTag ('description', null, BAZ_RSS_DESCRIPTIONSITE);
640
	$xml .= XML_Util::createTag ('language', null, 'fr-FR');
640
	$xml .= XML_Util::createTag ('language', null, 'fr-FR');
641
	$xml .= XML_Util::createTag ('copyright', null, 'Copyright 2005 '.BAZ_RSS_NOMSITE);
641
	$xml .= XML_Util::createTag ('copyright', null, 'Copyright 2005 '.BAZ_RSS_NOMSITE);
642
	$xml .= XML_Util::createTag ('lastBuildDate', null, strftime('%d %b %Y %H:%M:%S GMT'));
642
	$xml .= XML_Util::createTag ('lastBuildDate', null, strftime('%d %b %Y %H:%M:%S GMT'));
643
	$xml .= XML_Util::createTag ('docs', null, 'http://www.stervinou.com/projets/rss/');
643
	$xml .= XML_Util::createTag ('docs', null, 'http://www.stervinou.com/projets/rss/');
644
	$xml .= XML_Util::createTag ('category', null, BAZ_RSS_CATEGORIE);
644
	$xml .= XML_Util::createTag ('category', null, BAZ_RSS_CATEGORIE);
645
	$xml .= XML_Util::createTag ('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
645
	$xml .= XML_Util::createTag ('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
646
	$xml .= XML_Util::createTag ('webMaster', null, BAZ_RSS_WEBMASTER);
646
	$xml .= XML_Util::createTag ('webMaster', null, BAZ_RSS_WEBMASTER);
647
	$xml .= XML_Util::createTag ('ttl', null, '60');
647
	$xml .= XML_Util::createTag ('ttl', null, '60');
648
	$xml .= XML_Util::createStartElement ('image');
648
	$xml .= XML_Util::createStartElement ('image');
649
		$xml .= XML_Util::createTag ('title', null, BAZ_RSS_NOMSITE);
649
		$xml .= XML_Util::createTag ('title', null, BAZ_RSS_NOMSITE);
650
		$xml .= XML_Util::createTag ('url', null, BAZ_RSS_LOGOSITE);
650
		$xml .= XML_Util::createTag ('url', null, BAZ_RSS_LOGOSITE);
651
		$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
651
		$xml .= XML_Util::createTag ('link', null, BAZ_RSS_ADRESSESITE);
652
	$xml .= XML_Util::createEndElement ('image');
652
	$xml .= XML_Util::createEndElement ('image');
653
	if ($resultat->numRows()>0) {
653
	if ($resultat->numRows()>0) {
654
		// Creation des items : titre + lien + description + date de publication
654
		// Creation des items : titre + lien + description + date de publication
655
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
655
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
656
			$xml .= XML_Util::createStartElement ('item');
656
			$xml .= XML_Util::createStartElement ('item');
657
			
657
			
658
			$xml .= XML_Util::createTag ('title', null, xmlEntities($ligne['bf_titre']));
658
			$xml .= XML_Util::createTag ('title', null, xmlEntities($ligne['bf_titre']));
659
			
659
			
660
			$lien=$GLOBALS['_BAZAR_']['url'];
660
			$lien=$GLOBALS['_BAZAR_']['url'];
661
			$lien->addQueryString('action', BAZ_VOIR_FICHE);
661
			$lien->addQueryString('action', BAZ_VOIR_FICHE);
662
			$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
662
			$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
663
			$xml .= XML_Util::createTag ('link', null, $lien->getURL());
663
			$xml .= XML_Util::createTag ('link', null, $lien->getURL());
664
			$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
664
			$xml .= XML_Util::createTag ('guid', null, $lien->getURL());
665
			$xml .= XML_Util::createStartElement ('description');
665
			$xml .= XML_Util::createStartElement ('description');
666
			if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
666
			if ($_GET['action'] != BAZ_VOIR_TOUTES_ANNONCES) {
667
				$xml .= XML_Util::createCDataSection ($ligne['bf_description']);
667
				$xml .= XML_Util::createCDataSection ($ligne['bf_description']);
668
			}
668
			}
669
			$xml .= XML_Util::createEndElement ('description');
669
			$xml .= XML_Util::createEndElement ('description');
670
			if ($ligne['bf_date_debut_validite_fiche'] == '0000-00-00') $date_pub = $ligne[' bf_date_creation_fiche'] ; else 
670
			if ($ligne['bf_date_debut_validite_fiche'] == '0000-00-00') $date_pub = $ligne[' bf_date_creation_fiche'] ; else 
671
					$date_pub =  $ligne['bf_date_debut_validite_fiche'];
671
					$date_pub =  $ligne['bf_date_debut_validite_fiche'];
672
			$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
672
			$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime($date_pub)));
673
			$xml .= XML_Util::createEndElement ('item');
673
			$xml .= XML_Util::createEndElement ('item');
674
		}
674
		}
675
	}
675
	}
676
	else {//pas d'annonces
676
	else {//pas d'annonces
677
		$xml .= XML_Util::createStartElement ('item');
677
		$xml .= XML_Util::createStartElement ('item');
678
		$xml .= XML_Util::createTag ('title', null, BAZ_PAS_D_ANNONCES);
678
		$xml .= XML_Util::createTag ('title', null, BAZ_PAS_D_ANNONCES);
679
		$xml .= XML_Util::createTag ('link', null, '#');
679
		$xml .= XML_Util::createTag ('link', null, '#');
680
		$xml .= XML_Util::createTag ('description', null, BAZ_PAS_D_ANNONCES);
680
		$xml .= XML_Util::createTag ('description', null, BAZ_PAS_D_ANNONCES);
681
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')));
681
		$xml .= XML_Util::createTag ('pubDate', null, strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')));
682
		$xml .= XML_Util::createEndElement ('item');
682
		$xml .= XML_Util::createEndElement ('item');
683
 
683
 
684
	}
684
	}
685
	$xml .= XML_Util::createEndElement ('channel');
685
	$xml .= XML_Util::createEndElement ('channel');
686
	$xml .= XML_Util::createEndElement('rss') ;
686
	$xml .= XML_Util::createEndElement('rss') ;
687
	return $xml;
687
	return $xml;
688
}
688
}
689
 
689
 
690
 
690
 
691
/** baz_liste() Formate la liste de toutes les annonces actuelles
691
/** baz_liste() Formate la liste de toutes les annonces actuelles
692
*
692
*
693
*   @return  string    le code HTML a afficher
693
*   @return  string    le code HTML a afficher
694
*/
694
*/
695
function baz_liste($typeannonce='toutes') {
695
function baz_liste($typeannonce='toutes') {
696
	//creation du lien pour le formulaire de recherche
696
	//creation du lien pour le formulaire de recherche
697
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
697
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
698
	if (isset($_REQUEST['recherche_avancee'])) $GLOBALS['_BAZAR_']['url']->addQueryString ('recherche_avancee', $_REQUEST['recherche_avancee']);
698
	if (isset($_REQUEST['recherche_avancee'])) $GLOBALS['_BAZAR_']['url']->addQueryString ('recherche_avancee', $_REQUEST['recherche_avancee']);
699
	$lien_formulaire = preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
699
	$lien_formulaire = preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
700
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
700
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
701
	$squelette =& $formtemplate->defaultRenderer();
701
	$squelette =& $formtemplate->defaultRenderer();
702
   	$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
702
   	$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
703
    $squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'.
703
    $squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'.
704
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
704
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
705
    								' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
705
    								' :</td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
706
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
706
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
707
                                    '</td>'."\n".'</tr>'."\n");
707
                                    '</td>'."\n".'</tr>'."\n");
708
 	$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label}&nbsp;{element}</strong>'."\n".
708
 	$squelette->setElementTemplate( '<tr>'."\n".'<td colspan="2" class="liste_a_cocher"><strong>{label}&nbsp;{element}</strong>'."\n".
709
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
709
                                    '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".'</td>'."\n".'</tr>'."\n", 'accept_condition');
710
  	$squelette->setElementTemplate( '<tr><td colspan="2">{label}{element}</td></tr>'."\n", 'rechercher');
710
  	$squelette->setElementTemplate( '<tr><td colspan="2">{label}{element}</td></tr>'."\n", 'rechercher');
711
  	  	
711
  	  	
712
 	$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
712
 	$squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
713
	//Traduction de champs requis
713
	//Traduction de champs requis
714
	$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
714
	$formtemplate->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
715
	$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);	
715
	$formtemplate->setJsWarnings(BAZ_ERREUR_SAISIE,BAZ_VEUILLEZ_CORRIGER);	
716
	
716
	
717
		
717
		
718
	//cas du formulaire de recherche proposant de chercher parmis tous les types d'annonces 
718
	//cas du formulaire de recherche proposant de chercher parmis tous les types d'annonces 
719
	//requete pour obtenir l'id et le label des types d'annonces
719
	//requete pour obtenir l'id et le label des types d'annonces
720
	$requete = 'SELECT bn_id_nature, bn_label_nature '.
720
	$requete = 'SELECT bn_id_nature, bn_label_nature '.
721
	           'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
721
	           'FROM bazar_nature WHERE bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') '.
722
			   'ORDER BY bn_label_nature ASC';
722
			   'ORDER BY bn_label_nature ASC';
723
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
723
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
724
	if (DB::isError($resultat)) {
724
	if (DB::isError($resultat)) {
725
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
725
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
726
	}
726
	}
727
	//on récupère le nb de types de fiches, pour plus tard
727
	//on récupère le nb de types de fiches, pour plus tard
728
	$nb_type_de_fiches=$resultat->numRows();
728
	$nb_type_de_fiches=$resultat->numRows();
729
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
729
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
730
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
730
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
731
		$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
731
		$type_annonce_select[$ligne['bn_id_nature']] = $ligne['bn_label_nature'];
732
		$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
732
		$tableau_typeannonces[] = $ligne['bn_id_nature'] ;
733
	}
733
	}
734
	if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
734
	if ($nb_type_de_fiches>1 && $GLOBALS['_BAZAR_']['typeannonce']=='toutes') {
735
		$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
735
		$res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2><br />'."\n";
736
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
736
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;',
737
						'onchange' => 'javascript:this.form.submit();');
737
						'onchange' => 'javascript:this.form.submit();');
738
		$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
738
		$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
739
		if (isset($_REQUEST['nature'])) {
739
		if (isset($_REQUEST['nature'])) {
740
			$defauts=array('nature'=>$_REQUEST['nature']);
740
			$defauts=array('nature'=>$_REQUEST['nature']);
741
			$formtemplate->setDefaults($defauts);
741
			$formtemplate->setDefaults($defauts);
742
		}		
742
		}		
743
	}
743
	}
744
	//cas du type d'annonces prédéfini 
744
	//cas du type d'annonces prédéfini 
745
	else {
745
	else {
746
		if ($nb_type_de_fiches==1) {
746
		if ($nb_type_de_fiches==1) {
747
			$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select);
747
			$GLOBALS['_BAZAR_']['typeannonce']=end($type_annonce_select);
748
			$GLOBALS['_BAZAR_']['id_typeannonce']=key($type_annonce_select);
748
			$GLOBALS['_BAZAR_']['id_typeannonce']=key($type_annonce_select);
749
		}
749
		}
750
		$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
750
		$res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.' '.$GLOBALS['_BAZAR_']['typeannonce'].'</h2>'."\n";
751
	}
751
	}
752
 
752
 
753
	//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche
753
	//requete pour obtenir l'id, le nom et prenom de toutes les personnes ayant depose une fiche
754
	// dans le but de construire l'élément de formulaire select avec les noms des émetteurs de fiche	
754
	// dans le but de construire l'élément de formulaire select avec les noms des émetteurs de fiche	
755
	if (BAZ_RECHERCHE_PAR_EMETTEUR) {
755
	if (BAZ_RECHERCHE_PAR_EMETTEUR) {
756
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
756
		$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
757
		           'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ;
757
		           'FROM bazar_fiche,'.BAZ_ANNUAIRE.' WHERE ' ;
758
	
758
	
759
		$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and';	
759
		$requete .= ' bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() and';	
760
	
760
	
761
		$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' ';
761
		$requete .= ' bf_ce_utilisateur='.BAZ_CHAMPS_ID.' ';
762
	    if (!isset($_REQUEST['nature'])) {
762
	    if (!isset($_REQUEST['nature'])) {
763
	    		if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) {
763
	    		if (isset($GLOBALS['_BAZAR_']['id_typeannonce'])) {
764
	    			$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" ';
764
	    			$requete .= 'AND bf_ce_nature="'.$GLOBALS['_BAZAR_']['id_typeannonce'].'" ';
765
	    		} 
765
	    		} 
766
		}
766
		}
767
		else {
767
		else {
768
	    		if ($_REQUEST['nature']!='toutes') {
768
	    		if ($_REQUEST['nature']!='toutes') {
769
	    			$requete .= 'AND bf_ce_nature='.$_REQUEST['nature'].' ';
769
	    			$requete .= 'AND bf_ce_nature='.$_REQUEST['nature'].' ';
770
	    		}
770
	    		}
771
	    }
771
	    }
772
	    
772
	    
773
	    $requete .= 'ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
773
	    $requete .= 'ORDER BY '.BAZ_CHAMPS_NOM.' ASC';
774
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
774
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
775
		if (DB::isError($resultat)) {
775
		if (DB::isError($resultat)) {
776
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
776
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
777
		}
777
		}
778
		$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
778
		$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
779
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
779
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
780
			$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
780
			$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
781
		}
781
		}
782
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
782
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
783
		$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
783
		$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
784
	} else {
784
	} else {
785
		$formtemplate->addElement ('hidden', 'personnes', 'tous') ;
785
		$formtemplate->addElement ('hidden', 'personnes', 'tous') ;
786
	}
786
	}
787
	
787
	
788
		//pour les super-administrateurs, on peut voir les annonces non validées
788
		//pour les super-administrateurs, on peut voir les annonces non validées
789
	//on verifie si l'utilisateur est administrateur
789
	//on verifie si l'utilisateur est administrateur
790
	$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
790
	$utilisateur = new Administrateur_bazar($GLOBALS['AUTH']) ;
791
 
791
 
792
	if ($utilisateur->isSuperAdmin()) {
792
	if ($utilisateur->isSuperAdmin()) {
793
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
793
		$option=array('style'=>'border:1px solid #000;width: 200px;font:12px Myriad, Arial, sans-serif;');
794
		$valide_select[0] = BAZ_FICHES_PAS_VALIDEES;
794
		$valide_select[0] = BAZ_FICHES_PAS_VALIDEES;
795
		$valide_select[1] = BAZ_FICHES_VALIDEES;
795
		$valide_select[1] = BAZ_FICHES_VALIDEES;
796
		$valide_select[2] = BAZ_LES_DEUX;
796
		$valide_select[2] = BAZ_LES_DEUX;
797
		$formtemplate->addElement ('select', 'valides', BAZ_VALIDE, $valide_select, $option) ; 
797
		$formtemplate->addElement ('select', 'valides', BAZ_VALIDE, $valide_select, $option) ; 
798
		$defauts=array('valides'=>1);
798
		$defauts=array('valides'=>1);
799
		$formtemplate->setDefaults($defauts);
799
		$formtemplate->setDefaults($defauts);
800
	}
800
	}
801
	
801
	
802
	//champs texte pour entrer les mots cles
802
	//champs texte pour entrer les mots cles
803
	$option=array('maxlength'=>60,'style'=>'border:1px solid #000;width:200px;font:12px Myriad, Arial, sans-serif;');
803
	$option=array('maxlength'=>60,'style'=>'border:1px solid #000;width:200px;font:12px Myriad, Arial, sans-serif;');
804
	$formtemplate->addElement('text', 'recherche_mots_cles', BAZ_MOT_CLE, $option) ;
804
	$formtemplate->addElement('text', 'recherche_mots_cles', BAZ_MOT_CLE, $option) ;
805
	
805
	
806
	//option cachee pour savoir si le formulaire a ete appele deja 
806
	//option cachee pour savoir si le formulaire a ete appele deja 
807
	$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ;
807
	$formtemplate->addElement('hidden', 'recherche_effectuee', 1) ;
808
	
808
	
809
	// Ajout des options si un type de fiche a ete choisie
809
	// Ajout des options si un type de fiche a ete choisie
810
	if ( (isset($_REQUEST['nature']) && $_REQUEST['nature'] != 'toutes') || (isset($GLOBALS['_BAZAR_']['categorie_nature']) && $nb_type_de_fiches==1)) {
810
	if ( (isset($_REQUEST['nature']) && $_REQUEST['nature'] != 'toutes') || (isset($GLOBALS['_BAZAR_']['categorie_nature']) && $nb_type_de_fiches==1)) {
811
		if ( BAZ_MOTEUR_RECHERCHE_AVANCEE || ( isset($_REQUEST['recherche_avancee'])&&$_REQUEST['recherche_avancee']==1) ) { 
811
		if ( BAZ_MOTEUR_RECHERCHE_AVANCEE || ( isset($_REQUEST['recherche_avancee'])&&$_REQUEST['recherche_avancee']==1) ) { 
812
			if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') {
812
			if ($GLOBALS['_BAZAR_']['categorie_nature'] != '') {
813
				$champs_requete = '' ;
813
				$champs_requete = '' ;
814
				if (!isset($_REQUEST['nature']) || $_REQUEST['nature'] == '') {
814
				if (!isset($_REQUEST['nature']) || $_REQUEST['nature'] == '') {
815
					$_REQUEST['nature'] = $tableau_typeannonces[0];
815
					$_REQUEST['nature'] = $tableau_typeannonces[0];
816
				}
816
				}
817
			}
817
			}
818
			// Récupération du template
818
			// Récupération du template
819
			$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
819
			$requete = 'SELECT bn_template FROM bazar_nature WHERE bn_id_nature = '.$_REQUEST['nature'];
820
			$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
820
			$resultat = $GLOBALS['_BAZAR_']['db']->getOne($requete) ;
821
			if (DB::isError($resultat)) {
821
			if (DB::isError($resultat)) {
822
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
822
				die ($resultat->getMessage().$resultat->getDebugInfo()) ;
823
			}
823
			}
824
			
824
			
825
			if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
825
			if (isset($_REQUEST['recherche_avancee']) && $_REQUEST['recherche_avancee']==1) {
826
				foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
826
				foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
827
				$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '0');
827
				$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '0');
828
				$lien_recherche_de_base = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_DE_BASE.'</a><br />';
828
				$lien_recherche_de_base = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_DE_BASE.'</a><br />';
829
				//lien recherche de base
829
				//lien recherche de base
830
				labelhtml($formtemplate,'',$lien_recherche_de_base,'','','','','');		
830
				labelhtml($formtemplate,'',$lien_recherche_de_base,'','','','','');		
831
			}
831
			}
832
			
832
			
833
			$tableau = baz_valeurs_template($resultat) ;
833
			$tableau = baz_valeurs_template($resultat) ;
834
			for ($i=0; $i<count($tableau); $i++) {
834
			for ($i=0; $i<count($tableau); $i++) {
835
				if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
835
				if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
836
					$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
836
					$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
837
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ;
837
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1) ;
838
				}
838
				}
839
			}
839
			}
840
			
840
			
841
		}
841
		}
842
		else {
842
		else {
843
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
843
			foreach(array_merge($_POST, $_GET) as $cle => $valeur) $GLOBALS['_BAZAR_']['url']->addQueryString($cle, $valeur); 
844
			$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '1');
844
			$GLOBALS['_BAZAR_']['url']->addQueryString('recherche_avancee', '1');
845
			$lien_recherche_avancee = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_AVANCEE.'</a><br />';			
845
			$lien_recherche_avancee = '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHE_AVANCEE.'</a><br />';			
846
		}		 	
846
		}		 	
847
	}
847
	}
848
	
848
	
849
	//lien recherche avancee
849
	//lien recherche avancee
850
	if (isset($lien_recherche_avancee)) {
850
	if (isset($lien_recherche_avancee)) {
851
		labelhtml($formtemplate,'',$lien_recherche_avancee,'','','','','');
851
		labelhtml($formtemplate,'',$lien_recherche_avancee,'','','','','');
852
	}
852
	}
853
	
853
	
854
	//Bouton de validation du formulaire
854
	//Bouton de validation du formulaire
855
	$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;');	
855
	$option=array('style'=>'border:1px solid #000;width:100px;font:12px Myriad, Arial, sans-serif;');	
856
	$formtemplate->addElement('submit', 'rechercher', BAZ_RECHERCHER, $option);
856
	$formtemplate->addElement('submit', 'rechercher', BAZ_RECHERCHER, $option);
857
	
857
	
858
	//affichage du formulaire
858
	//affichage du formulaire
859
	//$res.=$formtemplate->toHTML()."\n";
859
	//$res.=$formtemplate->toHTML()."\n";
860
	
860
	
861
 
861
 
862
	// Ajout de la table bazar_fiche_liste_valeur dans le from de la requete
862
	// Ajout de la table bazar_fiche_liste_valeur dans le from de la requete
863
	$case_coche = false ;
863
	$case_coche = false ;
864
	$nb_jointures=0;
864
	$nb_jointures=0;
865
	$requeteFrom = '' ;
865
	$requeteFrom = '' ;
866
	$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature=bf_ce_nature AND ' ;
866
	$requeteWhere = ' bn_ce_id_menu IN ('.$GLOBALS['_BAZAR_']['categorie_nature'].') AND bn_id_nature=bf_ce_nature AND ' ;
867
	$requeteWhereListe = '' ;
867
	$requeteWhereListe = '' ;
868
	
868
	
869
 	if ( isset($tableau) ) {
869
 	if ( isset($tableau) ) {
870
	 	for ($i = 0; $i < count ($tableau); $i++) {
870
	 	for ($i = 0; $i < count ($tableau); $i++) {
871
			if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') {
871
			if ($tableau[$i]['type'] == 'checkbox' || $tableau[$i]['type'] == 'liste') {
872
				$nb_jointures++;
872
				$nb_jointures++;
873
				$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ;			
873
				$nom_liste = $tableau[$i]['type'].$tableau[$i]['nom_bdd'] ;			
874
				if (isset($_REQUEST[$nom_liste]) && is_array($_REQUEST[$nom_liste])) {
874
				if (isset($_REQUEST[$nom_liste]) && is_array($_REQUEST[$nom_liste])) {
875
					$case_coche = true;
875
					$case_coche = true;
876
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
876
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
877
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur IN (' ;
877
					$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur IN (' ;
878
					$chaine = '';
878
					$chaine = '';
879
					//var_dump($_REQUEST[$nom_liste]);
879
					//var_dump($_REQUEST[$nom_liste]);
880
					foreach ($_REQUEST[$nom_liste] as $cle =>$valeur) {
880
					foreach ($_REQUEST[$nom_liste] as $cle =>$valeur) {
881
						if ($valeur == 1) {						
881
						if ($valeur == 1) {						
882
							$chaine .= '"'.$cle.'",' ;
882
							$chaine .= '"'.$cle.'",' ;
883
						}
883
						}
884
					}	
884
					}	
885
					$requeteWhereListe .= substr ($chaine, 0, strlen ($chaine)-1) ;
885
					$requeteWhereListe .= substr ($chaine, 0, strlen ($chaine)-1) ;
886
					$requeteWhereListe .= ') AND ';									
886
					$requeteWhereListe .= ') AND ';									
887
				} else {
887
				} else {
888
					if (isset ($_REQUEST[$nom_liste]) && $_REQUEST[$nom_liste]!=0) {
888
					if (isset ($_REQUEST[$nom_liste]) && $_REQUEST[$nom_liste]!=0) {
889
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
889
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_ce_liste='.$tableau[$i]['nom_bdd'].' AND ' ; // Numéro de la liste
890
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur='.$_REQUEST[$nom_liste].' AND ';
890
						$requeteWhereListe .= ' bfvl'.$nb_jointures.'.bfvl_valeur='.$_REQUEST[$nom_liste].' AND ';
891
						$case_coche = true;
891
						$case_coche = true;
892
					}
892
					}
893
				}
893
				}
894
			}
894
			}
895
		}
895
		}
896
 	}
896
 	}
897
	if ($case_coche) {
897
	if ($case_coche) {
898
		for ($i = 0; $i < $nb_jointures ; $i++) {			
898
		for ($i = 0; $i < $nb_jointures ; $i++) {			
899
			$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($i+1) ;
899
			$requeteFrom .= ', bazar_fiche_valeur_liste  as bfvl'.($i+1) ;
900
			$requeteWhere .= ' bfvl'.($i+1).'.bfvl_ce_fiche=bf_id_fiche AND ';
900
			$requeteWhere .= ' bfvl'.($i+1).'.bfvl_ce_fiche=bf_id_fiche AND ';
901
		}
901
		}
902
		 $requeteWhere .= $requeteWhereListe;
902
		 $requeteWhere .= $requeteWhereListe;
903
	}
903
	}
904
	if (isset($_REQUEST['nature']) && $_REQUEST['nature']!='' && $_REQUEST['nature']!='toutes') {
904
	if (isset($_REQUEST['nature']) && $_REQUEST['nature']!='' && $_REQUEST['nature']!='toutes') {
905
		$requeteWhere = 'bf_ce_nature="'.$_REQUEST['nature'].'" AND '.$requeteWhere;
905
		$requeteWhere = 'bf_ce_nature="'.$_REQUEST['nature'].'" AND '.$requeteWhere;
906
	}
906
	}
-
 
907
	
-
 
908
		// Appel du template n 1
-
 
909
	include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php' ;
-
 
910
	
-
 
911
	$template = new bazarTemplate ($GLOBALS['_BAZAR_']['db']) ;
-
 
912
	$chaine = $template->getTemplate(1, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['categorie_nature']);
-
 
913
	if (bazarTemplate::isError ($chaine)) return $chaine->getMessage() ;
-
 
914
	ob_start();
-
 
915
	eval ($chaine) ;
-
 
916
	$res .= ob_get_contents();
-
 
917
	ob_end_clean() ;
-
 
918
	
-
 
919
 
907
	
920
	
908
	//affichage des resultats de la recherche si le formulaire a ete envoye
921
	//affichage des resultats de la recherche si le formulaire a ete envoye
909
	$requeteSQL='';
922
	$requeteSQL='';
910
	if (isset($_REQUEST['recherche_effectuee'])) {
923
	if (isset($_REQUEST['recherche_effectuee'])) {
911
		//preparation de la requete pour trouver les mots cles
924
		//preparation de la requete pour trouver les mots cles
912
		if (($_REQUEST['recherche_mots_cles']!='')and($_REQUEST['recherche_mots_cles']!=BAZ_MOT_CLE)) {
925
		if (($_REQUEST['recherche_mots_cles']!='')and($_REQUEST['recherche_mots_cles']!=BAZ_MOT_CLE)) {
913
			//decoupage des mots cles
926
			//decoupage des mots cles
914
			$recherche = split(' ', $_REQUEST['recherche_mots_cles']) ;
927
			$recherche = split(' ', $_REQUEST['recherche_mots_cles']) ;
915
			$nbmots=count($recherche);
928
			$nbmots=count($recherche);
916
			$requeteSQL=''; 
929
			$requeteSQL=''; 
917
			for ($i=0; $i<$nbmots; $i++) {
930
			for ($i=0; $i<$nbmots; $i++) {
918
				if ($i>0) $requeteSQL.=' OR ';
931
				if ($i>0) $requeteSQL.=' OR ';
919
				$requeteSQL.='bf_titre LIKE "%'.$recherche[$i].'%" OR bf_description LIKE "%'.$recherche[$i].'%" ';
932
				$requeteSQL.='bf_titre LIKE "%'.$recherche[$i].'%" OR bf_description LIKE "%'.$recherche[$i].'%" ';
920
			}
933
			}
921
		}
934
		}
922
		if (!isset($_REQUEST['nature'])) {
935
		if (!isset($_REQUEST['nature'])) {
923
			if (!isset ($GLOBALS['_BAZAR_']['id_nature'])) $typedefiches = $tableau_typeannonces;
936
			if (!isset ($GLOBALS['_BAZAR_']['id_nature'])) $typedefiches = $tableau_typeannonces;
924
			else $typedefiches = $GLOBALS['_BAZAR_']['id_nature'] ; 
937
			else $typedefiches = $GLOBALS['_BAZAR_']['id_nature'] ; 
925
		} else {
938
		} else {
926
			$typedefiches = $_REQUEST['nature'] ;
939
			$typedefiches = $_REQUEST['nature'] ;
927
			if ($typedefiches == 'toutes') $typedefiches = $tableau_typeannonces ;
940
			if ($typedefiches == 'toutes') $typedefiches = $tableau_typeannonces ;
928
		}
941
		}
929
		if ($typeannonce!='toutes') $typedefiches=$typeannonce;
942
		if ($typeannonce!='toutes') $typedefiches=$typeannonce;
930
		if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];}
943
		if (isset($_REQUEST['valides'])) {$valides=$_REQUEST['valides'];}
931
		else {$valides=1;}
944
		else {$valides=1;}
932
		//generation de la liste de flux a afficher
945
		//generation de la liste de flux a afficher
933
		if (!isset($_REQUEST['personne'])) $_REQUEST['personne']='tous';
946
		if (!isset($_REQUEST['personne'])) $_REQUEST['personne']='tous';
934
		$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personne'], $valides, $requeteSQL, $requeteFrom, $requeteWhere);		
947
		$res .= baz_liste_pagine_HTML($typedefiches, '', $_REQUEST['personne'], $valides, $requeteSQL, $requeteFrom, $requeteWhere);		
935
	}
948
	}
936
	else {
-
 
937
		//on affiche toutes les annonces
-
 
938
		$res .= '<br /><p class="zone_info">'."\n".BAZ_ENTRER_VOS_CRITERES_DE_RECHERCHE.'</p>'."\n";
-
 
939
		$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
-
 
940
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FLUX_RSS);
-
 
941
		$GLOBALS['_BAZAR_']['url']->addQueryString('annonce', $typeannonce);
-
 
942
		$GLOBALS['_BAZAR_']['url']->addQueryString('categorie_nature', $GLOBALS['_BAZAR_']['categorie_nature']);
-
 
943
		/*$res .= '{{Syndication titre="Les derni&egrave;res fiches enregistrées" url="'.preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()).
-
 
944
                '" nb=10 nouvellefenetre=0 formatdate="'.BAZ_TYPE_AFFICHAGE_LISTE.'"}}';*/
-
 
945
	}
-
 
946
	
949
 
947
	// Appel du template n 1
-
 
948
	include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php' ;
-
 
949
	include_once 'HTML/Template/IT.php';
-
 
950
	$template = new bazarTemplate ($GLOBALS['_BAZAR_']['db']) ;
-
 
951
	$chaine = $template->getTemplate(1, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['categorie_nature']);
-
 
952
	if (bazarTemplate::isError ($chaine)) return $chaine->getMessage() ;
-
 
953
	$tpl = new HTML_Template_IT() ;
-
 
954
	$tpl -> setTemplate($chaine);
-
 
955
	$tpl->setVariable('formulaire', $formtemplate->toHTML()) ;
-
 
956
	$res .= $tpl->get();
-
 
957
	return $res;
950
	return $res;	
-
 
951
 
958
}
952
}
959
 
953
 
960
/**
954
/**
961
 * Cette fonction renvoie du HTML
955
 * Cette fonction renvoie du HTML
962
 */
956
 */
963
function baz_liste_pagine_HTML($typeannonce, $nbitem, $emetteur, $valide, $requeteSQL = '', $requeteFrom = '', $requeteWhere = '') {	
957
function baz_liste_pagine_HTML($typeannonce, $nbitem, $emetteur, $valide, $requeteSQL = '', $requeteFrom = '', $requeteWhere = '') {	
964
	// generation de la requete MySQL personnalisee
958
	// generation de la requete MySQL personnalisee
965
	$req_where=0;
959
	$req_where=0;
966
	$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_ce_utilisateur, bf_date_debut_validite_fiche '.
960
	$requete = 'SELECT * '.
967
				'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere;
961
				'FROM bazar_fiche, bazar_nature '.$requeteFrom.' WHERE '.$requeteWhere;
968
	if ($valide!=2) {
962
	if ($valide!=2) {
969
		if ($req_where==1) {$requete .= ' AND ';}
963
		if ($req_where==1) {$requete .= ' AND ';}
970
		$req_where=1;
964
		$req_where=1;
971
		$requete .= 'bf_statut_fiche='.$valide;		
965
		$requete .= 'bf_statut_fiche='.$valide;		
972
	} else {
966
	} else {
973
		$requete .= '1 ' ;
967
		$requete .= '1 ' ;
974
	}
968
	}
975
	
969
	
976
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
970
	$utilisateur = new Administrateur_bazar ($GLOBALS['AUTH']) ;
977
	if ($valide!=0) {
971
	if ($valide!=0) {
978
		if ($utilisateur->isSuperAdmin()) {
972
		if ($utilisateur->isSuperAdmin()) {
979
			$req_where=1;
973
			$req_where=1;
980
		} else {
974
		} else {
981
			if ($req_where==1) {$requete .= ' AND ';}
975
			if ($req_where==1) {$requete .= ' AND ';}
982
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
976
			$requete .= '(bf_date_debut_validite_fiche<=NOW() or bf_date_debut_validite_fiche="0000-00-00")'.
983
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
977
						' AND (bf_date_fin_validite_fiche>=NOW() or bf_date_fin_validite_fiche="0000-00-00") AND bn_id_nature=bf_ce_nature';
984
			$req_where=1;
978
			$req_where=1;
985
		}
979
		}
986
	}
980
	}
987
	if ($emetteur!='' && $emetteur!='tous') {
981
	if ($emetteur!='' && $emetteur!='tous') {
988
		if ($req_where==1) {$requete .= ' AND ';}
982
		if ($req_where==1) {$requete .= ' AND ';}
989
		$requete .= 'bf_ce_utilisateur='.$emetteur;
983
		$requete .= 'bf_ce_utilisateur='.$emetteur;
990
		$req_where=1;
984
		$req_where=1;
991
		//requete pour afficher le nom de la structure
985
		//requete pour afficher le nom de la structure
992
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
986
		$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.
993
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
987
						BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
994
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
988
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
995
		if (DB::isError($resultat)) {
989
		if (DB::isError($resultat)) {
996
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
990
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
997
		}
991
		}
998
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
992
		$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
999
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
993
		$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
1000
	}
994
	}
1001
	if ($requeteSQL!='') {
995
	if ($requeteSQL!='') {
1002
		if ($req_where==1) {$requete .= ' AND ';}
996
		if ($req_where==1) {$requete .= ' AND ';}
1003
		$requete .= '('.$requeteSQL.')';
997
		$requete .= '('.$requeteSQL.')';
1004
		$req_where=1;
998
		$req_where=1;
1005
	}
999
	}
1006
	$requete .= ' ORDER BY  bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
1000
	$requete .= ' ORDER BY  bf_date_debut_validite_fiche DESC, bf_date_fin_validite_fiche DESC, bf_date_maj_fiche DESC';
1007
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
1001
	if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
1008
	
1002
	
1009
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1003
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1010
	if (DB::isError($resultat)) {
1004
	if (DB::isError($resultat)) {
1011
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
1005
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
1012
	}
1006
	}
1013
	$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n";
1007
	$res = '<br /><h4>'.BAZ_IL_Y_A.($resultat->numRows()).' '.BAZ_FICHES_CORRESPONDANTES.'</h4><br />'."\n";
1014
	$res .= '<ul>' ;
1008
	$res .= '<ul>' ;
1015
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE);
1009
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE);
1016
	
1010
	
1017
	$donnees = array();
1011
	$donnees = array();
1018
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
1012
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
1019
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne->bf_id_fiche) ;
1013
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $ligne->bf_id_fiche) ;
1020
		array_push ($donnees, array ($ligne->bf_id_fiche,$ligne->bf_titre,$ligne->bf_ce_utilisateur));		
1014
		array_push ($donnees, $ligne);		
1021
	}
1015
	}
1022
	// Mise en place du Pager
1016
	// Mise en place du Pager
1023
	include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php';
1017
	include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php';
1024
	$params = array(
1018
	$params = array(
1025
    'mode'       => BAZ_MODE_DIVISION,
1019
    'mode'       => BAZ_MODE_DIVISION,
1026
    'perPage'    => BAZ_NOMBRE_RES_PAR_PAGE,
1020
    'perPage'    => BAZ_NOMBRE_RES_PAR_PAGE,
1027
    'delta'      => BAZ_DELTA,
1021
    'delta'      => BAZ_DELTA,
1028
    'httpMethod' => 'GET',
1022
    'httpMethod' => 'GET',
1029
    'extraVars' => array_merge($_POST, $_GET),
1023
    'extraVars' => array_merge($_POST, $_GET),
1030
    'altNext' => BAZ_SUIVANT,
1024
    'altNext' => BAZ_SUIVANT,
1031
    'altPrev' => BAZ_PRECEDENT,
1025
    'altPrev' => BAZ_PRECEDENT,
1032
    'nextImg' => BAZ_SUIVANT,
1026
    'nextImg' => BAZ_SUIVANT,
1033
    'prevImg' => BAZ_PRECEDENT,
1027
    'prevImg' => BAZ_PRECEDENT,
1034
    'itemData'   => $donnees
1028
    'itemData'   => $donnees
1035
	);
1029
	);
1036
	$pager = & Pager::factory($params);
1030
	$pager = & Pager::factory($params);
1037
	$data  = $pager->getPageData();
1031
	$data  = $pager->getPageData();
1038
	$links = $pager->getLinks();
1032
	$links = $pager->getLinks();
1039
    $res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
-
 
-
 
1033
   
1040
	foreach ($data as $valeur) {
1034
	// Appel du template n 2
1041
		$GLOBALS['_BAZAR_']['url']->addQueryString('id_fiche', $valeur[0]) ;
1035
	include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazarTemplate.class.php' ;
1042
		$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_FICHE) ;
-
 
1043
		$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.$valeur[1].'</a>'."\n" ;
-
 
1044
		if ($utilisateur->isSuperAdmin() || $GLOBALS['id_user']==$valeur[2]) {
1036
	$template = new bazarTemplate ($GLOBALS['_BAZAR_']['db']) ;
1045
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_MODIFIER);
-
 
1046
			$GLOBALS['_BAZAR_']['url']->addQueryString('typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']);
1037
	$chaine = $template->getTemplate(2, $GLOBALS['_BAZAR_']['langue'], $GLOBALS['_BAZAR_']['categorie_nature']);
1047
			$GLOBALS['_BAZAR_']['url']->removeQueryString('personnes');
1038
	if (bazarTemplate::isError ($chaine)) return $chaine->getMessage() ;
1048
			$GLOBALS['_BAZAR_']['url']->removeQueryString('recherche_effectuee');
1039
	ob_start();
1049
			$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">('.BAZ_MODIFIER.')</a>&nbsp;' ;
-
 
1050
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1040
	eval ($chaine) ;
1051
			$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ACTION_SUPPRESSION);
-
 
1052
			$res .= '<a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'" onclick="javascript:return confirm(\''.BAZ_SUPPRIMER.'\');">('.BAZ_SUPPRIMER.')</a>' ;
-
 
1053
			$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
1041
	$res .= ob_get_contents();
1054
		}
-
 
1055
		$res .= '</li>';
1042
	ob_end_clean() ;
1056
	}
1043
	
1057
	$res .= '</ul>';
-
 
1058
	$res .= '<div class="bazar_numero">'.$pager->links.'</div>'."\n";
-
 
1059
 
1044
 
1060
	return $res ;
1045
	return $res ;
1061
}
1046
}
1062
 
1047
 
1063
/* +--Fin du code ----------------------------------------------------------------------------------------+
1048
/* +--Fin du code ----------------------------------------------------------------------------------------+
1064
*
1049
*
1065
* $Log: not supported by cvs2svn $
1050
* $Log: not supported by cvs2svn $
-
 
1051
* Revision 1.67  2007/02/28 10:18:56  alexandre_tb
-
 
1052
* backport de bug depuis la 1.60 de menes
-
 
1053
*
1066
* Revision 1.64  2007/02/02 14:00:41  alexandre_tb
1054
* Revision 1.64  2007/02/02 14:00:41  alexandre_tb
1067
* mise en place d'un template pour l'affichage du moteur de recherche
1055
* mise en place d'un template pour l'affichage du moteur de recherche
1068
*
1056
*
1069
* Revision 1.63  2007/01/18 14:37:34  alexandre_tb
1057
* Revision 1.63  2007/01/18 14:37:34  alexandre_tb
1070
* backport
1058
* backport
1071
* les dates ne s'affichent pas si elles sont vides.
1059
* les dates ne s'affichent pas si elles sont vides.
1072
* les champs dates propose 4 années avant l'année actuelle
1060
* les champs dates propose 4 années avant l'année actuelle
1073
*
1061
*
1074
* Revision 1.60.2.2  2007/01/17 16:01:27  alexandre_tb
1062
* Revision 1.60.2.2  2007/01/17 16:01:27  alexandre_tb
1075
* les dates ne s'affichent pas si elles sont vides.
1063
* les dates ne s'affichent pas si elles sont vides.
1076
* les champs dates propose 4 années avant l'année actuelle
1064
* les champs dates propose 4 années avant l'année actuelle
1077
*
1065
*
1078
* Revision 1.60.2.1  2007/01/05 14:41:49  alexandre_tb
1066
* Revision 1.60.2.1  2007/01/05 14:41:49  alexandre_tb
1079
* backport ordre d affichage des dernieres news et suppression de la taille des images uploadees
1067
* backport ordre d affichage des dernieres news et suppression de la taille des images uploadees
1080
*
1068
*
1081
* Revision 1.60  2006/10/05 08:53:50  florian
1069
* Revision 1.60  2006/10/05 08:53:50  florian
1082
* amelioration moteur de recherche, correction de bugs
1070
* amelioration moteur de recherche, correction de bugs
1083
*
1071
*
1084
* Revision 1.59  2006/09/21 14:19:39  florian
1072
* Revision 1.59  2006/09/21 14:19:39  florian
1085
* amélioration des fonctions liés au wikini
1073
* amélioration des fonctions liés au wikini
1086
*
1074
*
1087
* Revision 1.58  2006/09/15 12:31:40  alexandre_tb
1075
* Revision 1.58  2006/09/15 12:31:40  alexandre_tb
1088
* correction du nom du flux RSS.
1076
* correction du nom du flux RSS.
1089
*
1077
*
1090
* Revision 1.57  2006/07/25 13:22:27  alexandre_tb
1078
* Revision 1.57  2006/07/25 13:22:27  alexandre_tb
1091
* réorganisation du code, sans grand changement
1079
* réorganisation du code, sans grand changement
1092
*
1080
*
1093
* Revision 1.56  2006/07/18 14:13:35  alexandre_tb
1081
* Revision 1.56  2006/07/18 14:13:35  alexandre_tb
1094
* Ajout d identifiant HTML
1082
* Ajout d identifiant HTML
1095
*
1083
*
1096
* Revision 1.55  2006/07/04 14:29:18  alexandre_tb
1084
* Revision 1.55  2006/07/04 14:29:18  alexandre_tb
1097
* Ajout du bouton supprimer pour les administrateurs
1085
* Ajout du bouton supprimer pour les administrateurs
1098
*
1086
*
1099
* Revision 1.54  2006/07/03 09:51:21  alexandre_tb
1087
* Revision 1.54  2006/07/03 09:51:21  alexandre_tb
1100
* correction du bug recherche sur fiches validés et invalidés.
1088
* correction du bug recherche sur fiches validés et invalidés.
1101
*
1089
*
1102
* Revision 1.53  2006/06/29 10:29:51  florian
1090
* Revision 1.53  2006/06/29 10:29:51  florian
1103
* correction bug moteur de recherche
1091
* correction bug moteur de recherche
1104
*
1092
*
1105
* Revision 1.52  2006/06/02 09:29:07  florian
1093
* Revision 1.52  2006/06/02 09:29:07  florian
1106
* debut d'integration de wikini
1094
* debut d'integration de wikini
1107
*
1095
*
1108
* Revision 1.51  2006/05/23 15:41:27  alexandre_tb
1096
* Revision 1.51  2006/05/23 15:41:27  alexandre_tb
1109
* 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
1097
* 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
1110
*
1098
*
1111
* Revision 1.50  2006/05/22 09:55:12  alexandre_tb
1099
* Revision 1.50  2006/05/22 09:55:12  alexandre_tb
1112
* ajout de la variable recherche_avancee dans l'action du formulaire
1100
* ajout de la variable recherche_avancee dans l'action du formulaire
1113
*
1101
*
1114
* Revision 1.49  2006/05/19 13:54:11  florian
1102
* Revision 1.49  2006/05/19 13:54:11  florian
1115
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
1103
* stabilisation du moteur de recherche, corrections bugs, lien recherche avancee
1116
*
1104
*
1117
* Revision 1.48  2006/05/17 09:50:13  alexandre_tb
1105
* Revision 1.48  2006/05/17 09:50:13  alexandre_tb
1118
* Ajout du moteur de recherche évolué et du découpage par page
1106
* Ajout du moteur de recherche évolué et du découpage par page
1119
*
1107
*
1120
* +-- Fin du code ----------------------------------------------------------------------------------------+
1108
* +-- Fin du code ----------------------------------------------------------------------------------------+
1121
*/
1109
*/
1122
?>
1110
?>