<form action="<?php echo $listingPage; ?>" method="get" id="vrSearchForm">
	<input type="hidden" name="controller" value="pjListings" />
	<input type="hidden" name="action" value="<?php echo $_GET['action'] != 'pjActionFeatured' ? $_GET['action'] : 'pjActionListings';?>" />
	<input type="hidden" name="listing_search" value="1" />
	<input type="hidden" name="previous_action" value="<?php echo $_GET['action'] != 'pjActionFeatured' ? $_GET['action'] : 'pjActionListings';?>" />
	<div class="pjVrFormSearch">
	
		<?php
		if ($tpl['option_arr']['o_lang_store'] == 'url')
		{
			?><input type="hidden" name="language" value="<?php echo $controller->getLanguage(); ?>" /><?php
		}
		if (isset($_GET['iframe']))
		{
			?><input type="hidden" name="iframe" value="" /><?php
		}
		
		$today = date("Y-m-d");
		$fToday = pjUtil::formatDate($today, "Y-m-d", $tpl['option_arr']['o_date_format']);
		
		$months = __('months', true);
		$short_months = __('short_months', true);
		ksort($months);
		ksort($short_months);
		$days = __('days', true);
		$short_days = __('short_days', true);
		
		$week_start = isset($tpl['option_arr']['o_week_start']) && in_array((int) $tpl['option_arr']['o_week_start'], range(0,6)) ? (int) $tpl['option_arr']['o_week_start'] : 0;
		$jqDateFormat = pjUtil::jqDateFormat($tpl['option_arr']['o_date_format']);
		?>
		<div class="row">
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="input-group pjVrCalendar pjVrGroupCalendar">
					<a href="#" class="input-group-addon pjVrCalendarTrigger pjVrCalendarTriggerFrom">
						<i class="fa fa-calendar"></i>
					</a>
					<input type="text" name="date_from" value="<?php echo isset($_GET['date_from']) ? htmlspecialchars($_GET['date_from']) : NULL; ?>" data-fday="<?php echo $week_start; ?>" data-dformat="<?php echo $jqDateFormat; ?>" class="form-control pjVrCalendarInput pjVrCalendarInputFrom" placeholder="<?php __('front_booking_from');?>" readonly data-months="<?php echo join(',', $months);?>" data-shortmonths="<?php echo join(',', $short_months);?>" data-day="<?php echo join(',', $days);?>" data-daymin="<?php echo join(',', $short_days);?>" />
	
					<a href="#" class="input-group-addon pjVrCalendarTrigger pjVrCalendarTriggerTo">
						<i class="fa fa-calendar"></i>
					</a>
					<input type="text" name="date_to" value="<?php echo isset($_GET['date_to']) ? htmlspecialchars($_GET['date_to']) : NULL; ?>" data-fday="<?php echo $week_start; ?>" data-dformat="<?php echo $jqDateFormat; ?>" class="form-control pjVrCalendarInput pjVrCalendarInputTo" placeholder="<?php __('front_booking_to');?>" readonly data-months="<?php echo join(',', $months);?>" data-shortmonths="<?php echo join(',', $short_months);?>" data-day="<?php echo join(',', $days);?>" data-daymin="<?php echo join(',', $short_days);?>" />
				</div><!-- /.input-group pjVrCalendar pjVrGroupCalendar -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="form-group">
					<label for=""><?php __('front_location');?>: </label>
									
					<input type="text" name="location" class="form-control" value="<?php echo isset($_GET['location']) ? htmlspecialchars($_GET['location']) : NULL; ?>"/>
				</div><!-- /.form-group -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
			
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="form-group">
					<label for=""><?php __('front_search_type'); ?>: </label>
					
					<select name="type_id" class="form-control">
						<option value="">-- <?php __('front_search_choose'); ?> --</option>
						<?php
						foreach ($tpl['type_arr'] as $v)
						{
							if (isset($_GET['type_id']) && $_GET['type_id'] == $v['id'])
							{
								?><option value="<?php echo $v['id']; ?>" selected="selected"><?php echo stripslashes($v['type_title']); ?></option><?php
							} else {
								?><option value="<?php echo $v['id']; ?>"><?php echo stripslashes($v['type_title']); ?></option><?php
							}
						}
						?>
					</select>
				</div><!-- /.form-group -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="form-group">
					<label for=""><?php __('front_search_refid');?>: </label>
									
					<input type="text" name="refid" value="<?php echo isset($_GET['refid']) ? htmlspecialchars(stripslashes($_GET['refid'])) : NULL; ?>" class="form-control" />
				</div><!-- /.form-group -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
			
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="form-group">
					<label for=""><?php __('front_search_bedrooms');?></label>
	
					<div class="row">
						<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
							<select name="bedrooms_from" class="form-control">
								<option value="">-- <?php __('front_booking_min');?> --</option>
								<?php
								foreach (range(0,10) as $v)
								{
									if (isset($_GET['bedrooms_from']) && $_GET['bedrooms_from'] != "" && $_GET['bedrooms_from'] == $v)
									{
										?><option value="<?php echo $v; ?>" selected="selected"><?php echo number_format($v); ?></option><?php
									} else {
										?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
									}
								}
								?>
							</select>
						</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-6 -->
					
						<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
							<select name="bedrooms_to" class="form-control">
								<option value="">-- <?php __('front_booking_max');?> --</option>
								<?php
								foreach (range(0,10) as $v)
								{
									if (isset($_GET['bedrooms_to']) && $_GET['bedrooms_to'] != "" && $_GET['bedrooms_to'] == $v)
									{
										?><option value="<?php echo $v; ?>" selected="selected"><?php echo number_format($v); ?></option><?php
									} else {
										?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
									}
								}
								?>
								<option value="999999"<?php echo isset($_GET['bedrooms_to']) && (int) $_GET['bedrooms_to'] == 999999 ? ' selected="selected"' : NULL; ?>><?php __('front_search_above'); ?> 10</option>
							</select>
						</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-6 -->
					</div><!-- /.row -->
				</div><!-- /.form-group -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
			
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="form-group">
					<label for=""><?php __('front_search_bathrooms');?></label>
	
					<div class="row">
						<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
							<select name="bathrooms_from" class="form-control">
								<option value="">-- <?php __('front_booking_min');?> --</option>
								<?php
								foreach (range(0,10) as $v)
								{
									if (isset($_GET['bathrooms_from']) && $_GET['bathrooms_from'] != "" && $_GET['bathrooms_from'] == $v)
									{
										?><option value="<?php echo $v; ?>" selected="selected"><?php echo number_format($v); ?></option><?php
									} else {
										?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
									}
								}
								?>
							</select>
						</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-6 -->
					
						<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
							<select name="bathrooms_to" class="form-control">
								<option value="">-- <?php __('front_booking_max');?> --</option>
								<?php
								foreach (range(0,10) as $v)
								{
									if (isset($_GET['bathrooms_to']) && $_GET['bathrooms_to'] != "" && $_GET['bathrooms_to'] == $v)
									{
										?><option value="<?php echo $v; ?>" selected="selected"><?php echo number_format($v); ?></option><?php
									} else {
										?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
									}
								}
								?>
								<option value="999999"<?php echo isset($_GET['bathrooms_to']) && (int) $_GET['bathrooms_to'] == 999999 ? ' selected="selected"' : NULL; ?>><?php __('front_search_above'); ?> 10</option>
							</select>
						</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-6 -->
					</div><!-- /.row -->
				</div><!-- /.form-group -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
			
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="form-group">
					<label for=""><?php __('front_search_adults');?></label>
	
					<div class="row">
						<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
							<select name="adults_from" class="form-control">
								<option value="">-- <?php __('front_booking_min');?> --</option>
								<?php
								foreach (range(0,10) as $v)
								{
									if (isset($_GET['adults_from']) && $_GET['adults_from'] != "" && $_GET['adults_from'] == $v)
									{
										?><option value="<?php echo $v; ?>" selected="selected"><?php echo number_format($v); ?></option><?php
									} else {
										?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
									}
								}
								?>
							</select>
						</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-6 -->
					
						<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
							<select name="adults_to" class="form-control">
								<option value="">-- <?php __('front_booking_max');?> --</option>
								<?php
								foreach (range(0,10) as $v)
								{
									if (isset($_GET['adults_to']) && $_GET['adults_to'] != "" && $_GET['adults_to'] == $v)
									{
										?><option value="<?php echo $v; ?>" selected="selected"><?php echo number_format($v); ?></option><?php
									} else {
										?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
									}
								}
								?>
								<option value="999999"<?php echo isset($_GET['adults_to']) && (int) $_GET['adults_to'] == 999999 ? ' selected="selected"' : NULL; ?>><?php __('front_search_above'); ?> 10</option>
							</select>
						</div><!-- /.col-lg-6 col-md-6 col-sm-6 col-xs-6 -->
					</div><!-- /.row -->
				</div><!-- /.form-group -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
				<div class="pjVrFormActions">
					<?php
					if(isset($_GET['listing_search']))
					{ 
						?>
						<div class="row">
							<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
								<button type="button" class="btn btn-default btn-block pjVrBtn pjVrBtnPrimary pjVrBtnSearch"><?php __('front_search_submit'); ?></button>
							</div>
							<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
								<a class="btn btn-default btn-block pjVrBtn pjVrBtnPrimary" href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?controller=pjListings&amp;action=<?php echo $_GET['action']?><?php echo $QS_LANG; ?><?php echo isset($_GET['iframe']) ? '&amp;iframe' : NULL; ?>"><?php __('front_search_reset'); ?></a>
							</div>
						</div>
						<?php
					}else{
						?><button type="button" class="btn btn-default btn-block pjVrBtn pjVrBtnPrimary pjVrBtnSearch"><?php __('front_search_submit'); ?></button><?php
					} 
					?>
				</div><!-- /.pjVrFormActions -->
			</div><!-- /.col-lg-3 col-md-3 col-sm-6 col-xs-12 -->
		</div><!-- /.row -->
	
	</div><!-- /.pjVrFormSearch -->
	<?php
	if($_GET['action'] == 'pjActionSearch' && (!isset($_GET['hidemap'])))
	{ 
		?>							
		<div id="pjVrSearchMap" class="pjVrCustomMap">
			<?php
			include dirname(__FILE__) . '/mapsearch.php';
			?>
		</div><!-- /.pjVrCustomMap -->
		<?php
	} 
	?>
	<div id="pjVrNoPropertiesModal" class="modal fade">
	  	<div class="modal-dialog">
	    	<div class="modal-content">
		      	<div class="modal-header">
		        	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        	<h4 class="modal-title"><?php __('front_search_results');?></h4>
		      	</div>
		      	<div class="modal-body">
		        	<p><?php __('front_index_empty');?></p>
		      	</div>
		      
	    		</div><!-- /.modal-content -->
	  	</div><!-- /.modal-dialog -->
	</div><!-- /.modal -->	
</form>							