<?php
mt_srand();
$index = mt_rand(1, 9999);
$listing_for = __('listing_for', true);
$feature_types = __('feature_types', true);
$range = array(5, 10, 15, 20, 25, 50, 100);
?>
<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">
								<div class="ylFormCol">
									<div class="ylRadioContainer">
										<input type="radio" id="radio3" name="for" class="ylRadio" value="rent">
										<label for="radio3"><?php echo $listing_for['rent']?></label>
									</div>
									<div class="ylRadioContainer">
										<input type="radio" id="radio4" name="for" class="ylRadio" value="sale">
										<label for="radio4"><?php echo $listing_for['sale']?></label>
									</div>
								</div><!-- /.ylFormCol -->
							</div><!-- /.ylFormRow -->
							<div class="ylFormRow">
								<div class="ylFormCol">
									<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><!-- /.ylFormCol -->
								<div class="ylFormCol">
									<label><?php __('front_model');?>:</label>

									<input class="ylField" type="text">
								</div><!-- /.ylFormCol -->

								<div class="ylFormCol">
									<label><?php __('front_reference_id');?>:</label>

									<input class="ylField" type="text">
								</div><!-- /.ylFormCol -->
							</div><!-- /.ylFormRow -->
							
							<div class="ylFormRow">
								<div class="ylFormCol">
									<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><!-- /.ylFormCol -->

								<div class="ylFormCol">
									<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><!-- /.ylFormCol -->
								<div class="ylFormCol">
									<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><!-- /.ylFormCol -->
							</div><!-- /.ylFormRow -->
							
							<div class="ylFormRow">
								<div class="ylFormCol">
									<label><?php echo $feature_types['fuel']; ?>:</label>

									<select name="feature_fuel_id">
										<option value="">-- <?php echo __('front_all'); ?> --</option>
										<?php
										foreach ($tpl['feature_arr']['fuel'] as $v)
										{
											?><option value="<?php echo $v['id']; ?>"><?php echo stripslashes($v['name']); ?></option><?php
										}
										?>
									</select>
								</div><!-- /.ylFormCol -->

								<div class="ylFormCol">
									<label><?php echo $feature_types['engine']; ?>:</label>

									<select name="feature_engine_id">
										<option value="">-- <?php echo __('front_all'); ?> --</option>
										<?php
										foreach ($tpl['feature_arr']['engine'] as $v)
										{
											?><option value="<?php echo $v['id']; ?>"><?php echo stripslashes($v['name']); ?></option><?php
										}
										?>
									</select>
								</div><!-- /.ylFormCol -->

								<div class="ylFormCol">
									<label><?php echo $feature_types['hull']; ?>:</label>

									<select name="feature_hull_id">
										<option value="">-- <?php echo __('front_all'); ?> --</option>
										<?php
										foreach ($tpl['feature_arr']['hull'] as $v)
										{
											?><option value="<?php echo $v['id']; ?>"><?php echo stripslashes($v['name']); ?></option><?php
										}
										?>
									</select>
								</div><!-- /.ylFormCol -->
							</div><!-- /.ylFormRow -->
							
							<div class="ylFormRow">
								<div class="ylFormCol">
									<label><?php echo $feature_types['yacht']; ?>:</label>

									<select name="feature_yacht_id">
										<option value="">-- <?php echo __('front_all'); ?> --</option>
										<?php
										foreach ($tpl['feature_arr']['yacht'] as $v)
										{
											?><option value="<?php echo $v['id']; ?>"><?php echo stripslashes($v['name']); ?></option><?php
										}
										?>
									</select>
								</div><!-- /.ylFormCol -->

								<div class="ylFormCol">
									<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><!-- /.ylFormCol -->

								<div class="ylFormCol">
									<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><!-- /.ylFormCol -->
							</div><!-- /.ylFormRow -->
							<div class="ylFormControls">
								<input type="submit" class="ylBtn ylBtnSubmit" value="<?php __('front_search_yatchs');?>">
							</div><!-- /.ylFormControls -->
						</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';?>