{include file="header.tpl"}

<h3>User Signup</h3>
<div class="signup">

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

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

<form method="post" action="">
<input type="hidden" name="action" value="signup">
<table class="form">
<tr>
 <th>Username</th>
 <td><input type="text" name="username" value="{$frm.username|escape:htmlall}"></td>
</tr>
<tr>
 <th>Email</th>
 <td><input type="text" name="email" value="{$frm.email|escape:htmlall}"></td>
</tr>
<tr>
 <th>Password</th>
 <td><input type="password" name="password" value="{$frm.password|escape:htmlall}"></td>
</tr>
<tr>
 <th>Confirm Password</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="Signup"></td>
</tr>
</table>
</form>

{/if}

</div>

{include file="footer.tpl"}