{include file="header.tpl"}

<h3>{t}User Signup{/t}</h3>
<div class="signup">

{if $frm.display == 'confirmation'}
 {if $frm.say == 'confirmed'}
  <div class="ok">{t login_link="?a=login"|encurl}Thank you. Your account has been successfully confirmed. You can <a href="%login_link">login</a> now.{/t}</div>
 {else}
  <div class="error">{t}Sorry, confirmation code was not found. It means you have used broken link or your account was already confirmed.{/t}</div>
 {/if}
{elseif $frm.display == 'added'}
<div class="ok">{t logn_link="?a=login"|encurl}Thank you. Your account has been successfully created. You can <a href="%login_link">login</a> now.{/t}</div>
{elseif $frm.display == 'confirm'}
<div class="ok">
{t}Thank you. Your account has been successfully created.
You should confirm your e-mail address by following link we have sent to you.{/t}
</div>
{else}

{if $errors}
<ul class="error">                                                                      
{if $errors.turing}<li> {t}Invalid turing image provided{/t}</li>{/if}
{if $errors.username}<li> {t}Please, enter your Username{/t}</li>{/if}
{if $errors.username_exists}<li> {t}Username already exists. Please, enter another one{/t}</li>{/if}
{if $errors.email}<li> {t}Please, enter your email{/t}</li>{/if}
{if $errors.email_exists}<li> {t}Email is already registered. Please, use password reminder to restore your password{/t}</li>{/if}
{if $errors.invalid_email}<li> {t}Please, enter a valid E-mail address{/t}</li>{/if}
{if $errors.password}<li> {t}Please, define your password{/t}</li>{/if}
{if $errors.password2}<li> {t}Please, verify passwords you have entered. Both passwords should be equal{/t}</li>{/if}
</ul>
{/if}

<form method="post" action="">
<input type="hidden" name="action" value="signup">
<table class="form">
<tr>
 <th>{t}Username:{/t}</th>
 <td><input type="text" name="username" value="{$frm.username|escape:htmlall}"></td>
</tr>
<tr>
 <th>{t}E-mail{/t}</th>
 <td><input type="text" name="email" value="{$frm.email|escape:htmlall}"></td>
</tr>
<tr>
 <th>{t}Password:{/t}</th>
 <td><input type="password" name="password" value="{$frm.password|escape:htmlall}"></td>
</tr>
<tr>
 <th>{t}Confirm Password:{/t}</th>
 <td><input type="password" name="password2" value="{$frm.password2|escape:htmlall}"></td>
</tr>
{foreach from=$ecs key=id item=data}
<tr>
 <th>{$data.name} <img src="{"`$theme`images/`$data.name`.gif"|encurl}" alt="{$data.name}"></th>
 <td><input type="text" name="account[{$id}]" value="{$frm.account.$id|escape:htmlall}"></td>
</tr>
{/foreach}
{if $settings.use_turing}
<tr>
  <th><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}" alt="turing code"></th>
  <td><input type=text name="turing" maxlength=6 size=6></td>
</tr>
{/if}
<tr>
 <th></th>
 <td><input type="submit" value="{t}Signup{/t}"></td>
</tr>
</table>
</form>

{/if}

</div>

{include file="footer.tpl"}