{include file="header.tpl"}
 
<div id="sidebar">
{include file="sidebar.tpl"}
</div>

<div class="mainContent">
<h1>{$smarty.const.SEARCH_HEADER}</h1>

{if $success}
	<p class="green"><strong>{$success}</strong></p>
{elseif $error_message}
	<p class="red"><strong>{$error_message}</strong></p>
{/if}

<p><a href="listings.php">Browse all Listings.</a></p>
<p>{$smarty.const.SEARCH_INSTRUCT}</p>
<fieldset>
	<legend>{$smarty.const.SEARCH_LEGEND}</legend>
		<form action="listings.php" method="post">
			<p>{$smarty.const.SEARCH_PRICE_ENTER_HELP}</p>
			<p><label for="min_price">{$smarty.const.MIN_PRICE}</label>
			<input id="min_price" name="min_price" type="text" size="15" maxlength="10" value="" />
			</p>

			<p><label for="max_price">{$smarty.const.MAX_PRICE}</label>
			<input id="max_price" name="max_price" type="text" size="15" maxlength="10" value="" />
			</p>
			
			{if $use_zip_search}
			<hr />
			<p>{$smarty.const.SEARCH_ZIP_INSTRUCT}</p>
			<p><label for="start_zip">{$smarty.const.ZIP}</label>
			<input id="start_zip" name="start_zip" type="text" size="6" maxlength="6" value="" />
			
			<select id="zip_range" name="zip_range" size="1">
				<option value="" selected="selected">Distance</option>
				<option value="">0 miles</option>
				<option value="5">5 miles</option>
				<option value="10">10 miles</option>
				<option value="15">15 miles</option>
				<option value="25">25 miles</option>
				<option value="50">50 miles</option>
				<option value="75">75 miles</option>
				<option value="100">100 miles</option>
			</select>
			</p>
			<p><label for="state">{$smarty.const.STATE}</label>
			<select id="state" name="state" size="1">
				<option value="" selected="selected">Choose State</option>
			{foreach item="state" from=$stateslist}
				<option value="{$state.state}">{$state.state}</option>
			{/foreach}
			</select>
			</p>
			
			<p><input name="submit" type="submit" value="{$smarty.const.SEARCH}" />
			</p>
			{/if}
			
			<hr />
			<p>{$smarty.const.SEARCH_SELECT_ITEM_INSTRUCT}</p>
			<p><label for="vehicle_type">{$smarty.const.TYPE}</label>
			<select id="vehicle_type" name="vehicle_type" size="1">
				<option value="" selected="selected">{$smarty.const.SEARCH_CHOOSE_FEATURE}</option>
			{foreach item="vehicle_type" from=$typeslist}
				<option value="{$vehicle_type.vehicle_type}">{$vehicle_type.vehicle_type}</option>
			{/foreach}
			</select>
			</p>
			
			<p><label for="make">{$smarty.const.MANUFACTURER}</label>
			<select id="make" name="make" size="1">
				<option value="" selected="selected">{$smarty.const.SEARCH_CHOOSE_FEATURE}</option>
			{foreach item="manufacturer" from=$manufacturerslist}
				<option value="{$manufacturer.make}">{$manufacturer.make}</option>
			{/foreach}
			</select>
			</p>

			<p><label for="model">{$smarty.const.MODEL}</label>
			<select id="model" name="model" size="1">
				<option value="" selected="selected">{$smarty.const.SEARCH_CHOOSE_FEATURE}</option>
			{foreach item="model" from=$modelslist}
				<option value="{$model.model}">{$model.model}</option>
			{/foreach}
			</select>
			</p>

			<p><label for="year">{$smarty.const.YEAR}</label>
			<select id="year" name="year" size="1">
				<option value="" selected="selected">{$smarty.const.SEARCH_CHOOSE_FEATURE}</option>
			{foreach item="year" from=$yearslist}
				<option value="{$year.year}">{$year.year}</option>
			{/foreach}
			</select>
			</p>

			<p><label for="listing_condition">{$smarty.const.CONDITION}</label>
			<select id="listing_condition" name="listing_condition" size="1">
				<option value="" selected="selected">{$smarty.const.SEARCH_CHOOSE_FEATURE}</option>
			{foreach item="condition" from=$conditionslist}
				<option value="{$condition.listing_condition}">{$condition.listing_condition}</option>
			{/foreach}
			</select>
			</p>

			<p><label for="trans">{$smarty.const.TRANS}</label>
			<select id="trans" name="trans" size="1">
				<option value="" selected="selected">{$smarty.const.SEARCH_CHOOSE_FEATURE}</option>
			{foreach item="trans" from=$translist}
				<option value="{$trans.trans}">{$trans.trans}</option>
			{/foreach}
			</select>
			</p>

			<p><label for="drive_train">{$smarty.const.DRIVETRAIN}</label>
			<select id="drive_train" name="drive_train" size="1">
				<option value="" selected="selected">{$smarty.const.SEARCH_CHOOSE_FEATURE}</option>
			{foreach item="drive_train" from=$drivetrainlist}
				<option value="{$drive_train.drive_train}">{$drive_train.drive_train}</option>
			{/foreach}
			</select>
			</p>

			<p><input name="submit" type="submit" value="{$smarty.const.SEARCH}" />
			</p>
		</form>
</fieldset>

</div>

{include file="footer.tpl"}