
<footer>
<div class="prefoot pb10">
<div class="row flex jcsb ais">
<div class="xl_50 flex fdc pt20 mt10 foot_desc">
<div class="head_f mb30">Наши контакты</div>
<div class="head_f mb30"><font color = "red"><b>admin@coolskript.org</b></font></div>
<br><br>
</div>
<div class="xl_45 pt20 mt10">
<div class="head_f mb30">Описание</div>
<p class="text_f mb10 mr40">Дальнобойщики - мы собрали наиболее успешные маркетинговые решения в данном сегменте, что несомненно внесет наш проект в
ряды долгожителей. И позволит выплатить резерв в полном объеме. 
</p><br><br><br><br><br><br>
<a href="http://www.free-kassa.ru/" style="margin-right: 10px;"><img src="../www.free-kassa.ru/img/fk_btn/14.png"></a>
<a href="https://metrika.yandex.ru/stat/?id=48857102&amp;from=informer" target="_blank" rel="nofollow"><img src="https://informer.yandex.ru/informer/48857102/3_0_FFFFFFFF_FFFFFFFF_0_pageviews" style="width:88px; height:31px; border:0;" alt="Яндекс.Метрика" title="Яндекс.Метрика: данные за сегодня (просмотры, визиты и уникальные посетители)" class="ym-advanced-informer" data-cid="48857102" data-lang="ru" /></a>

</div>
</div>
</div>
</footer>

<div>
<a href="javascript:void(0);" class="bgpopup" id="form_aut" onclick="popup_close('main_aut_form');anim_humans_rev();"></a>
<div class="popup forms" id="main_aut_form">
<a href="javascript:void(0);" class="close" onclick="popup_close('main_aut_form');anim_humans_rev();"><i class="fa fa-times" aria-hidden="true"></i></a>
<h3 class="head">Авторизация</h3>
<form method="POST" action="" class="form_aut auth block">
<input type="hidden" name="" value="IMCcz40P06V0xm21MPs3gRrAcvP0vOY6Ht1qttai"> <div class="wr_input flex jcsb aic mb25">
<div class="wr_ico flex aic jcc">
<i class="fa fa-user icon_reg"></i>
</div>
<?PHP

# Определение платежей по акции 'Накопительный банк'
$c_date = date("Ymd",time());
$c_date_begin = strtotime($c_date." 00:00:00");
$c_date_end = strtotime($c_date." 23:59:59");
$y_date = date("Ymd",time()-24*60*60);
$y_date_begin = strtotime($y_date." 00:00:00");
$y_date_end = strtotime($y_date." 23:59:59");


