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

<div class="mainContent">

<h1>Admin Center</h1>
<h2>Edit Vehicle Options Information.</h2>

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

{if $editsingle}
	{if $manufactureredit}
		<fieldset>
			<legend>Edit Vehicle Manufacturer</legend>
				<form action="vehicle_options.php" method="post">
					<h3>Edit Vehicle Manufacturer Information.</h3>
					<p><label for="option_data">{$smarty.const.MANUFACTURER}</label>
					<input id="option_data" name="option_data" type="text" size="30" maxlength="30" value="{$edit.1}" />
					</p>
					<p>
					<input name="id" type="hidden" value="{$edit.0}" />
					<input name="table" type="hidden" value="manufacturer" />
					<input name="vehicle_edit" type="submit" value="Save Changes" />
					<input name="vehicle_delete" type="submit" value="Delete Option" />
					</p>
				</form>
		</fieldset>
	{/if}
	{if $featuresedit}
		<fieldset>
			<legend>Edit Vehicle Features</legend>
				<form action="vehicle_options.php" method="post">
					<h3>Edit Vehicle Features Information.</h3>
					<p><label for="option_data">{$smarty.const.FEATURES}</label>
					<input id="option_data" name="option_data" type="text" size="30" maxlength="30" value="{$edit.1}" />
					</p>
					<p>Make this a default list item.</p>
					<p>
					<input name="lists_default" type="radio" {if $edit.2}checked="checked" {/if}value="1"> Yes
					<input name="lists_default" type="radio" {if !$edit.2}checked="checked" {/if}value="0"> No 
					</p>
					<p>
					<input name="id" type="hidden" value="{$edit.0}" />
					<input name="table" type="hidden" value="features" />
					<input name="vehicle_edit" type="submit" value="Save Changes" />
					<input name="vehicle_delete" type="submit" value="Delete Option" />
					</p>
				</form>
		</fieldset>
	{/if}
	{if $drivetrainedit}
		<fieldset>
			<legend>Edit Vehicle Drive Train </legend>
				<form action="vehicle_options.php" method="post">
					<h3>Edit Vehicle Drive Train Information.</h3>
					<p><label for="option_data">{$smarty.const.DRIVETRAIN}</label>
					<input id="option_data" name="option_data" type="text" size="30" maxlength="30" value="{$edit.1}" />
					</p>
					<p>
					<input name="id" type="hidden" value="{$edit.0}" />
					<input name="table" type="hidden" value="drive_train" />
					<input name="vehicle_edit" type="submit" value="Save Changes" />
					<input name="vehicle_delete" type="submit" value="Delete Option" />
					</p>
				</form>
		</fieldset>
	{/if}
	{if $vehicletypeedit}
		<fieldset>
			<legend>Edit Vehicle Type</legend>
				<form action="vehicle_options.php" method="post">
					<h3>Edit Vehicle Type Information.</h3>
					<p><label for="option_data">{$smarty.const.TYPE}</label>
					<input id="option_data" name="option_data" type="text" size="30" maxlength="30" value="{$edit.1}" />
					</p>
					<p>
					<input name="id" type="hidden" value="{$edit.0}" />
					<input name="table" type="hidden" value="vehicle_type" />
					<input name="vehicle_edit" type="submit" value="Save Changes" />
					<input name="vehicle_delete" type="submit" value="Delete Option" />
					</p>
				</form>
		</fieldset>
	{/if}
{elseif $editlist}
<ul>
	{if $manufacturerslist}
		{foreach item="manufacturer" from=$manufacturerslist}
			<li><a href="vehicle_options.php?action=editsingle&amp;section=manufacturer&amp;id={$manufacturer.id}">Edit option record for {$manufacturer.manufacturer}</a></li>
		{/foreach}
	{/if}

	{if $featurelist}
		{foreach item="features" from=$featurelist}
			<li><a href="vehicle_options.php?action=editsingle&amp;section=features&amp;id={$features.id}">Edit option record for {$features.features}</a></li>
		{/foreach}
	{/if}

	{if $drivetrainlist}
		{foreach item="drive_train" from=$drivetrainlist}
			<li><a href="vehicle_options.php?action=editsingle&amp;section=drive_train&amp;id={$drive_train.id}">Edit option record for {$drive_train.drive_train}</a></li>
		{/foreach}
	{/if}

	{if $typeslist}
		{foreach item="vehicle_type" from=$typeslist}
			<li><a href="vehicle_options.php?action=editsingle&amp;section=vehicle_type&amp;id={$vehicle_type.id}">Edit option record for {$vehicle_type.vehicle_type}</a></li>
		{/foreach}
	{/if}
