{include file='form_ajax_list_input.inc.tpl'}

{if $MODE != 'view'}

{include file='form_validator_view.inc.tpl'}

{/if}



{if $PAGE_MENU}
<div style="padding:8px;">{$PAGE_MENU}</div>
{/if}

{if $PAGE_TITLE}
<div id="page_title">{$PAGE_TITLE}</div>
{/if}

{if $MODE != 'view'}

{if $FORM_INPUT_ERRORS}<span class="dbFormError">{$FORM_INPUT_ERRORS}</span>{/if}

{if $info_snippet}
	{$info_snippet}
{/if}

<div id="dbform_div">
{$FORM}{$action}
	<div id="dbform_head">{$REQUIRED_INTRO}</div>
{foreach from=$fields item=field}
	{if $field.index and $MODE != 'add'}
		{$field.input}
	{/if}
	
	{include file='form_field.inc.tpl'}
		
{/foreach}
	<div id="dbform_row_save">{$SAVE_BUTTON}</div>
	<div id="dbform_head" style="width:1000px;">{$REQUIRED_INTRO}</div>
</form>
</div>


<script language="javascript" type="text/javascript">
processDBF_DISPLAY();
</script>


{*
/*---------------------------------------------------------------------------
END IF NOT VIEW MODE
---------------------------------------------------------------------------*/
*}

{else}

{*
/*---------------------------------------------------------------------------
START VIEW MODE
---------------------------------------------------------------------------*/
*}

<table class="dbFormTable" cellspacing="0">

{foreach from=$fields item=field}
	{if $field.type != 'hidden' and !$field.index}

<tr class="dbFormRow">
	<td class="dbFormContentTitle" valign="top"><b>{if $field.title != ''}{$field.title}{else}{$field.name}{/if}</b></td>
	<td class="dbFormContentValue" valign="top">
		{if $field.type == 'datetime'}
			{$field.value|date_format:"$date_format"}
		{else}
			{$field.value}
		{/if}
		&nbsp;
	</td>
</tr>
	{/if}
	
{/foreach}
</table>

{*
/*---------------------------------------------------------------------------
END VIEW MODE
---------------------------------------------------------------------------*/
*}
{/if}

