Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 416 → Rev 417

/branches/v3.0_(aha)/bazar.php
96,12 → 96,12
 
//Recuperer les eventuelles variables passees en GET ou en POST
if (isset($_REQUEST['id_fiche'])) {
$GLOBALS['_BAZAR_']['id_fiche']=$_REQUEST['id_fiche'];
$GLOBALS['_BAZAR_']['id_fiche'] = $_REQUEST['id_fiche'];
// récupération du type d'annonce à partir de la fiche
$requete = 'select bf_ce_nature from bazar_fiche where bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'] ;
$requete = 'select bf_ce_nature from bazar_fiche where bf_id_fiche='.$_REQUEST['id_fiche'] ;
$resultat = $GLOBALS['_BAZAR_']['db']->query ($requete) ;
if (DB::isError($resultat)) {
echo $resultat->getMessage().'<br />'.$resultat->getInfoDebug();
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
$GLOBALS['_BAZAR_']['id_typeannonce'] = $ligne->bf_ce_nature ;
108,27 → 108,33
$resultat->free();
}
if (isset($_REQUEST['typeannonce'])) {
$GLOBALS['_BAZAR_']['id_typeannonce']=$_REQUEST['typeannonce'];
}
 
if ((isset($GLOBALS['_BAZAR_']['id_typeannonce']))and($GLOBALS['_BAZAR_']['id_typeannonce']!='toutes')) {
$requete = 'SELECT bn_label_nature, bn_condition, bn_template, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo';
$requete .= ' FROM bazar_nature WHERE bn_id_nature = '.$GLOBALS['_BAZAR_']['id_typeannonce'];
if (isset($GLOBALS['_BAZAR_']['langue'])) {
$requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%"';
if( $GLOBALS['_BAZAR_']['id_typeannonce'] == '1,2,3,4') {
$GLOBALS['_BAZAR_']['id_typeannonce'] = '1' ;
} else {
$requete = 'SELECT bn_label_nature, bn_condition, bn_template, bn_commentaire, bn_appropriation, bn_image_titre, bn_image_logo';
$requete .= ' FROM bazar_nature WHERE bn_id_nature = '.$GLOBALS['_BAZAR_']['id_typeannonce'];
if (isset($GLOBALS['_BAZAR_']['langue'])) {
$requete .= ' and bn_ce_i18n like "'.$GLOBALS['_BAZAR_']['langue'].'%"';
}
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature'];
$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition'];
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template'];
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire'];
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre'];
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo'];
}
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature'];
$GLOBALS['_BAZAR_']['condition']=$ligne['bn_condition'];
$GLOBALS['_BAZAR_']['template']=$ligne['bn_template'];
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire'];
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
$GLOBALS['_BAZAR_']['image_titre']=$ligne['bn_image_titre'];
$GLOBALS['_BAZAR_']['image_logo']=$ligne['bn_image_logo'];
}
if (!isset($GLOBALS['_BAZAR_']['id_typeannonce'])) $GLOBALS['_BAZAR_']['id_typeannonce'] = 'toutes' ;
// +------------------------------------------------------------------------------------------------------+
224,7 → 230,7
// d afficher des vues correctes
if (isset($_GET[BAZ_VARIABLE_ACTION])) {
if (($_GET[BAZ_VARIABLE_ACTION]!=BAZ_ACTION_NOUVEAU_V)and($_GET[BAZ_VARIABLE_ACTION]!=BAZ_ACTION_MODIFIER_V)) unset($_SESSION['formulaire_annonce_valide']);
switch ($_GET[BAZ_VARIABLE_ACTION]) {
case BAZ_ACTION_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
231,12 → 237,13
case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break;
case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break;
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V); break;
case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression(); unset ($_GET[BAZ_VARIABLE_ACTION]); break;
case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU_V).mes_fiches(); break;
case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression(); unset ($_GET['action']); break;
case BAZ_ACTION_PUBLIER : publier_fiche(1) ; break;
case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break;
case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break;
case BAZ_VOIR_FLUX_RSS : header('Content-type: text/xml; charset=UTF-8');include("bazarRSS.php");exit(0);break;
case BAZ_ACTION_POST_VALIDATION : $res .= baz_post_validation();break;
}
}