Subversion Repositories Applications.bazar

Rev

Rev 330 | Rev 356 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 330 Rev 346
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.fonct.php,v 1.74 2007-10-25 09:41:31 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.php,v 1.75 2007-12-04 09:07:21 alexandre_tb Exp $
23
/**
23
/**
24
*
24
*
25
* Fonctions du module bazar
25
* Fonctions du module bazar
26
* 
26
* 
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.74 $ $Date: 2007-10-25 09:41:31 $
34
*@version       $Revision: 1.75 $ $Date: 2007-12-04 09:07:21 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 1229... Line 1229...
1229
	$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1229
		$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
1230
	if (DB::isError($resultat)) {
1230
		if (DB::isError($resultat)) {
1231
		die ($resultat->getMessage().$resultat->getDebugInfo()) ;
1231
			die ($resultat->getMessage().$resultat->getDebugInfo()) ;
1232
	}
1232
		}
Line -... Line 1233...
-
 
1233
		
-
 
1234
		// Nettoyage de l url
-
 
1235
		$GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_VOIR);
1233
	
1236
		
1234
	$table = new HTML_Table(array ('width' => '100%', 'class' => 'table_bazar'));
1237
		$table = new HTML_Table(array ('width' => '100%', 'class' => 'table_bazar'));
1235
	$table->addRow(array(BAZ_TYPE_ANNONCES, BAZ_STATUT, BAZ_PASSER_EN, BAZ_RSS));
1238
		$table->addRow(array(BAZ_TYPE_ANNONCES,/* BAZ_STATUT, BAZ_PASSER_EN, */ BAZ_RSS));
Line 1236... Line 1239...
1236
	$table->setRowType(0, 'th');
1239
		$table->setRowType(0, 'th');
-
 
1240
		
1237
	
1241
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {	
1238
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {		
1242
			/*
1239
		$tab_parametres_GET = explode ("&", $_SERVER["argv"][0]) ;
1243
			$tab_parametres_GET = explode ("&", $_SERVER["argv"][0]) ;
1240
		foreach ($tab_parametres_GET as $cle_param => $valeur_param) {
1244
			foreach ($tab_parametres_GET as $cle_param => $valeur_param) {
1241
			$tab_valeur = explode ('=', $valeur_param) ;
1245
				$tab_valeur = explode ('=', $valeur_param) ;
1242
			$GLOBALS['_BAZAR_']['url']->addQueryString($tab_valeur[0], $tab_valeur[1]);
1246
				$GLOBALS['_BAZAR_']['url']->addQueryString($tab_valeur[0], $tab_valeur[1]);
1243
		}
1247
			}
1244
						
1248
				*/			
1245
		$lien_s_abonner=$GLOBALS['_BAZAR_']['url'];
1249
			$lien_s_abonner=$GLOBALS['_BAZAR_']['url'];
1246
		$lien_s_abonner->addQueryString('action', BAZ_S_INSCRIRE);
1250
			$lien_s_abonner->addQueryString('action', BAZ_S_INSCRIRE);
Line 1247... Line 1251...
1247
		$lien_s_abonner->addQueryString('idtypeannonce', $ligne['bn_id_nature']);
1251
			$lien_s_abonner->addQueryString('annonce', $ligne['bn_id_nature']);
1248
		$lien_s_abonner->addQueryString('inscrip', 1);
1252
			$lien_s_abonner->addQueryString('inscrip', 1);
1249
		
1253
			
1250
		$lien_se_desabonner=$GLOBALS['_BAZAR_']['url'];
1254
			$lien_se_desabonner=$GLOBALS['_BAZAR_']['url'];
Line 1251... Line 1255...
1251
		$lien_se_desabonner->addQueryString('action', BAZ_S_INSCRIRE);
1255
			$lien_se_desabonner->addQueryString('action', BAZ_S_INSCRIRE);
1252
		$lien_se_desabonner->addQueryString('idtypeannonce', $ligne['bn_id_nature']);
1256
			$lien_se_desabonner->addQueryString('annonce', $ligne['bn_id_nature']);
Line 1264... Line 1268...
1264
			die ($resultat2->getMessage().$resultat2->getDebugInfo()) ;
1268
				die ($resultat2->getMessage().$resultat2->getDebugInfo()) ;
1265
		}
1269
			}
1266
		if (isset($ligne['bn_image_titre'])) {$titre='&nbsp;<img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'."\n";}
