<?php

/*
* @package BANANA WARS
* @copyright: (c) 2017 G.P. aka Mvcshka (mvcshka@yandex.ru)
* @license: GNU General Public License version 2; see LICENSE.txt
* @files: /page/register.php
*
*/

if(isset($_SESSION['id']))
{
	Header("Location: /account");
	exit;
}

?>

<?php

if(isset($_COOKIE['ref']))
{
	$ref = clean($_COOKIE['ref']);
	$q = $mysql->prepare("SELECT * FROM db_users WHERE Login = ?");
	$q->execute(array($ref));
	$w = $q->fetch();
	$refName = $w['Uid'];
}
else
{
	$refName = 0;
	$ref = 'Чувства долга';
}

?>
<tr>
   <td></td>
   <td valign="top" align="center">
<!-- OPEN FO FORM REGISTER -->
<center>
    <table border="0" cellspacing="0" cellpadding="0" width="650px">
        <tbody>
            <tr>
                <td>
                    <center>
                        <div style="background:url('/images/title.jpg') no-repeat center;text-align:center"><span style="background-color:#F0E8D5;padding-right:15px;padding-left:15px;font-size:18px">Регистрация в игре </span></div>
                        <br>
                        <div style="text-align:left;width:540px">
						<form action="" method="post" id="signup" onsubmit="return false;">
                                
                                <table border="0" cellspacing="0" cellpadding="0" bgcolor="#E8DCC4">
                                    <tbody>
                                        <tr>
                                            <td height="8px" width="8px"><img width="9" height="9" src="/images/form-up-left.gif"></td>
                                            <td></td>
                                            <td align="right"><img width="9" height="9" src="/images/form-up-right.gif"></td>
                                        </tr>
                                        <tr>
                                            <td style="padding:11px 20px" colspan="3">
                                                <table class="maintable" border="0" width="500" cellspacing="0" cellpadding="4">
                                                    
                                                    <tbody>
                                                        <tr>
                                                            <td valign="top">
                                                                <nobr><b>Логин(Ник)</b></nobr>
                                                            </td>
                                                            <td width="500">
																<input style="border:1px solid #A4A4A4;" type="text" name="login" maxlength="15" placeholder="Логин">
															</td>
                                                        </tr>
                                                        <tr>
                                                            <td valign="top"><b>Пол</b></td>
                                                            <td width="500">
																<input style="background-color:" name="Gender" type="radio" value="0" checked="">Мужской<br>
																<input style="background-color:" name="Gender" type="radio" value="1">Женский<br>
															</td>
                                                        </tr>
                                                        <tr>
                                                            <td valign="top"><b>E-Mail</b></td>
                                                            <td width="500">
															<input style="border:1px solid #A4A4A4;" type="text" name="email" maxlength="30" placeholder="E-mail"><br><font color="gray">На этот адрес будет отправлена ссылка для активации.</font>
                                                            </td>
                                                        </tr>
                                                        
                                                        <input name="Referal" type="hidden" value=""><input name="CampaignID" type="hidden" value=""><input name="SubCampaignID" type="hidden" value=""><input name="PartnerID" type="hidden" value=""><input name="Keywords" type="hidden" value="">
                                                        <tr>
                                                            <td valign="top"><b>Пароль</b></td>
                                                            <td width="500">
																<input style="border:1px solid #A4A4A4;" type="password" name="password" maxlength="32" placeholder="Пароль">
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td valign="top">
                                                                <nobr><b>Повторите пароль</b></nobr>
                                                            </td>
                                                            <td width="500">
															<input style="border:1px solid #A4A4A4;" type="password" name="password2" maxlength="32" placeholder="Пароль">
                                                            </td>
                                                        </tr>
														<tr>
															<td valign="center"><b>Введите код</b></td>
															<td width="500">
																<input type="hidden" name="r" value="<?=$refName;?>">
																<input type="hidden" name="r2" value="<?=$ref;?>">
																<img src="/capcha.php" class="capcha"/>
																<img style="height:50px;" src="/images/refresh.png" class="refresh" onclick="change_capcha()"/><br/>
																<input name="capcha" type="text" maxlength="30" placeholder="Код с картинки" autocomplete="off"><br/><br />
																<div id="fail" class="fail"></div>
															</td>
														</tr>
                                                        <tr>
														<td width="500">   
															<center><button class="button_big" onclick="process('signup','/process/signup.php','signup .fail','signup .fail','signup')">Начать игру?</button></center>    
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td height="8px" width="8px"><img width="9" height="9" src="/images/form-bottom-left.gif"></td>
                                            <td></td>
                                            <td align="right"><img width="9" height="9" src="/images/form-bottom-right.gif"></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                        <br><a href="/">Вернуться на главную</a> <br> <br> <br>
                    </center>
                </td>
            </tr>
        </tbody>
    </table>
</center>
<!-- END FO FORM REGISTER -->
   </td>
   <td></td>
<tr>