<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  15/12/10, 21:14
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/

?>
<div class="modules">
  <h4 class="center_title_bar"><?php echo unhtmlentities($themodule->module_db->title) ;?></h4>
  <?php if(isset($ele->text)): ?>
    <p><?php echo unhtmlentities($themodule->module_db->text) ;?></p>
  <?php endif; ?>


  <?php if (  isset($themodule->module_db->split) && ($themodule->module_db->split->number_of_rows > 0) && (in_array(PREV_NEXT_BAR_LOCATION ,array('1','3') )) ) { ?>
    <div id="splitPageTop" class="splitnav">
      <p class="sP1"><?php echo $themodule->module_db->split->display_count(TEXT_DISPLAY_NUMBER_OF); ?></p>
      <p class="sP2"><?php echo TEXT_RESULT_PAGE . ' ' . $themodule->module_db->split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></p>
    </div>
  <?php } ?>

  <?php foreach($themodule->module_db->content as $ele): ?>

    <?php if(isset($ele->products_id)): /** PRODUCTS */ ?>
      <div class="prod_box">
	<div class="top_prod_box"></div>
	  <div class="center_prod_box">
	      <?php if ($page->_draw_in_page('PRODUCT_LIST_NAME')) { ?>
		<p class="product_title"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $ele->products_id) . '">' . $ele->products_name . '</a>' ;?></p>
	      <?php } ?>

	      <?php if ($page->_draw_in_page('PRODUCT_LIST_IMAGE')) { ?>
		<p class="product_img"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $ele->products_id) . '">' . tep_image(DIR_WS_IMAGES . @$ele->products_image, $ele->products_name, $page->_conf_value('SMALL_IMAGE_WIDTH'), $page->_conf_value('SMALL_IMAGE_HEIGHT')) . '</a>' ; ?></p>
	      <?php } ?>

	      <?php if (tep_not_null($ele->products_price) && $page->_draw_in_page('PRODUCT_LIST_PRICE')) { ?>
		<p class="prod_price">
		  <?php echo print_products_price_rv($ele) ?>
		</p>
	      <?php } ?>
	  </div>
	  <div class="bottom_prod_box"></div>

	  <div class="prod_details_tab">

	    <?php  if ( $page->_draw_in_page('PRODUCT_LIST_BUY_NOW')) { ?>
		<?php if (_test_bool($ele->action['buy'] )) : ?>
		<?php echo tep_draw_form($themodule->id.'cart_quantity'.$ele->products_id, tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
		<p>
		  <?php echo tep_draw_hidden_field('products_id', $ele->products_id). tep_draw_hidden_field('products_quantity', '1'); ?>
		  <input title="header=[<?php echo __('add to cart') ?>] body=[&nbsp;] fade=[on]" type="image" src="<?php echo $page->getPathTemplate() ?>images/cart.gif" onclick="this.form.submit()"/>
		</p>
		</form>
		<?php elseif (count(product_attribut_info($ele->products_id)) != 0): ?>
		  <p><a class="submitBt" href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO,'products_id='.$ele->products_id)?>" ><img border="0" class="left_bt" title="" alt="" src="<?php echo $page->getPathTemplate() ?>images/cart.gif"></a></p>
		<?php endif; ?>
	    <?php } ?>

	    <?php /* if ( $page->_draw_in_page('PRODUCT_LIST_BUY_NOW')) {*/ ?>
		<?php echo tep_draw_form($themodule->id.'wishlist_quantity'.$ele->products_id, tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=add_wishlist'), 'post', ' class="left_bt" '); ?>
		<p>
		  <?php echo tep_draw_hidden_field('products_id', $ele->products_id). tep_draw_hidden_field('products_quantity', '1'); ?>
		  <input title="header=[<?php echo __('add to wishlist') ?>] body=[&nbsp;] fade=[on]" type="image" src="<?php echo $page->getPathTemplate() ?>images/favs.gif" onclick="this.form.submit()"/>
		</p>
		</form>
	    <?php /*}*/ ?>

	     <a class="prod_details" href="<?php echo  tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $ele->products_id) ?>"  title="header=[<?php echo __('view more') ?>] body=[&nbsp;] fade=[on]"><?php echo __('more') ?></a>
        </div>
      </div>
    <?php elseif(isset($ele->content_id)) : /** POSTS */ ?>
      <dl class="listing contents <?php echo $page->page_content_clean() ?>">
        <dt class="listing_s">
          <a id="<?php echo $ele->content_id; ?>" href="<?php echo tep_href_link(FILENAME_CONTENT,'content='.$ele->content_id) ;  ?>" ><?php echo $ele->content_title ?></a>
        </dt>
      </dl>

    <?php elseif(isset($ele->categories_id)): /** CATEGORIES */ ?>
      <div class="prod_box">
	<div class="top_prod_box"></div>
	  <div class="center_prod_box">
	    <div class="categoriesThumbs">
	      <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath='.$ele->cPath) . '">' . tep_image(DIR_WS_IMAGES . $ele->categories_image, $ele->categories_name,  $page->_conf_value('SUBCATEGORY_IMAGE_WIDTH'),  $page->_conf_value('SUBCATEGORY_IMAGE_HEIGHT')) . '<br />' . $ele->categories_name . '</a>' ;?>
	    </div>
	  <div class="bottom_prod_box"></div>
	</div>
      </div>
    <?php endif; ?>

  <?php endforeach; ?>

  <?php if ( isset($themodule->module_db->split) && ($themodule->module_db->split->number_of_rows > 0)&& (in_array(PREV_NEXT_BAR_LOCATION ,array('2','3') )) )  { ?>
    <div id="splitPageBottom" class="splitnav">
      <p class="sP1"><?php echo $themodule->module_db->split->display_count(TEXT_DISPLAY_NUMBER_OF); ?></p>
      <p class="sP2"><?php echo TEXT_RESULT_PAGE . ' ' . $themodule->module_db->split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></p>
    </div>
  <?php } ?>

</div>
<?php ?>