Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// CVS : $Id: bazar.php,v 1.8 2005-09-30 13:00:05 ddelon Exp $
|
22 |
// CVS : $Id: bazar.php,v 1.9 2005-10-12 13:35:07 florian Exp $
|
23 |
/**
|
23 |
/**
|
24 |
*
|
24 |
*
|
25 |
*@package bazar
|
25 |
*@package bazar
|
26 |
//Auteur original :
|
26 |
//Auteur original :
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
27 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
28 |
*@author Florian Schmitt <florian@ecole-et-nature.org>
|
29 |
//Autres auteurs :
|
29 |
//Autres auteurs :
|
30 |
*@copyright Tela-Botanica 2000-2004
|
30 |
*@copyright Tela-Botanica 2000-2004
|
31 |
*@version $Revision: 1.8 $ $Date: 2005-09-30 13:00:05 $
|
31 |
*@version $Revision: 1.9 $ $Date: 2005-10-12 13:35:07 $
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
32 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
*/
|
33 |
*/
|
Line 34... |
Line 34... |
34 |
|
34 |
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
Line 89... |
Line 89... |
89 |
$res.='<div id="BAZ_menu">'."\n";
|
89 |
$res.='<div id="BAZ_menu">'."\n";
|
90 |
$res .='<ul>'."\n";
|
90 |
$res .='<ul>'."\n";
|
91 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
|
91 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
|
92 |
$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
|
92 |
$GLOBALS['_BAZAR_']['url']->addQueryString('nature', 'toutes');
|
93 |
//partie consultation d'annonces
|
93 |
//partie consultation d'annonces
|
94 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'<ul>'."\n";
|
94 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_CONSULTER.'</a>'."\n".'</li>'."\n";
|
95 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
|
95 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
|
Line 96... |
Line 96... |
96 |
|
96 |
|
97 |
$requete = 'SELECT bn_id_nature, bn_label_nature FROM bazar_nature WHERE bn_ce_id_menu='.$GLOBALS['_GEN_commun']['info_menu']->gm_id_menu.' or bn_ce_id_menu=0';
|
97 |
/*$requete = 'SELECT bn_id_nature, bn_label_nature FROM bazar_nature WHERE bn_ce_id_menu='.$GLOBALS['_GEN_commun']['info_menu']->gm_id_menu.' or bn_ce_id_menu=0';
|
98 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
98 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
99 |
if (DB::isError($resultat)) {
|
99 |
if (DB::isError($resultat)) {
|
100 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
100 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
101 |
}
|
101 |
}
|
Line 110... |
Line 110... |
110 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
|
110 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('nature');
|
111 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
111 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
Line 112... |
Line 112... |
112 |
|
112 |
|
113 |
//partie recherche d'annonces
|
113 |
//partie recherche d'annonces
|
114 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_RECHERCHER_ANNONCE);
|
114 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_RECHERCHER_ANNONCE);
|
115 |
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHER_DES_ANNONCES.'</a></li>'."\n";
|
115 |
$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHER.'</a></li>'."\n";
|
Line 116... |
Line 116... |
116 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
116 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
117 |
|
117 |
|
118 |
//pour les identifiés seulement
|
118 |
//pour les identifiés seulement
|
119 |
if ($GLOBALS['AUTH']->getAuth()) {
|
119 |
if ($GLOBALS['AUTH']->getAuth()) {*/
|
120 |
//partie abonnement aux annonces
|
120 |
//partie abonnement aux annonces
|
121 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
|
121 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
|
Line 122... |
Line 122... |
122 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_INSCRIRE_AUX_ANNONCES.'</a></li>'."\n" ;
|
122 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_ABONNER.'</a></li>'."\n" ;
|
123 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
123 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
124 |
|
124 |
|
Line 135... |
Line 135... |
135 |
$res .='</ul></li>'."\n";
|
135 |
$res .='</ul></li>'."\n";
|
Line 136... |
Line 136... |
136 |
|
136 |
|
137 |
|
137 |
|
- |
|
138 |
//choix des administrateurs
|
138 |
//choix des administrateurs
|
139 |
$est_admin=0;
|
139 |
$est_admin=0;
|
140 |
if ($GLOBALS['AUTH']->getAuth()) {
|
140 |
$requete='SELECT bn_id_nature FROM bazar_nature';
|
141 |
$requete='SELECT bn_id_nature FROM bazar_nature';
|
141 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
142 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
142 |
if (DB::isError($resultat)) {
|
- |
|
143 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
144 |
}
|
- |
|
145 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
146 |
if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
|
143 |
if (DB::isError($resultat)) {
|
- |
|
144 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
145 |
}
|
- |
|
146 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
147 |
if ((niveau_droit($ligne['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
|
147 |
$est_admin=1;
|
148 |
$est_admin=1;
|
148 |
}
|
149 |
}
|
149 |
}
|
150 |
}
|
150 |
if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
|
151 |
if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')) {
|
151 |
//partie administrer
|
152 |
//partie administrer
|
152 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
|
153 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
|
153 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a><ul>'."\n";
|
154 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMINISTRER.'</a><ul>'."\n";
|
Line 162... |
Line 163... |
162 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
|
163 |
$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
|
163 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
|
164 |
$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
|
164 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
165 |
$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
|
165 |
}
|
166 |
}
|
166 |
$res .= '</ul></li>'."\n";
|
167 |
$res .= '</ul></li>'."\n";
|
167 |
$res.= '</ul>'."\n";
|
- |
|
168 |
}
|
168 |
}
|
169 |
}
|
169 |
}
|
170 |
else $res .='<li><span style="color:#02587B;">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</span></li></ul>';
|
170 |
$res.= '</ul>'."\n";
|
171 |
|
- |
|
172 |
|
- |
|
173 |
$res.='</div>'."\n";
|
171 |
$res.='</div>'."\n";
|
Line 174... |
Line 172... |
174 |
|
172 |
|
175 |
//le corps de l'appli
|
173 |
//le corps de l'appli
|
176 |
$res.='<div id="BAZ_corps">'."\n";
|
174 |
$res.='<div id="BAZ_corps">'."\n";
|
177 |
if (isset($_GET['action'])) {
|
175 |
if (isset($_GET['action'])) {
|
178 |
switch ($_GET['action']) {
|
176 |
switch ($_GET['action']) {
|
179 |
case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
|
177 |
case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
|
180 |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($_GET['nature'],'',''); break;
|
178 |
case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste($_REQUEST['nature'],'',''); break;
|
181 |
case BAZ_RECHERCHER_ANNONCE : $res .= baz_rechercher(); break;
|
179 |
case BAZ_RECHERCHER_ANNONCE : $res .= baz_rechercher(); break;
|
182 |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
180 |
case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
|
183 |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
|
181 |
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
|
184 |
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
|
182 |
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
|
Line 207... |
Line 205... |
207 |
|
205 |
|
208 |
|
206 |
|
209 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
207 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
208 |
*
|
- |
|
209 |
* $Log: not supported by cvs2svn $
|
- |
|
210 |
* Revision 1.8 2005/09/30 13:00:05 ddelon
|
210 |
*
|
211 |
* Fiche bazar generique
|
211 |
* $Log: not supported by cvs2svn $
|
212 |
*
|
212 |
* Revision 1.7 2005/09/30 12:34:44 ddelon
|
213 |
* Revision 1.7 2005/09/30 12:34:44 ddelon
|
213 |
* petite modification pour integration bazar dans papyrus
|
214 |
* petite modification pour integration bazar dans papyrus
|
214 |
*
|
215 |
*
|