<?php
/*
  $Id: new_products_grid.php $
  TomatoCart Open Source Shopping Cart Solutions
  http://www.tomatocart.com

  Copyright (c) 2009 Wuxi Elootec Technology Co., Ltd;

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/

?>


<?php
    $rows = 0;
    $grid_html = '';
    $_SESSION['view'] = 'grid';
    
    while ($Qproducts->next()) {
      $lc_text = null;
      
      $osC_Product = new osC_Product($Qproducts->value('products_id'));
      $products_price = $osC_Product->getPriceFormated(true);
            
      if (($rows % 4 == 0) && ($rows != 0)) {
        $grid_html .= '<div class="clear"></div>';
      }
      
      $rows++;
//      $grid_html .= '<div class="productsGrid">';
      
			$lc_text .= '<div class="productsGrid-item">'. osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $osC_Image->show($Qproducts->value('image'), $Qproducts->value('products_name')), 'id="productImage' . $Qproducts->value('products_id') . '"'). '</div>';
			$lc_text .= '<div class="productsGrid-item">&nbsp;' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id')), $Qproducts->value('products_name'), 'class="productGrid-name"') . '</div>';
			$lc_text .= '<div class="productsGrid-item">'. '<span class="productsGrid-item-price">'. $products_price. '</span></div>';
			$lc_text .= '<div class="productsGrid-item">'. osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_id') . '&action=cart_add'), osc_draw_image_button('button_add_to_cart.png', $osC_Language->get('button_add_to_cart'), 'class="ajaxAddToCart" id="ac_productsnew_' . $Qproducts->value('products_id') . '"')). '</div>';   
			            
      $grid_html .= '<div class="productsGrid">' . $lc_text . '</div>';
    }
?>
<?php
    echo $grid_html;
?>      
      <div class="clear"></div>

