<?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  16/09/10, 21:53
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/
?>
<div id="advancedSearch">
  <?php $page->messageStack->_draw('search');?>

  <h2 class="content title <?php echo $language ;?>"><?php echo HEADING_TITLE_1; ?></h2>
  <div class="prod_box_big">
    <div class="top_prod_box_big"></div>
      <div class="center_prod_box_big">
  <?php
  if ( ($replace=$page->prop_ctrl('text_search_help_link', 'text_search_help_link')) !=false) echo $replace();
  else {
    echo '<p id="text_search_help_link" class="infoText"><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_SEARCH_HELP,'&amp;popup=true') . '\')">' . TEXT_SEARCH_HELP_LINK . '</a></p>';
  } ?>

  <?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH, '', 'NONSSL', false), 'get', 'onsubmit="return check_form(this);"') ;?>

    <fieldset class="advancedSearch">
      <legend><?php echo HEADING_SEARCH_CRITERIA ; ?></legend>
      <?php echo tep_hide_session_id().tep_draw_hidden_field('search_in_description', '1') ;?>
    <ul>
      <li class="form_row">
        <label class="contact"><?php echo ENTRY_KEYWORDS ; ?></label>
        <?php echo tep_draw_input_field('keywords', 'keywords','','onfocus="this.value=\'\'"') ; ?>
      </li>

      <li class="form_row">
        <label class="contact"><?php echo ENTRY_CATEGORIES; ?></label>
        <?php echo tep_draw_pull_down_menu('categories_id', 'categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))); ?>
      </li>

      <li class="form_row check">
        <label class="contact"><?php echo ENTRY_INCLUDE_SUBCATEGORIES; ?></label>
        <?php echo tep_draw_checkbox_field('inc_subcat','inc_subcat', '1', true) ;?>
      </li>

      <li class="form_row">
        <label class="contact"><?php echo ENTRY_MANUFACTURERS; ?></label>
        <?php echo tep_draw_pull_down_menu('manufacturers_id', 'manufacturers_id', tep_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)))); ?>
      </li>

      <li class="form_row">
        <label class="contact" for="pfrom"><?php echo ENTRY_PRICE_FROM; ?></label>
        <?php echo tep_draw_input_field('pfrom','pfrom'); ?>
      </li>

      <li class="form_row">
        <label class="contact" for="pto"><?php echo ENTRY_PRICE_TO; ?></label>
        <?php echo tep_draw_input_field('pto','pto'); ?>
      </li>

      <li class="form_row">
	<label class="contact" for="dfrom"><?php echo ENTRY_DATE_FROM; ?></label>
        <?php echo tep_draw_input_field('dfrom','dfrom', DOB_FORMAT_STRING, 'onfocus="this.value=\'\'"'); ?>
      </li>

      <li class="form_row">
        <label class="contact" for="dto"><?php echo ENTRY_DATE_TO; ?></label>
        <?php echo tep_draw_input_field('dto','dto', DOB_FORMAT_STRING, 'onfocus="this.value=\'\'"'); ?>
      </li>

      <li class="form_row">
        <label class="contact" for="dto"><?php echo ENTRY_DATE_TO; ?></label>
        <?php echo tep_list_option_value_dipso(); ?>
      </li>
      <li class="formBt"><input type="submit" class="submitBt" value="<?php echo IMAGE_BUTTON_SEARCH; ?>"  /></li>
    </ul>
    </fieldset>
  </form>
      </div>
    <div class="bottom_prod_box_big"></div>
  </div>
</div>
<?php if (isset($listing_sql) && tep_not_null($listing_sql) ) {

$listing_split = new splitPageResults($listing_sql, $page->_conf_value('MAX_DISPLAY_SEARCH_RESULTS'), 'p.products_id');
?>
<div id="advancedSearchResult">

  <h2 class="content title  <?php echo $language ;?>"><?php echo HEADING_TITLE_2; ?></h2>

  <?php  $page->oscss_modules->_add(FILENAME_PRODUCT_LISTING,'center', array('listing_split'=>$listing_split,'listing_query'=>$listing_sql) ); ?>

  <div class="navBt">
    <?php echo '<a class="navBt" href="' . tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(array('sort', 'page')), 'NONSSL', true, false) . '">' . IMAGE_BUTTON_BACK . '</a>'; ?>
  </div>

</div>
      <?php } ?>