<?php
/*
 * @package Sj K2 Filter
 * @version 1.1.0
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @copyright (c) 2016 YouTech Company. All Rights Reserved.
 * @author YouTech Company http://www.smartaddons.com
 *
 */

defined('_JEXEC') or die;

$i = 0;
// echo "<pre>";print_r($glist['items']);die();
foreach ($glist['items'] as $key => $exfield):
	$magicSelect = '';
	$fieldTypes = explode("_",$key);
	if($fieldTypes[0] == 'magicSelect'){
		$magicSelect = ' class="magic-select"';
	}
	$last = ($i == count($list)-1)?'class="li-last"':'';
	$i++;
	$style = '';
	if($params->get('mod_column') >0 && (($j) % $params->get('mod_column')) == 0){
		$clear = " clear:both;";
	}
	if($mod_column || $clear){
		$style ='style="'.$mod_column.$clear.'"';
	}
	$j++;

	?>
	<li <?php echo $style;?> <?php echo $magicSelect;?> class="item-box">
		<div class="filter-input filter-field">
			<?php echo $exfield; ?>
		</div>
	</li>
	<?php
	$clear = '';
endforeach;
?>