<?php
/**
  @licence GPL 2005-2011  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  21/03/11, 14:23
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8

*/
$i=0;
?>
<div id="homeStock" class="<?php echo $widg['class'] ?>">
 <h3><a href="<?php echo tep_href_link(FILENAME_STATS,'module=stats_low_stock_attrib') ?>"><?php echo __('heading stock') ;?></a></h3>
<?php
if(!class_exists('tracked_stock'))require_once(DIR_WS_CLASSES . 'tracked_stock.php');
$tracked_stock = new tracked_stock();
$l=$tracked_stock->db_low_stock();
?>
  <ul>
    <?php foreach(@$l as $p) : ?>
      <?php if(isset($p['option']) && is_array($p['option'])) { ?>
	<li><?php echo htmlspecialchars($p['products_name'].' '.implode(' ,',$p['option'])) ;?> <strong> <?php echo 'x '.$p['option_stock'] ?> </strong> </li>
      <?php } else { ?>
	<li><?php echo htmlspecialchars($p['products_name']) ;?> <strong> <?php echo 'x '.$p['stock'] ?> </strong></li>
      <?php } ?>
    <?php if($i++ > 8) {echo '....'; break;} endforeach; ?>
  </ul>

 <div class="separator"></div>
 </div>
