<?php
/**
 * Avalanche for Magento 1.8+
 * Designed by Fast Division (http://fastdivision.com)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * http://fastdivision.com/legal/license.txt
 *
 * @author     Fast Division
 * @version    1.5.0
 * @copyright  Copyright 2013 Fast Division
 * @license    http://fastdivision.com/legal/license.txt
 */
?>
<div class="grid_12 white-box">
    <h1 style="margin:0"><?php echo $this->__('Catalog Advanced Search') ?></h1>

    <div class="white-box-inner">
        <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
        <?php if($this->getResultCount()): ?>
            <p class="advanced-search-amount">
                <?php echo $this->helper('catalogsearch')->__('<strong>%d item(s)</strong> were found using the following search criteria', $this->getResultCount()); ?>
            </p>
        <?php else: ?>
            <p class="error-msg"><?php echo $this->helper('catalogsearch')->__('No items were found using the following search criteria.');?> <a href="<?php echo $this->getFormUrl(); ?>"><?php echo $this->helper('catalogsearch')->__('Modify your search'); ?></a></p>
        <?php endif; ?>

        <div class="advanced-search-summary">
            <?php $searchCriterias=$this->getSearchCriterias(); ?>
                <?php foreach (array('left', 'right') as $side): ?>
                    <?php if(@$searchCriterias[$side]): ?>
                        <ul>
                            <?php foreach($searchCriterias[$side] as $criteria): ?>
                                <li><strong><?php echo $this->escapeHtml($this->helper('catalog')->__($criteria['name'])); ?>:</strong> <?php echo $this->escapeHtml($criteria['value']); ?></li>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>
                <?php endforeach; ?>
            <?php if($this->getResultCount()): ?>
                <p>
                    <?php echo $this->helper('catalogsearch')->__("Don't see what you're looking for?"); ?>
                    <a href="<?php echo $this->getFormUrl(); ?>"><?php echo $this->helper('catalogsearch')->__('Modify your search'); ?></a>
                </p>
            <?php endif; ?>
        </div>
        <?php if($this->getResultCount()): ?>
            <?php echo $this->getProductListHtml() ?>
        <?php endif; ?>
        <?php $this->getSearchCriterias(); ?>
    </div>
</div>