<?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  24/01/11, 19:24
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
  @brief code is part of execution search suggest
*/
      if(!isset($_GET['search'])) exit;
      else $sh=tep_db_input(utf8_encode(strtolower($_GET['search'])));
      $sql = "SELECT pd.products_name, pd.products_id FROM " . TABLE_PRODUCTS . " p, ".TABLE_PRODUCTS_DESCRIPTION." pd ," . TABLE_PRODUCTS_TO_CATEGORIES . " p2c,  " . TABLE_CATEGORIES . "  c WHERE p.products_id = pd.products_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' and ( pd.products_name like '%" . $sh . "%'  ) and p2c.products_id=p.products_id and c.categories_id=p2c.categories_id and c.categories_status='1' LIMIT 15";
      $product_query = $DB->query($sql);

      while($product_array = $product_query->fetchAssoc())
        echo '<a href="'.tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_array['products_id']).'">'.$product_array['products_name'].'</a>'."\n";

?>