1270
			if (isset($ligne['bn_image_titre'])) {$titre='&nbsp;<img src="client/bazar/images/'.$ligne['bn_image_titre'].'" alt="'.$ligne['bn_label_nature'].'" />'."\n";}
1267
		else {$titre='<strong>&nbsp;'.$ligne['bn_label_nature'].'</strong>'."\n";}
1271
			else {$titre='<strong>&nbsp;'.$ligne['bn_label_nature'].'</strong>'."\n";}
1268
		if ($resultat2->numRows()>0) {
1272
			if ($resultat2->numRows()>0) {
1269
			$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']);
1273
				//$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']);
1270
			$table->addRow(array($titre,
1274
				$table->addRow(array($titre,
1271
					     BAZ_ABONNE,
1275
						   /*    BAZ_ABONNE,
1272
					     '<a href='.$lien_se_desabonner->getURL().'>'.BAZ_SE_DESABONNER.'</a>',
1276
						   '<a href='.$lien_se_desabonner->getURL().'>'.BAZ_SE_DESABONNER.'</a>', */
1273
					     '<a href='.$lien_RSS->getURL().'><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'"></a>'));
1277
						     '<a href="'.$lien_RSS->getURL().'"><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'"></a>'));
1274
			$lien_RSS->removeQueryString('annonce');
1278
				$lien_RSS->removeQueryString('annonce');
1275
		}
1279
			}
1276
		else {
1280
			else {
1277
			$lien_RSS->addQueryString('annonce', $ligne['bn_id_nature']);
1281
				$lien_RSS->removeQueryString('inscrip');
1278
			$table->addRow(array($titre,
1282
				$table->addRow(array($titre,
1279
			                     BAZ_PAS_ABONNE,
1283
				                  /*    BAZ_PAS_ABONNE,
1280
			                     '<a href='.$lien_s_abonner->getURL().'>'.BAZ_S_ABONNER.'</a>',
1284
				                    '<a href='.$lien_s_abonner->getURL().'>'.BAZ_S_ABONNER.'</a>', */
1281
					     '<a href='.$lien_RSS->getURL().'><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'" /></a>'));
1285
						     '<a href="'.$lien_RSS->getURL().'"><img src="client/bazar/images/BAZ_rss.png" alt="'.BAZ_RSS.'" /></a>'));
1282
			$lien_RSS->removeQueryString('annonce');
-
 
1283
		}
1286
			}
1284
	}
1287
		}
1285
	$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
1288
		$table->altRowAttributes(1, array('class' => 'ligne_impaire'), array('class' => 'ligne_paire'));
1286
	$table->updateColAttributes(0, array('id' => 'col1'));
1289
		$table->updateColAttributes(0, array('class' => 'col1'));
1287
	$table->updateColAttributes(1, array('id' => 'col2'));
1290
		$table->updateColAttributes(1, array('class' => 'col2'));
1288
	$table->updateColAttributes(2, array('id' => 'col3'));
-
 
1289
	$table->updateColAttributes(3, array('id' => 'col4'));
-
 
1290
	$res.=$table->toHTML() ;
1291
		$res.=$table->toHTML() ;
1291
	}
1292
	}
1292
	else { 
1293
	else { 
1293
		$res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ;
1294
		$res .= '<p class="zone_info">'.BAZ_IDENTIFIEZ_VOUS_POUR_SAISIR.'</p>'."\n" ;
1294
		$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ;
1295
		$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ;
Line 1396... Line 1397...
1396
}
1397
}
Line 1397... Line 1398...
1397
 
1398
 
1398
/* +--Fin du code ----------------------------------------------------------------------------------------+
1399
/* +--Fin du code ----------------------------------------------------------------------------------------+
1399
*
1400
*
-
 
1401
* $Log: not supported by cvs2svn $
-
 
1402
* Revision 1.74  2007-10-25 09:41:31  alexandre_tb
-
 
1403
* mise en place de variable de session pour eviter que les formulaires soit valider 2 fois, pour les url, fichiers et image
1400
* $Log: not supported by cvs2svn $
1404
*
1401
* Revision 1.73  2007-10-24 13:27:00  alexandre_tb
1405
* Revision 1.73  2007-10-24 13:27:00  alexandre_tb
1402
* bug : double saisie d url
1406
* bug : double saisie d url
1403
* suppression de warning sur variable
1407
* suppression de warning sur variable
1404
*
1408
*