<?php
/**
 * @version		1.3 mod_annonces - petites annonces $
 * @package		simple_ads_-_petites_annonces
 * @copyright	Copyright (c) 2011 - All rights reserved.
 * @license		GNU/GPL
 * @author		Anthony JULOU
 * @author mail	ajulou@yahoo.fr
 *
 **/
defined('_JEXEC') or die('Restricted access');
$doc = &JFactory::getDocument();
$doc->addStyleSheet( JURI::base() . 'modules/mod_annonces/assets/annonces.css' );
$items = count($list);
$i = 0;
?>
<div style="clear:both"></div>
<?php foreach ($list as $annonce) :  ?>
	<div id="ad<?php echo ($params->get('layout') == 0 ? '' : '2') ?>">
		<?php echo JText::_('SALE') .' '. $annonce->catname ?>
	    <?php echo '<a href="'. JRoute::_('index.php?option=com_annonces&view=annonce&id='.$annonce->id).'&Itemid='. JRequest::getVar('Itemid', 1, 'get', 'int').'">'. $annonce->objet .'</a>'; ?><br/>
   		<span class="petit">
   			<?php echo ( $annonce->showConstructor ? '('.$annonce->constructeur.') - ' : '' ) ?> 
	    	<?php echo $annonce->datePubli ?>
   		</span><br/>
		<?php echo '<a class="modannonces_img" href="'. JRoute::_('index.php?option=com_annonces&view=annonce&id='.$annonce->id).( $params->get('contextItem') == true ? '&Itemid='. JRequest::getVar('Itemid', 1, 'get', 'int') : ''). '">' ?><img src="<?php echo $annonce->vignette_url?>" alt="" class="modannonces_img"/></a><br/>
		<?php if ( $params->get('showPrice') ) : ?>
			<?php echo JText::_('PRICE')?>: <strong><?php echo str_replace(" ", utf8_encode("\xA0"), number_format($annonce->prix, 0, '.', ' ')) .'&nbsp;'. $annonce->currency ?></strong>
		<?php endif; ?>
	</div><?php $i++; echo ( (count($list) != $i) && ($params->get('layout') == 0) ? '<hr class="ads"/>' : '') ?>
<?php endforeach; ?>
<div style="clear:both"></div>