</ul>

<p><a href="vehicle_options.php">Add additional Vehicle Options.</a>
</p>

{else}
<p>
 <a href="vehicle_options.php?action=edit&amp;section=manufacturer">Edit Manufacturers.</a> |
 <a href="vehicle_options.php?action=edit&amp;section=features">Edit Features.</a> |
 <a href="vehicle_options.php?action=edit&amp;section=drive_train">Edit Drive Trains.</a> |
 <a href="vehicle_options.php?action=edit&amp;section=vehicle_type">Edit Vehicle Types.</a>
</p>
<h2>Add New Vehicle Options by using the forms below.</h2>
<fieldset>
	<legend>Add Vehicle Manufacturers</legend>
		<form action="vehicle_options.php" method="post">
			<h3>Add Vehicle Manufacturer Information.</h3>
			<p><label for="option">{$smarty.const.MANUFACTURER}</label>
			<input id="option" name="option" type="text" size="30" maxlength="30" />
			</p>
			<p>
			<input name="table" type="hidden" value="manufacturer" />
			<input name="addoption" type="submit" value="Add Manufacturer" />
			<a href="vehicle_options.php?action=edit&amp;section=manufacturer">Click here to edit Manufacturer Information.</a>
			</p>
		</form>
</fieldset>

<fieldset>
	<legend>Add Vehicle Feature Options</legend>
		<form action="vehicle_options.php" method="post">
			<h3>Add Vehicle Features Information.</h3>
			<p><label for="option">{$smarty.const.FEATURES}</label>
			<input id="option" name="option" type="text" size="30" maxlength="30" />
			</p>
			<p>
			<input name="table" type="hidden" value="features" />
			<input name="addoption" type="submit" value="Add Feature" />
			<a href="vehicle_options.php?action=edit&amp;section=features">Click here to edit Vehicle Feature Information.</a>
			</p>
		</form>
</fieldset>
		
<fieldset>
	<legend>Add Vehicle Drive Train Options</legend>
		<form action="vehicle_options.php" method="post">
			<h3>Add Vehicle Drive Train Information.</h3>
			<p><label for="option">{$smarty.const.DRIVETRAIN}</label>
			<input id="option" name="option" type="text" size="30" maxlength="30" />
			</p>
			<p>
			<input name="table" type="hidden" value="drive_train" />
			<input name="addoption" type="submit" value="Add Drive Train" />
			<a href="vehicle_options.php?action=edit&amp;section=drive_train">Click here to edit Vehicle Drive Train Information.</a>
			</p>
		</form>
</fieldset>
		
<fieldset>
	<legend>Add Vehicle Type Options</legend>
		<form action="vehicle_options.php" method="post">
			<h3>Add Vehicle Type Information.</h3>
			<p><label for="option">{$smarty.const.TYPE}</label>
			<input id="option" name="option" type="text" size="30" maxlength="30" />
			</p>
			<p>
			<input name="table" type="hidden" value="vehicle_type" />
			<input name="addoption" type="submit" value="Add Type" />
			<a href="vehicle_options.php?action=edit&amp;section=vehicle_type">Click here to edit Vehicle Type Information.</a>
			</p>
		</form>
</fieldset>
{/if}

</div>
{/if}
{include file="footer.tpl"}