{include file="header.tpl"}
<div class="box">
<div class="box_title" id="tba">User Signup</div>
<div class="box_body">


{if $frm.display == 'confirmation'}
 {if $frm.say == 'confirmed'}
<div style="color:green" align="center">Thank you. Your account has been successfully confirmed. You can <a href="{"?a=login"|encurl}">login</a> now.</div>
 {else}
<div style="color:red" align="center">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 style="color:green" align="center">Thank you. Your account has been successfully created. You can <a href="{"?a=login"|encurl}">login</a> now.</div>
{elseif $frm.display == 'confirm'}
<div style="color:green" align="center">
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 style="color:red">                                                                      
{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.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 width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
 <td>Username</td>
 <td><input type="text" name="username" value="{$frm.username|escape:htmlall}" class="inpts" size="35"></td>
</tr>
<tr>
 <td>Email</td>
 <td><input type="text" name="email" value="{$frm.email|escape:htmlall}" class="inpts" size="45"></td>
</tr>
<tr>
 <td>Password</td>
 <td><input type="password" name="password" value="{$frm.password|escape:htmlall}" class="inpts" size="45"></td>
</tr>
<tr>
 <td>Confirm Password</td>
 <td><input type="password" name="password2" value="{$frm.password2|escape:htmlall}" class="inpts" size="45"></td>
</tr>

{foreach from=$ecs key=i item=data}
<tr>
 <td>{$data.name}</td>
 <td><input type="text" name="account[{$i}]" value="{$frm.account.$i|escape:htmlall}" class="inpts" size="32"> <img src="{"images/`$data.name`.gif"|encurl}" title="{$data.name}" align="absmiddle"></td>
</tr>
{/foreach}

{if $settings.use_turing}
<tr>
  <td><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}" alt="turing code"></td>
  <td><input type=text name="turing" maxlength="6" size="10" class="inpts"></td>
</tr>
{/if}
<tr>
 <td></td>
 <td><input type="submit" value="Signup" class="sbmt"></td>
</tr>
</table>
</form>

{/if}

</div></div>

{include file="footer.tpl"}