<div class="navbar pjVpFilters">
	<div class="row pjVpFiltersTop">
		<div class="collapse navbar-collapse pjVpFiltersNav" id="pjVpFiltersNav">
			<ul class="nav navbar-nav">
				<li class="dropdown active pjVpFilter">
					<a href="#" class="dropdown-toggle" data-pj-toggle="dropdown" role="button" aria-expanded="false"><?php __('front_label_filter_by_season');?> <span class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<?php
						foreach (__('filter_seasons', true) as $k => $v)
						{
							?>
							<li>
								<a href="#" class="pjVpFilterSeason" data-id="<?php echo $k;?>">
									<?php echo $v; ?>
									<span class="badge"><?php echo $tpl['season_arr'][$k];?></span>
								</a>
							</li>
							<?php
						} 
						?>
					</ul>
				</li>
				<?php
				if(!empty($tpl['type_arr']))
				{ 
					?>
					<li class="dropdown pjVpFilter">
						<a href="#" class="dropdown-toggle" data-pj-toggle="dropdown" role="button" aria-expanded="false"><?php __('front_label_filter_by_type'); ?> <span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<?php
							foreach ($tpl['type_arr'] as $v)
							{
								?>
								<li>
									<a href="#" class="pjVpFilterType" data-id="<?php echo $v['id'];?>">
										<?php echo $v['name']; ?>
										<span class="badge"><?php echo $v['number_of_packages'];?></span>
									</a>
								</li>
								<?php
							} 
							?>
						</ul>
					</li>
					<?php
				} 
				?>
				
				<li class="dropdown pjVpFilter pjVpFilterPrice">
					<a href="#" class="dropdown-toggle" data-pj-toggle="dropdown" role="button" aria-expanded="false"><?php __('front_label_filter_by_price'); ?> <span class="caret"></span></a>
					
					<div class="dropdown-menu">
						<p>
							<span id="pjVpFilterPriceLabel_<?php echo $index;?>" class="pjVpSliderAmount"></span>
						</p>
												
						<div id="pjVpFilterPrice_<?php echo $index;?>" class="slider-range slider-price pjVpSliderRange" data-currency="<?php echo $tpl['option_arr']['o_currency'];?>"></div><!-- /.form-group -->
					</div><!-- /.dropdown-menu -->
				</li>
				
				<li class="dropdown pjVpFilter pjVpFilterPrice">
					<a href="#" class="dropdown-toggle" data-pj-toggle="dropdown" role="button" aria-expanded="false"><?php __('front_label_filter_by_rating'); ?> <span class="caret"></span></a>
					
					<div class="dropdown-menu">
						<p>
							<input type="text" class="amount amount-rating pjVpSliderAmount" readonly />
							<span id="pjVpFilterRatingLabel_<?php echo $index;?>" class="pjVpSliderAmount"></span>
						</p>
												
						<div id="pjVpFilterRating_<?php echo $index;?>" class="slider-range slider-rating pjVpSliderRange"></div><!-- /.form-group -->
					</div><!-- /.dropdown-menu -->
				</li>
			</ul><!-- /.nav navbar-nav -->
			
			<form class="navbar-form navbar-left" role="search">
				<div class="form-group">
					<input type="text" id="pjVpFilterLocation_<?php echo $index;?>" value="<?php echo isset($_GET['location']) && pjUtil::isValidParam($_GET['location']) ? stripslashes($_GET['location']) : null;?>" class="form-control pjVpFilterField" placeholder="<?php __('front_label_type_country');?>">
				</div>
			</form>
			<?php
			if(isset($has_filter) && $has_filter == true)
			{ 
				?>		
				<ul class="nav navbar-nav navbar-right">
					<li>
						<button class="btn btn-link pjVpBtn pjVpBtnLink pjVpBtnClearFilters" onclick="window.location.href='<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjListings&amp;action=pjActionListings<?php echo isset($_GET['iframe']) ? '&amp;iframe' : NULL; ?>'">
							<i class="fa fa-times"></i>
							<?php __('front_link_clear_filter'); ?>
						</button>
					</li>
				</ul>
				<?php
			} 
			?>
		</div><!-- /.navbar-collapse -->
		<?php
		if(isset($_GET['season']) || isset($_GET['type']) || (isset($_GET['price_from']) && isset($_GET['price_to'])) || (isset($_GET['rating_from']) && isset($_GET['rating_to'])) || isset($_GET['location']))
		{ 
			?>
			<ul class="list-inline pjVpChosenFilters">
				<?php
				if(isset($_GET['season']))
				{ 
					$season_filter_arr = explode(",", $_GET['season']);					
					foreach (__('filter_seasons', true) as $k => $v)
					{
						$season_arr = $season_filter_arr;
						if(in_array($k, $season_filter_arr))
						{
							$season_arr = array_diff($season_arr, array($k));
							?>
							<li>
								<div class="label label-default">
									<?php echo $v; ?>
									<a class="btn btn-xs btn-default pjVpBtn pjVpRemoveFilter" data-field="season" data-id="<?php echo !empty($season_arr) ? implode(',', $season_arr) : NULL;?>" href="#">
										<i class="fa fa-times"></i>
									</a>
								</div><!-- /.label label-default -->
							</li>
							<?php
						}
					}
				}
				if(isset($_GET['type']))
				{
					$type_filter_arr = explode(",", $_GET['type']);
					foreach ($tpl['type_arr'] as $v)
					{
						$type_arr = $type_filter_arr;
						if(in_array($v['id'], $type_filter_arr))
						{
							$type_arr = array_diff($type_arr, array($v['id']));
							?>
							<li>
								<div class="label label-default">
									<?php echo $v['name']; ?> 
									<a class="btn btn-xs btn-default pjVpBtn pjVpRemoveFilter" data-field="type" data-id="<?php echo !empty($type_arr) ? implode(',', $type_arr) : NULL;?>" href="#">
										<i class="fa fa-times"></i>
									</a>
								</div><!-- /.label label-default -->
							</li>
							<?php
						}
					}
				}
				if(isset($_GET['price_from']) && isset($_GET['price_to']))
				{
					$filter_price_from = pjUtil::formatCurrencySign($_GET['price_from'], $tpl['option_arr']['o_currency']);
					$filter_price_to = pjUtil::formatCurrencySign($_GET['price_to'], $tpl['option_arr']['o_currency']);
					?>
					<li>
						<div class="label label-default">
							<?php echo $filter_price_from . ' - ' . $filter_price_to;?>
							<a class="btn btn-xs btn-default pjVpBtn pjVpRemoveFilter" data-field="price" href="#">
								<i class="fa fa-times"></i>
							</a>
						</div><!-- /.label label-default -->
					</li>
					<?php
				}
				if(isset($_GET['rating_from']) && isset($_GET['rating_to']))
				{
					$filter_rating_from = $_GET['rating_from'] . ' ' . ($_GET['rating_from'] != 1 ? __('front_label_stars', true) : __('front_label_star', true));
					$filter_rating_to = $_GET['rating_to'] . ' ' . ($_GET['rating_to'] != 1 ? __('front_label_stars', true) : __('front_label_star', true));
					?>
					<li>
						<div class="label label-default">
							<?php echo $filter_rating_from . ' - ' . $filter_rating_to;?>
							<a class="btn btn-xs btn-default pjVpBtn pjVpRemoveFilter" data-field="rating" href="#">
								<i class="fa fa-times"></i>
							</a>
						</div><!-- /.label label-default -->
					</li>
					<?php
				}
				if(isset($_GET['location']) && pjUtil::isValidParam($_GET['location']))
				{
					?>
					<li>
						<div class="label label-default">
							<?php echo $_GET['location'];?>
							<a class="btn btn-xs btn-default pjVpBtn pjVpRemoveFilter" data-field="location" href="#">
								<i class="fa fa-times"></i>
							</a>
						</div><!-- /.label label-default -->
					</li>
					<?php
				} 
				?>
			</ul><!-- /.list-inline pjVpChosenFilters -->
			<?php
		} 
		?>
	</div><!-- /.row pjVpFiltersTop -->
</div><!-- /.navbar pjVpFilters -->