<?php
mt_srand();
$index = mt_rand(1, 9999);
$listing_for = __('listing_for', true);
?>
<br/>
<div id="ylContainer_<?php echo $index;?>" class="ylContainer">
	<?php include_once ROOT_PATH . PJ_TEMPLATE_PATH . $tpl['option_arr']['o_layout']. '/elements/header.php';?>
	<div class="ylMain">
		<div class="ylDetails">
			<div class="ylDetailsHead">
				<h1><?php __('front_search_for_yachts');?></h1>
			</div><!-- /.ylDetailsHead -->
		</div><!-- ylDetails -->
		<div class="ylDetailsInfo">
			<div class="ylSection">
				<div class="ylSectionBody">
					<div class="ylForm ylFormSearch">
						<form id="frmSearch" name="frmSearch" method="get">
							<input type="hidden" value="pjListings" name="controller">
							<input type="hidden" value="pjActionYachts" name="action">
							<input type="hidden" value="1" name="listing_search">
							<div class="ylFormRow">
								<label>&nbsp;</label>

								<div class="ylFormColInner">
									<input type="radio" id="radio3" name="for" value="rent">

									<label for="radio3"><?php echo $listing_for['rent']?></label>

									<input type="radio" id="radio4" name="for" value="sale">

									<label for="radio4"><?php echo $listing_for['sale']?></label>
								</div><!-- /.ylFormColInner -->
							</div><!-- /.ylFormRow -->
							<div class="ylFormCol">
								<div class="ylFormRow">
									<label><?php __('front_manufacturer');?>:</label>
									<select name="manufacturer_id">
										<option value="">-- <?php __('front_all');?> --</option>
										<?php
										foreach($tpl['manufacturer_arr'] as $v)
										{
											?><option value="<?php echo $v['id']?>"><?php echo $v['name']?></option><?php
										} 
										?>
									</select>
								</div><!-- /.ylFormRow -->
								<div class="ylFormRow">	
									<label><?php __('front_model');?>:</label>

									<input class="ylField" name="listing_model" type="text">
								</div><!-- /.ylFormRow -->
								<div class="ylFormRow">	
									<label><?php __('front_reference_id');?>:</label>

									<input class="ylField" name="listing_refid" type="text">
								</div><!-- /.ylFormRow -->
								<div class="ylFormRow">
									<label><?php __('front_year');?>:</label>
									<div class="ylFormColInner">
										<select name="min_year">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											$y = date("Y");
											foreach (range($y, 1900) as $v)
											{
												?><option value="<?php echo $v; ?>"><?php echo $v; ?></option><?php
											}
											?>
										</select>
										<span><?php echo __('front_to'); ?></span>
										<select name="max_year">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											$y = date("Y");
											foreach (range($y, 1900) as $v)
											{
												?><option value="<?php echo $v; ?>"><?php echo $v; ?></option><?php
											}
											?>
										</select>
									</div><!-- /.ylFormColInner -->
								</div><!-- /.ylFormRow -->
								<div class="ylFormRow">
									<label><?php __('front_horsepower');?>:</label>

									<div class="ylFormColInner">
										<input type="text" name="min_horse_power" class="ylField">

										<span><?php echo __('front_to'); ?></span>

										<input type="text" name="max_horse_power" class="ylField">
									</div><!-- /.ylFormColInner -->
								</div><!-- /.ylFormRow -->
								<?php 
								$range = array(5, 10, 15, 20, 25, 50, 100);
								?>
								<div class="ylFormRow">
									<label><?php __('front_length');?>:</label>

									<div class="ylFormColInner">
										<select name="min_length">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											foreach ($range as $v)
											{
												?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
											}
											?>
										</select>

										<span><?php echo __('front_to'); ?></span>

										<select name="max_length">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											foreach ($range as $v)
											{
												?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
											}
											?>
										</select>
									</div><!-- /.ylFormColInner -->
								</div><!-- /.ylFormRow -->
							</div><!-- /.ylFormCol -->
							<?php
							$feature_types = __('feature_types', true);
							?>
							<div class="ylFormCol">
								<?php
								foreach($tpl['feature_arr'] as $k => $feature_arr)
								{
									?>
									<div class="ylFormRow">
										<label class="title"><?php echo $feature_types[$k]; ?></label>
										<select name="feature_<?php echo $k?>_id">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											foreach ($feature_arr as $v)
											{
												?><option value="<?php echo $v['id']; ?>"><?php echo stripslashes($v['name']); ?></option><?php
											}
											?>
										</select>
									</div>
									<?php
								} 
								?>
								<div class="ylFormRow">
									<label><?php __('front_loa');?>:</label>
									<div class="ylFormColInner">
										<select name="min_loa">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											for($i = 0; $i <= 20; $i++)
											{
												?><option value="<?php echo $i; ?>"><?php echo number_format($i); ?></option><?php
											}
											?>
										</select>

										<span><?php echo __('front_to'); ?></span>

										<select name="max_loa">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											for($i = 0; $i <= 20; $i++)
											{
												?><option value="<?php echo $i; ?>"><?php echo number_format($i); ?></option><?php
											}
											?>
										</select>
									</div><!-- /.ylFormColInner -->
								</div><!-- /.ylFormRow -->
								<div class="ylFormRow">
									<label><?php __('front_beam');?>:</label>
									<div class="ylFormColInner">
										<select name="min_beam">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											foreach ($range as $v)
											{
												?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
											}
											?>
										</select>

										<span><?php echo __('front_to'); ?></span>

										<select name="max_beam">
											<option value="">-- <?php echo __('front_all'); ?> --</option>
											<?php
											foreach ($range as $v)
											{
												?><option value="<?php echo $v; ?>"><?php echo number_format($v); ?></option><?php
											}
											?>
										</select>
									</div><!-- /.ylFormColInner -->
								</div><!-- /.ylFormRow -->
								<div class="ylFormControls">
									<input type="submit" class="ylBtn ylBtnSubmit" value="<?php __('front_search_yatchs');?>">
								</div><!-- /.ylFormControls -->
							</div><!-- /.ylFormCol -->
						</form>
					</div><!-- ylForm ylFormSearch -->
				</div><!-- ylSectionBody -->
			</div><!-- ylSection -->
		</div><!-- ylDetailsInfo -->
	</div><!-- /.ylMain -->
</div>
<?php include_once ROOT_PATH . PJ_TEMPLATE_PATH . $tpl['option_arr']['o_layout']. '/elements/loadjs.php';?>