<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.0.9
  @date  21/05/10, 08:32
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8

  Flux valide W3c RSS 2.0
*/
require(DIR_WS_CLASSES . 'tracked_stock.php');
$tracked_stock = new tracked_stock();
$l=$tracked_stock->db_low_stock();

print "    <description>".constant('DESC_'.strtoupper($_GET['box']))."</description>\n";
print "    <link>".HTTP_SERVER.DIR_WS_CATALOG."</link>\n";

foreach($l as $p) {
  print '    <item>' . "\n";
  if(isset($p['option']) &&  is_array($p['option'])) {
    print '      <title>' . htmlspecialchars($p['products_name'].' '.implode(' ,',$p['option'])) . '</title>'. "\n";
    print '      <description> Stock: ' .  $p['option_stock']  . '</description>' . "\n";
    print '      <stock>' .  $p['option_stock']  . '</stock>' . "\n";
  } else {
    print '      <title>' . htmlspecialchars($p['products_name']) . '</title>'. "\n";
    print '      <description> Stock: ' .  $p['stock']  . '</description>' . "\n";
    print '      <stock>' . $p['stock'] . '</stock>'. "\n";
  }
  print '      <link>' . tep_href_link(FILENAME_PRODUCTS, 'pID=' . $p['products_id'], 'NONSSL') . '</link>' . "\n";
  print '    </item>' . "\n";
}
?>