Subversion Repositories Applications.bazar

Rev

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

Rev 40 Rev 45
Line 72... Line 72...
72
					baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']).
72
					baz_nextid('bazar_commentaires', 'bc_id_commentaire', $GLOBALS['_BAZAR_']['db']).
73
					', '.$GLOBALS['_BAZAR_']['id_fiche'].', "'.$_POST['Nom'].'", "'.$_POST['Commentaire'].
73
					', '.$GLOBALS['_BAZAR_']['id_fiche'].', "'.$_POST['Nom'].'", "'.$_POST['Commentaire'].
74
					'", NOW() )';
74
					'", NOW() )';
75
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
75
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
76
	}
76
	}
77
	//cas ou un commentaire va être supprimé
77
	//cas ou un commentaire va être supprime
78
	elseif (isset($_GET['id_commentaire'])) {
78
	elseif (isset($_GET['id_commentaire'])) {
79
		$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1';
79
		$requete = 'DELETE FROM bazar_commentaires WHERE bc_id_commentaire='.$_GET['id_commentaire'].' LIMIT 1';
80
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
80
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
81
	}
81
	}
82
	else {
82
	else {
Line 101... Line 101...
101
		$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
101
		$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
102
		$GLOBALS['_BAZAR_']['annonceur']=$ligne['bf_ce_utilisateur'];
102
		$GLOBALS['_BAZAR_']['annonceur']=$ligne['bf_ce_utilisateur'];
103
		$GLOBALS['_BAZAR_']['nb_consultations']=$ligne['bf_nb_consultations'];
103
		$GLOBALS['_BAZAR_']['nb_consultations']=$ligne['bf_nb_consultations'];
104
	}
104
	}
Line 105... Line 105...
105
	
105
	
106
	//on vérifie si l'utilisateur est administrateur
106
	//on verifie si l'utilisateur est administrateur
107
	$est_admin=0;
107
	$est_admin=0;
108
	if ($GLOBALS['AUTH']->getAuth()) {
108
	if ($GLOBALS['AUTH']->getAuth()) {
109
		$requete='SELECT bn_id_nature FROM bazar_nature WHERE bn_label_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
109
		$requete='SELECT bn_id_nature FROM bazar_nature WHERE bn_label_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
110
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
110
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
Line 122... Line 122...
122
	$res = '<div class="BAZ_cadre_fiche">'."\n";
122
	$res = '<div class="BAZ_cadre_fiche">'."\n";
123
	$res .= '<div class="BAZ_cadre_fiche_haut">'."\n";
123
	$res .= '<div class="BAZ_cadre_fiche_haut">'."\n";
124
	$res .= '&nbsp;</div>'."\n";
124
	$res .= '&nbsp;</div>'."\n";
125
	$res .= '<div class="BAZ_cadre_fiche_corps">'."\n";
125
	$res .= '<div class="BAZ_cadre_fiche_corps">'."\n";
Line 126... Line 126...
126
	
126
	
127
	//si le template existe, on génère le template
127
	//si le template existe, on genere le template
128
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
128
	if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
129
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
129
		include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
130
		$res .=genere_fiche($GLOBALS['_BAZAR_']['id_fiche']);
130
		$res .=genere_fiche($GLOBALS['_BAZAR_']['id_fiche']);
131
	}
131
	}
Line 208... Line 208...
208
		$res .= '</ul></span>'."\n";
208
		$res .= '</ul></span>'."\n";
209
	}
209
	}
210
	$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
210
	$res .= '<div class="bulle_haut">&nbsp;</div>'."\n";
211
	$res .= '<div class="bulle_corps">'."\n";
211
	$res .= '<div class="bulle_corps">'."\n";
Line 212... Line 212...
212
	
212
	
213
	//affichage du rédacteur de la fiche
213
	//affichage du redacteur de la fiche
214
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$GLOBALS['_BAZAR_']['annonceur'];
214
	$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$GLOBALS['_BAZAR_']['annonceur'];