$db->Query("SELECT * FROM db_back WHERE date_add >='".$c_date_begin."' AND  date_add <='".$c_date_end."' ORDER BY id DESC LIMIT 1");
if($db->NumRows() == 0) {


$db->Query("SELECT sum(serebro) FROM db_insert_money WHERE date_add >='".$y_date_begin."' AND  date_add <='".$y_date_end."' AND money >= '1'" );
if($db->NumRows() == 0) $sum_c = 0;
else $sum_c = $db->FetchRow();


$db->Query("SELECT date_add as date_add, user as user, user_id as user_id, SUM(serebro) as sserebro  FROM db_insert_money WHERE date_add >='".$y_date_begin."' AND  date_add <='".$y_date_end."' GROUP BY user ORDER by sserebro DESC LIMIT 1");
$firstuser=$db->FetchArray();
$firstpercent=(1.5/100)*$sum_c;
$db->Query("UPDATE db_users_b SET money_b = money_b + '".$firstpercent."' WHERE id = '".$firstuser['user_id']."'");


$db->Query("SELECT date_add as date_add, user as user, user_id as user_id, SUM(serebro) as sserebro  FROM db_insert_money WHERE date_add >='".$y_date_begin."' AND  date_add <='".$y_date_end."' GROUP BY user ORDER by sserebro DESC LIMIT 1,2");
$seconduser=$db->FetchArray();
$secondpercent=(1.0/100)*$sum_c;
$db->Query("UPDATE db_users_b SET money_b = money_b + '".$secondpercent."' WHERE id = '".$seconduser['user_id']."'");


$db->Query("SELECT date_add as date_add, user as user, user_id as user_id, SUM(serebro) as sserebro  FROM db_insert_money WHERE date_add >='".$y_date_begin."' AND  date_add <='".$y_date_end."' GROUP BY user ORDER by sserebro DESC LIMIT 2,3");
$thirduser=$db->FetchArray();
$thirdpercent=(0.5/100)*$sum_c;
$db->Query("UPDATE db_users_b SET money_b = money_b + '".$thirdpercent."' WHERE id = '".$thirduser['user_id']."'");

$db->Query("INSERT INTO db_back (`id`,`user_id`,`bank`,`sum`,`date_add`) VALUES(NULL,'".$firstuser['user_id']."','".$sum_c."','".$firstpercent."','".time()."'),(NULL,'".$seconduser['user_id']."','".$sum_c."','".$secondpercent."','".time()."'), (NULL,'".$thirduser['user_id']."','".$sum_c."','".$thirdpercent."','".time()."')");


//$db->Query("INSERT INTO db_back (`id`,`user_id`,`bank`,`sum`,`date_add`) VALUES(NULL,'".$firstuser['user_id']."','".$sum_c."','".$firstpercent."','".time()."')");
//$db->Query("INSERT INTO db_back (`id`,`user_id`,`bank`,`sum`,`date_add`) VALUES(NULL,'".$seconduser['user_id']."','".$sum_c."','".$secondpercent."','".time()."')");
//$db->Query("INSERT INTO db_back (`id`,`user_id`,`bank`,`sum`,`date_add`) VALUES(NULL,'".$thirduser['user_id']."','".$sum_c."','".$thirdpercent."','".time()."')");



	/*$db->Query("SELECT sum(serebro) as serebro, user_id FROM db_insert_money WHERE date_add >='".$y_date_begin."' AND  date_add <='".$y_date_end."'  AND money >= '1' GROUP BY SEREBRO");
	$num_nb = $db->NumRows();
	$sum_nb = 0;
	$user_nb = '';

	if($num_nb != 0) {
		if($num_nb == 1) {
			$data_nb = $db->FetchArray();
			$sum_nb = $sum_nb + $data_nb['serebro'];
			$user_nb = $user_nb.$data_nb['user_id']." ";
		} else {
			while($data_nb = $db->FetchArray()) {
				$sum_nb = $sum_nb + $data_nb['serebro'];
				$user_nb = $user_nb.$data_nb['user_id']." ";
			}
		}

		$ar_user_nb = explode(" ", $user_nb);
		$pos_nb = rand(0, $num_nb-1);

		$db->Query("SELECT percent_back FROM db_config WHERE id = '1'");
		$percent_back = $db->FetchRow();
		$db->FreeMemory();

		$sum_nb1 = round($sum_nb * $percent_back / 100,0);

		# Зачилсяем юзверю
		$db->Query("UPDATE db_users_b SET money_b = money_b + '".$sum_nb1."' WHERE id = '".$ar_user_nb[$pos_nb]."'");

		# Пишем в табл
		$db->Query("INSERT INTO db_back (`id`,`user_id`,`bank`,`sum`,`date_add`) VALUES(NULL,'".$ar_user_nb[$pos_nb]."','".$sum_nb."','".$sum_nb1."','".time()."')");

		# echo $sum_nb." ".$num_nb." ".$pos_nb."-".$ar_user_nb[$pos_nb];
	}*/
}
	if(isset($_POST["log_email"])){

	$lmail = $func->IsMail($_POST["log_email"]);

		if($lmail !== false){

			$db->Query("SELECT id, user, pass, referer_id, banned FROM db_users_a WHERE email = '$lmail'");
			if($db->NumRows() == 1){

			$log_data = $db->FetchArray();

				if(strtolower($log_data["pass"]) == strtolower($_POST["pass"])){

					if($log_data["banned"] == 0){

						# Считаем рефералов
						$db->Query("SELECT COUNT(*) FROM db_users_a WHERE referer_id = '".$log_data["id"]."'");
						$refs = $db->FetchRow();

						$db->Query("UPDATE db_users_a SET referals = '$refs', date_login = '".time()."', ip = INET_ATON('".$func->UserIP."') WHERE id = '".$log_data["id"]."'");

						$_SESSION["user_id"] = $log_data["id"];
						$_SESSION["user"] = $log_data["user"];
						$_SESSION["referer_id"] = $log_data["referer_id"];
						?>


<meta http-equiv="refresh" content="0;url=/profile" />

<?

					}else echo "<div class='alert alert-danger'>Аккаунт заблокирован</div>";

				}else echo "<div class='alert alert-danger'>Неверные данные</div>";

			}else echo "<div class='alert alert-danger'>E-mail не зарегистрирован</div>";

		}else echo "<div class='alert alert-danger'>Недопустимый формат E-mail</div>";

	}

