{* Error and confirmation messages *}
{include file="messages.tpl"}

{strip}
{if $posted}
   <div class="success block">
      {l}Profile updated.{/l}
   </div>
{/if}

<div class="block">
   <form method="post" action="">
   <table border="0" class="formPage">

   <thead>
      <tr>
         <th colspan="2">{l}Update profile{/l}</th>
      </tr>
  </thead>

   <tbody>
      <tr>
         <td class="label required"><label for="NAME">{l}Name{/l}:</label></td>
         <td class="smallDesc">
            <input type="text" id="NAME" name="NAME" value="{$NAME}" maxlength="{$smarty.const.USER_NAME_MAX_LENGTH}" class="text" />
            {validate form="conf_profile" id="v_NAME" message=$smarty.capture.field_char_required}
            {validate form="conf_profile" id="v_NAME_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.USER_NAME_MIN_LENGTH|replace:'#MAX#':$smarty.const.USER_NAME_MAX_LENGTH}
         </td>
      </tr>
      <tr>
         <td class="label"><label for="PASSWORD">{l}Password{/l}:</label></td>
         <td class="smallDesc">
            <input type="password" id="PASSWORD" name="PASSWORD" value="" maxlength="{$smarty.const.USER_PASSWORD_MAX_LENGTH}" class="text" />
            {validate form="conf_profile" id="v_PASSWORD" message=$smarty.capture.field_pass_required}
            {validate form="conf_profile" id="v_PASSWORD_LENGTH" message=$smarty.capture.invalid_length|replace:'#MIN#':$smarty.const.USER_PASSWORD_MIN_LENGTH|replace:'#MAX#':$smarty.const.USER_PASSWORD_MAX_LENGTH}
         </td>
      </tr>
      <tr>
         <td class="label"><label for="PASSWORDC">{l}Confirm Password{/l}:</label></td>
         <td class="smallDesc">
            <input type="password" id="PASSWORDC" name="PASSWORDC" value="" maxlength="{$smarty.const.USER_PASSWORD_MAX_LENGTH}" class="text" />
            {validate form="conf_profile" id="v_PASSWORDC" message=$smarty.capture.password_not_match}
         </td>
      </tr>
      <tr>
         <td class="label"><label for="LANGUAGE">{l}Preffered Language{/l}:</label></td>
         <td class="smallDesc">
            {html_options options=$languages selected=$LANGUAGE name="LANGUAGE" id="LANGUAGE"}
            {validate form="conf_profile" id="v_LANGUAGE" message=$smarty.capture.field_required}
         </td>
      </tr>
      <tr>
         <td class="label required"><label for="EMAIL">{l}Email{/l}:</label></td>
         <td class="smallDesc">
            <input type="text" id="EMAIL" name="EMAIL" value="{$EMAIL}" maxlength="255" class="text" />
            {validate form="conf_profile" id="v_EMAIL" message=$smarty.capture.invalid_email}
            {validate form="conf_profile" id="v_EMAIL_U" message=$smarty.capture.email_not_unique}
         </td>
      </tr>
      <tr>
         <td class="label"><label for="SUBMIT_NOTIF">{l}Link Submit Notification{/l}:</label></td>
         <td class="smallDesc">
            <input type="checkbox" id="SUBMIT_NOTIF" name="SUBMIT_NOTIF" value="1"{if $SUBMIT_NOTIF} checked="checked"{/if} />
         </td>
      </tr>
      <tr>
         <td class="label"><label for="PAYMENT_NOTIF">{l}Link Payment Notification{/l}:</label></td>
         <td class="smallDesc">
            <input type="checkbox" id="PAYMENT_NOTIF" name="PAYMENT_NOTIF" value="1"{if $PAYMENT_NOTIF} checked="checked"{/if} />
         </td>
      </tr>
   </tbody>

   <tfoot>
      <tr>
         <td><input type="reset" id="reset-profile-submit" name="reset" value="{l}Reset{/l}" alt="{l}Reset form{/l}" title="{l}Reset form{/l}" class="button" /></td>
         <td><input type="submit" id="send-profile-submit" name="submit" value="{l}Save{/l}" alt="{l}Save form{/l}" title="{l}Save profile{/l}" class="button" /></td>
      </tr>
   </tfoot>
   </table>
   </form>
</div>
{/strip}