215
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
215
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
216
	if (DB::isError($resultat)) {
216
	if (DB::isError($resultat)) {
217
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
217
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
Line 222... Line 222...
222
	$res .= BAZ_NB_VUS.'<strong>'.$GLOBALS['_BAZAR_']['nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
222
	$res .= BAZ_NB_VUS.'<strong>'.$GLOBALS['_BAZAR_']['nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
223
	$res .= '</div>'."\n";
223
	$res .= '</div>'."\n";
224
	$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
224
	$res .= '<div class="bulle_bas">&nbsp;</div>'."\n";
225
	$res .= '<div id="BAZ_bas_page">';
225
	$res .= '<div id="BAZ_bas_page">';
Line 226... Line 226...
226
	
226
	
227
	//informations complémentaires (id fiche, état publication,... )
227
	//informations complementaires (id fiche, etat publication,... )
228
	if ($danslappli==1) {
228
	if ($danslappli==1) {
229
		$res .= '<span class="rubrique">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
229
		$res .= '<span class="rubrique">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
230
		$res .= '<span class="rubrique">'.BAZ_NATURE.':</span> '.$GLOBALS['_BAZAR_']['typeannonce'].'<br />'."\n";
230
		$res .= '<span class="rubrique">'.BAZ_NATURE.':</span> '.$GLOBALS['_BAZAR_']['typeannonce'].'<br />'."\n";
231
		if ($ligne['bf_statut_fiche']==1) {
231
		if ($ligne['bf_statut_fiche']==1) {
Line 481... Line 481...
481
	
481
	
482
	//titre 
482
	//titre 
483
	if ($typeannonce=='toutes') $res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2>'."\n";
483
	if ($typeannonce=='toutes') $res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2>'."\n";
Line 484... Line 484...
484
	else $res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.$typeannonce.'</h2>'."\n";
484
	else $res = '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.$typeannonce.'</h2>'."\n";
485
		
485
		
486
	//création du lien pour le formulaire de recherche
486
	//creation du lien pour le formulaire de recherche
487
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
487
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
488
	$lien_formulaire=preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
488
	$lien_formulaire=preg_replace ('/&amp;/', '&', $GLOBALS['_BAZAR_']['url']->getURL()) ;
489
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
489
	$formtemplate = new HTML_QuickForm('formulaire', 'post', $lien_formulaire) ;
Line 500... Line 500...
500
	}
500
	}
501
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
501
	$type_annonce_select['toutes']=BAZ_TOUS_TYPES_FICHES;
502
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
502
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
503
		$type_annonce_select[$ligne['bn_label_nature']] = $ligne['bn_label_nature'];
503
		$type_annonce_select[$ligne['bn_label_nature']] = $ligne['bn_label_nature'];
504
	}
504
	}
505
	$option=array('style'=>'width: 160px;', 'onchange'=>'this.form.submit();');
505
	$option=array('style'=>'width: 160px;');
506
	$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
506
	$formtemplate->addElement ('select', 'nature', BAZ_TYPEANNONCE, $type_annonce_select, $option) ;
Line 507... Line 507...
507
	
507
	
508
	//requete pour obtenir l'id, le nom et prénom de toutes les personnes ayant une fiche publiée actuellement
508
	//requete pour obtenir l'id, le nom et prénom de toutes les personnes ayant une fiche publiée actuellement
509
	$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
509
	$requete = 'SELECT '.BAZ_CHAMPS_ID.', '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' '.
Line 516... Line 516...
516
	}
516
	}
517
	$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
517
	$personnes_select['tous']=BAZ_TOUS_LES_EMETTEURS;
518
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
518
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
519
		$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
519
		$personnes_select[$ligne[BAZ_CHAMPS_ID]] = $ligne[BAZ_CHAMPS_NOM]." ".$ligne[BAZ_CHAMPS_PRENOM] ;
520
	}
520
	}
521
	$option=array('style'=>'width: 160px;', 'onchange'=>'this.form.submit();');
521
	$option=array('style'=>'width: 160px;');
522
	$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
522
	$formtemplate->addElement ('select', 'personnes', BAZ_EMETTEUR, $personnes_select, $option) ;
Line 523... Line 523...
523
	
523
	
524
	//champs texte pour entrer les mots clés
524
	//champs texte pour entrer les mots clés
525
	$option=array('size'=>15,'maxlength'=>40);
525
	$option=array('size'=>15,'maxlength'=>40);