{include file="AdminHeader.htm"}
<!-- Created by www.phpgen.com on {{$Page.CreatedTime}}. -->
<body>
  {if $ItemID}
  <table align="center" class="tblwide noborder">
  <caption>Record {$ItemID} has been added. Choose next step...</caption>
  <tr>
    <td>
      <ul>
        <li><a href="Add.php">Add another record.</a></li>
        <li><a href="View.php?ItemID={$ItemID}">View the added record.</a></li>
        <li><a href="Edit.php?ItemID={$ItemID}">Edit the added record.</a></li>
        <li><a href="List.php?ItemID={$ItemID}">Return to the list page.</a></li>
      </ul>
    </td>
  </tr>
  </table>
  {else}
  <form name="Add{{$Page.TableName}}" method="post" enctype="multipart/form-data">
    <table align="center" class="noborder tblwide">
      <caption>{$PageTitle}</caption>
      {{if $Page.Fields.Required}}
      {{$CFG.GEN.EmptyLine}}
      <!-- Fields must be filled-->
      <tr class="colhead">
        <th colspan="2">{$Lang.MustFill}</th>
      </tr>
      {{foreach from=$Page.Fields.Required key=FieldName item=Field}}<tr>
        <th>{$Lang.{{$FieldName}}}</th>
        <td>
          {{$Field.InputHtml}}
          {{if $Field.DataRule != "None"}}{if $CFG.DataType.{{$Field.DataRule}}.Desc}<sup class="red"> ( {$CFG.DataType.{{$Field.DataRule}}.Desc})</sup>{/if}
          {{/if}}
          {{$CFG.GEN.EmptyLine}}
          {$Lang.Note.{{$FieldName}}}
        </td>
      </tr>
      {{/foreach}}
      {{/if}}
      {{if $Page.Fields.Optional}}

      <!-- Fields optional-->
      <tr class="colhead">
        <th colspan="2">{$Lang.Optional}</th>
      </tr>
      {{foreach from=$Page.Fields.Optional key=FieldName item=Field}}<tr>
        <th>{$Lang.{{$FieldName}}}</th>
        <td>
          {{$Field.InputHtml}}
          {{if $Field.DataRule != "None"}}{if $CFG.DataType.{{$Field.DataRule}}.Desc}<sup class="red"> ( {$CFG.DataType.{{$Field.DataRule}}.Desc})</sup>{/if}
          {{/if}}
          {{$CFG.GEN.EmptyLine}}
          {$Lang.Note.{{$FieldName}}}
        </td>
      </tr>
      {{/foreach}}
      {{/if}}

      <tr>
        <td colspan="2" align="center">
          <input type="submit" name="Submit" value="{$Lang.Save}(S)"  accesskey="s" class="submit" />
          <input type="reset"  name="Reset"  value="{$Lang.Reset}(R)" accesskey="R" class="button" />
        </td>
      </tr>
    </table>
  </form>
  {/if}
</body>
</html>