<? $count = intVal($settings['default_number_of_tiles']) > 0? intVal($settings['default_number_of_tiles']) : 8;?>
<? //if ($count > $result['total']) $count = $result['total'];?>
<div class="adc-vendors-tiles adc-responsive <?=sizeof($result['rows']) == 0? 'no-results' : ''?>" 
	data-total="<?=$result['total']?>" 
	data-number-of-tiles="<?=$count?>"
	data-ajax-url="<?=$ajax_url?>"
	data-search="<?=$search['q']?>"
	data-category="<?=$search['category']?>">
	<? if ($settings['listing_module_header']):?>
	<div class="adc-head-title">
		<?=$settings['listing_module_header_text'] ?>
	</div>
	<? endif;?>
	<div class="top-controls" data-sticky-offset="<?=get_option("adc_tiles_sticky_offset")?>">
		<span class="filter-wrapper <?=$settings['category_filter']? 'filter-wrapper-with-category' : '' ?> <?=$settings['common_search']? 'filter-wrapper-with-search' : '' ?>">
			<? if ($settings['category_filter']):?>
			<span class="category-wrapper">
				<select id="adc-categories" class="adc-category-filter">
					<option value="0">Categories</option>
					<? foreach($categories as $cat): ?>
					<option value="<?=$cat['id']?>" <?=$search['category'] == $cat['id']? 'selected="1"' : ''?>><?=$cat['title'] ?></option>
					<? endforeach;?>
				</select>
			</span>
			<? endif;?>
			<? if ($settings['common_search']):?>
			<span class="adc-search-box">
				<span class="txt-search-wrapper ">
					<input type="text" id="adc-search" class="txt-search" value="<?=$search['q']?>"/>
				</span>
				<i class="fa fa-times-circle-o adc-search-reset" aria-hidden="true"></i>
			</span>
			<? endif;?>
		</span><span class="pager-wrapper">
			<? if ($settings['counter_of_displayed_tiles']):?>
			<span class="counter">Showing <span class="counter-showing"><?=$count?></span> of <span  class="counter-total"><?=$result['total']?></span></span>
			<? endif;?>
			<span class="links">				
				<? if ($settings['view_less']):?>
				<a href="javascript:void(0)" class="adc-view-less disabled">View less</a> 
					<? if ($settings['view_more'] || $settings['show_all']):?>
					| 
					<? endif;?>
				<? endif;?>
				<? if ($settings['view_more']):?>
					<a href="javascript:void(0)" class="adc-view-more">View more</a> 
					<? if ($settings['show_all']):?>
					| 
					<? endif;?>
				<? endif;?>
				<? if ($settings['show_all']):?>
				<a href="javascript:void(0)" class="adc-show-all">Show all</a>
				<? endif;?>
			</span>
		</span>
	</div>	
	<div class="adc-tiles-container">
	<? foreach(array_slice($result['rows'], 0, $count) as $product):?>
		<? @include(dirname(__FILE__)."/vendor_tile.php");?>
	<? endforeach;?>
	</div>
	<div class="spinner"><i class="fa fa-spinner fa-spin" aria-hidden="true"></i></div>
	<div class="not-found">No Results</div>
	<div class="clearfix"></div>
</div>