?>
<div class="fg2">
<input type="text" placeholder="Введите Логин или E-Mail" name="log_email" id="email2">
</div>
</div>
<div class="wr_input flex jcsb aic mb25">
<div class="wr_ico flex aic jcc">
<i class="fa fa-user-secret icon_reg"></i>
</div>
<div class="fg2">
<input type="password" id="password2" placeholder="Введите пароль" name="pass">
</div>
</div>
<div class="flex jcsb aic mb25">
<input type="checkbox" id="remember" name="remember" class="checkbox" checked>
<label for="remember">Remember Me</label>
</div>
<div class="flex jcsb aic">
<div class="xl_50">
<button type="submit" class="btn db" id="login">Войти</button>
</div>
<a href="javascript:void(0);" style="color: black" onclick="$('.reestablish_f').slideToggle('slow');">Забыли пароль?</a>
</div>
</form>
<div class="reestablish_f pt20" style="display: none;">
<div class="wr_input flex jcsb aic mb25">
<div class="wr_ico flex aic jcc">
<i class="fa fa-envelope icon_reg"></i>
</div>
<div class="fg2">
<input type="email" class="email_reset" placeholder="Введите Вашу почту" name="mail">
</div>
</div>
<div class="xl_50">
<a href="javascript:void(0);" class="btn db" id="preset">Восстановить</a>
</div>
</div>
</div>
</div>
<div>
<a href="javascript:void(0);" class="bgpopup" id="form_reg" onclick="popup_close('main_reg_form');anim_humans_rev();"></a>
<div class="popup forms" id="main_reg_form">
<a href="javascript:void(0);" class="close" onclick="popup_close('main_reg_form');anim_humans_rev();"><i class="fa fa-times" aria-hidden="true"></i></a>
<h3 class="head">Регистрация</h3>

   

<form method="POST" action="" id="form" class="form block form_reg block">
<input type="hidden" name="_token" value="IMCcz40P06V0xm21MPs3gRrAcvP0vOY6Ht1qttai"> <div class="wr_input flex jcsb aic mb25">
<?PHP


	# Регистрация

	if(isset($_POST["login"])){


	$login = $func->IsLogin($_POST["login"]);
	$pass = $func->IsPassword($_POST["pass"]);
	$rules = isset($_POST["rules"]) ? true : false;
	$time = time();
	$ip = $func->UserIP;

	$email = $func->IsMail($_POST["email"]);
	$referer_id = (isset($_COOKIE["i"]) AND intval($_COOKIE["i"]) > 0 AND intval($_COOKIE["i"]) < 1000000) ? intval($_COOKIE["i"]) : 1;
	$referer_name = "";
						if($referer_id != 1){

							$db->Query("SELECT user FROM db_users_a WHERE id = '$referer_id' LIMIT 1");

							if($db->NumRows() > 0){

								$referer_name = $db->FetchRow();

							}else{ $referer_id = 1; $referer_name = "aleksandr"; }

						}else{ $referer_id = 1; $referer_name = "aleksandr"; }

		if($rules){

			if($email !== false){

			if($login !== false){

				if($pass !== false){

					if($pass == $_POST["repass"]){

						$db->Query("SELECT COUNT(*) FROM db_users_a WHERE user = '$login'");
						if($db->FetchRow() == 0){

			/* Реф 3 уровня ================== */
                        $db->Query("SELECT referer, referer_id FROM db_users_a WHERE id = '$referer_id' LIMIT 1");
                        $stats_data = $db->FetchArray();
                        $referer_name2=$stats_data["referer"];
                        $referer_id2=$stats_data["referer_id"];

                        $db->Query("SELECT referer, referer_id FROM db_users_a WHERE id = '$referer_id2' LIMIT 1");
                        $stats_data3 = $db->FetchArray();
                        $referer_name3=$stats_data3["referer"];
                        $referer_id3=$stats_data3["referer_id"];
                        /* ================== */


						preg_match('/([a-z0-9aа-я\.])+([a-z0-9а-я\-])+(\.)([a-z0-9а-я]{2,5}\.)?([a-z0-9а-я]{2,5})/i',$_COOKIE['rsite'], $out);
                        $out=$db->RealEscape($out[0]);
                        $array[date( 'dmY' )] = 0.0000;
						# Регаем пользователя
						$db->Query("INSERT INTO db_users_a (user, email, pass, referer, referer_id, referer_id2, referer_id3, date_reg, refsite, ip, statistic)
						VALUES ('$login','{$email}','$pass','$referer_name','$referer_id','$referer_id2','$referer_id3','$time','$out',INET_ATON('$ip'),'". serialize( $array ). "')");


						$lid = $db->LastInsert();

						$db->Query("INSERT INTO db_users_b (id, user, money_b, last_sbor) VALUES ('$lid','$login','10', '".time()."')");
                        # Добавляем к деньгам
						$db->Query("UPDATE db_users_a SET speed_bonus = speed_bonus + 0.0002 WHERE id = '".$referer_id."'");

						# Вставляем статистику
						$db->Query("UPDATE db_stats SET all_users = all_users +1 WHERE id = '1'");

						echo "<div class='alert alert-success'>Вы успешно зарегистрировались. Используйте форму для входа в аккаунт</div>";
header('Refresh: 3; URL=/login');
						?>
						<?PHP
						return;
						}else echo "<div class='red'>Указанный логин уже используется</div><BR />";

					}else echo "<div class='alert alert-danger'>Пароль и повтор пароля не совпадают</div><BR />";

				}else echo "<div class='alert alert-danger'>Пароль заполнен неверно</div><BR />";

			}else echo "<div class='alert alert-danger'>Логин заполнен неверно</div><BR />";

		}else echo "<div class='alert alert-danger'>Email имеет неверный формат</div>";

		}else echo "<div class='alert alert-danger'>Вы не подтвердили правила</div>";

	}


?>
<div class="wr_ico flex aic jcc">
<i class="fa fa-user icon_reg"></i>
</div>
<div class="fg2">
<input id="name" type="text" placeholder="Введите Логин" name="login" required autofocus>
</div>
</div>
<div class="wr_input flex jcsb aic mb25">
<div class="wr_ico flex aic jcc">
<i class="fa fa-envelope icon_reg"></i>
</div>
<div class="fg2">
<input id="email_reg" type="email" placeholder="Введите Email" value="<?=(isset($_POST["email"])) ? $_POST["email"] : false; ?> " name="email" required>
</div>
</div>
<div class="wr_input flex jcsb aic mb25">
<div class="wr_ico flex aic jcc">
<i class="fa fa-user-secret icon_reg"></i>
</div>
<div class="fg2">
<input id="password_reg" type="password" placeholder="Введите пароль" name="pass" required>
</div>
</div>
<div class="wr_input flex jcsb aic mb25">
<div class="wr_ico flex aic jcc">
<i class="fa fa-user-secret icon_reg"></i>
</div>
<div class="fg2">
<input id="password-confirm" type="password" placeholder="Повторите пароль" name="repass" required>
</div>
</div>
 С <a href="/rules" target="_blank" class="stn">правилами</a> проекта ознакомлен(а) и принимаю:
                        <input name="rules" checked="" type="checkbox" />
<div id="error-reg"></div>

<div class="flex jcsb aic">
<div class="xl_64">
<button type="submit" class="btn db">Зарегистрироваться</button>
</div>
<div class="xl_36 tar">

</div>
</div>
</form>
</div>
</div>

<script src="/js/core.js"></script>
<script src="/js/scriptc4ca.js?1"></script>
<script src="AjaxLogin/AjaxLogine908.js"></script>
<script src="AjaxRegister/AjaxRegistere908.js"></script>
<script src="/cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>


<script type="text/javascript" async>
        (function (d, w, c) {
            (w[c] = w[c] || []).push(function() {
                try {
                    w.yaCounter48857102 = new Ya.Metrika({
                        id:48857102,
                        clickmap:true,
                        trackLinks:true,
                        accurateTrackBounce:true,
                        webvisor:true
                    });
                } catch(e) { }
            });

            var n = d.getElementsByTagName("script")[0],
                s = d.createElement("script"),
                f = function () { n.parentNode.insertBefore(s, n); };
            s.type = "text/javascript";
            s.async = true;
            s.src = "../mc.yandex.ru/metrika/watch.js";

            if (w.opera == "[object Opera]") {
                d.addEventListener("DOMContentLoaded", f, false);
            } else { f(); }
        })(document, window, "yandex_metrika_callbacks");
    </script>
<noscript><div><img src="https://mc.yandex.ru/watch/48857102" style="position:absolute; left:-9999px;" alt="" /></div></noscript>

</body>

<!-- Разработка сайта  CoolSkript.org-->
</html>
