<div class="p-2">
<?php
if ($uid) { } else {
# Вставляем в куки ID пригласителя /i/123
if (isset($pg->params[1])) {
$refd = (intval($pg->params[1]) > 0) ? intval($pg->params[1]) : 1;
setcookie('i',$refd,time()+(60*60*24*14), '/'); 
header('Location: /'); return;
}

# Форма регистрации
if (isset($_POST['reg'])){

    # Фильтрация кошельков
    $wallet = new wallets();
    $login = $wallet->tron_wallet($_POST["tron"]);
    
    $time = time();
    
    # Источник перехода
    if (!empty($_COOKIE['rsite'])) $rsite = $_COOKIE['rsite'];
    $host = parse_url($rsite);
    $siter = $host['host'];
    if ($siter) { 
    $site = $siter;
     } else {
    $site = 'noref';
    }

    # Кто пригласил
    $rid = (isset($_COOKIE["i"])) ? intval($_COOKIE["i"]) : 1;
    $referer = $rid == 1 ? null : $db->query('SELECT login FROM db_users WHERE id = ? LIMIT 1',array($rid))->fetchArray();
    $referer = $referer['login'];
    
    if($referer == null) {$rid = 1; $referer = "Admin";}
    
    # IP адрес
    $ipGet = $func->ipGet();
    $ip = $func->ipValid($ipGet);
    
    # Проверка на валидность
    //if(empty($_POST['g-recaptcha-response'])) { $errors[] = 'Ошибка распознавания капчи!'; }
    if(empty($login)) { $errors[] = 'Error Tron-wallet (TRX)!'; }
    
    
    # Проверка на уникальность
    $users = $db->query('SELECT * FROM db_users WHERE login = ?',array($login))->fetchArray();

    if ($users['login'] == $login){  
     
    # Если забанен
    if ($users['ban'] == 1) { $errors[] = 'Your account has been blocked!'; } else {


        $userID = $users['id'];
        $db->query('UPDATE db_users SET auth = ? WHERE id = ?',array($time, $userID));
        $db->query('UPDATE db_uips SET ip2 = ?, time = ? WHERE id = ?',array($ip, $time, $userID));
        $_SESSION['uid'] = $users['id'];
        $_SESSION['login'] = $users['login'];
      //  echo '<div class="alert alert-success"> Welcome!</div> </div></div>'; 
        header('Location: /user/dashboard');return;
     } 
    
    } else {
    
$ipUser = $db->query('SELECT * FROM db_uips WHERE ip = ?',array($ip))->numRows();
if ($ipUser >= 5){ $errors[] = 'Registration from this IP ('.$ip.') has already been!'; }

    # Успешная регистрация
    if (empty($errors)) {
        # tarif params
        $idTarif = 1;
        $speed = 250;
        $price = 50;
        $hashpower = round($price,0);
        $periodData = 30;
        $title = 'Plan - '.$idTarif.'';
        
    
        # Создаем пользователя
        $db->query('INSERT INTO db_users (login, reg, auth, speed, bank, last, rid, referer, refsite) VALUES (?,?,?,?,?,?,?,?,?)', array($login, $time, $time, $speed, $hashpower, $time, $rid, $referer, $site));
        $lid = $db->LastInsert();
    
        # Дополнительно
        $db->query('INSERT INTO db_uips (id,ip,ip2,time) VALUES (?,?,?,?)', array($lid, $ip, $ip, $time));
        
        # Прибавляем рефоводу +1
        $db->query('UPDATE db_users SET refs = refs + ? WHERE id = ?',array('1',$rid));
         
    if ($lid) {

		$period = $time+60*60*24*$periodData;
		$db->query("INSERT INTO db_store (uid, tarif, title, speed, hashpower, `add`, `end`, `status`, `last`) VALUES ('$lid', '$idTarif', '$title', '$speed', '$hashpower', '$time', '$period', '1' , '$time')");

        # Пишем в статистику
        $db->query("UPDATE `db_stats` SET `users` = `users` + 1 WHERE `id` = '1'");
    }

        $_SESSION['uid'] = $lid;
        $_SESSION['login'] = $login;
  //  echo ' <center><div class="dogehome"></div></center><hr>';
    //    echo '<div class="alert alert-success text-center"> WELCOME!</div></div></div>'; 
        header('Location: /user/dashboard');return;
        }
    else {
        # Вывод ошибок
        echo '<div class="alert alert-danger">'.array_shift($errors).'", "error"); </div>';
        }
    }
    }
}    
?>

<div class="info-center">
          <div class="bun-miner rotateIn">
              <span>5 TH/s <p>FREE</p></span>
          </div>

          <div class="simple-intro fadeInDown">
               <h4>Cloud Mining <b>TRX</b> </h4>

               <p>Discover cloud mining for TRON (TRX)! Enjoy the benefits of this cryptocurrency without worrying about hardware or energy. Cloud mining simplifies the process and maximizes your profits. Start exploring the future of cryptocurrencies today!</p>
          </div>

          <div class="cooler-con zoomIn">
              <svg width="538" height="538" viewBox="0 0 538 538" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="268.313" cy="268.903" r="147.231" fill="#312243"></circle>
<circle cx="268.313" cy="268.903" r="147.231" fill="#312243"></circle>
<g filter="url(#filter0_d_9_286)">
<path d="M414 269C414 349.081 349.081 414 269 414C188.919 414 124 349.081 124 269C124 188.919 188.919 124 269 124C349.081 124 414 188.919 414 269Z" stroke="url(#paint0_radial_9_286)" stroke-width="20"></path>
</g>
<path d="M299.009 270.005C299.009 287.129 285.128 301.01 268.005 301.01C250.881 301.01 237 287.129 237 270.005C237 252.881 250.881 239 268.005 239C285.128 239 299.009 252.881 299.009 270.005Z" fill="#A52044" stroke="#FD5F84" stroke-width="12"></path>
<circle cx="268" cy="270" r="30" fill="#AB2B4E"></circle>
<g filter="url(#filter1_d_9_286)">
<path d="M277.887 259.803L252.942 255.34L266.069 287.457L284.361 265.79L277.887 259.803ZM277.485 261.77L281.301 265.296L270.864 267.134L277.485 261.77ZM268.598 266.766L257.598 257.896L275.577 261.112L268.598 266.766ZM267.814 268.335L266.021 282.753L256.35 259.089L267.814 268.335ZM269.474 269.1L281.031 267.065L267.775 282.768L269.474 269.1Z" fill="#ECE8E9"></path>
</g>
<g filter="url(#filter2_d_9_286)" class="rotating">
<path fill-rule="evenodd" clip-rule="evenodd" d="M390.147 235.393C355.268 210.882 315.597 232.551 301.76 241.686C305.287 245.996 307.929 250.971 309.533 256.324C311.137 261.678 311.672 267.304 311.107 272.88C347.967 267.936 390.131 293.049 390.131 293.049C398.32 263.374 390.147 235.393 390.147 235.393ZM357.649 357.627C361.516 314.835 323.274 291.247 308.567 283.81C304.563 294.407 296.569 303.011 286.326 307.747C308.798 337.341 308.007 386.773 308.007 386.773C337.605 378.889 357.649 357.627 357.649 357.627ZM244.058 303.761C229.678 338.307 186.731 362.635 186.731 362.635C208.141 384.426 236.357 391.144 236.357 391.144C275.102 372.863 276.524 327.606 275.661 311.034C270.163 311.978 264.542 311.821 259.119 310.571C253.697 309.321 248.581 307.004 244.066 303.753L244.058 303.761ZM229.71 151.055C200.112 158.947 180.06 180.209 180.06 180.209C176.202 223.001 214.444 246.589 229.151 254.018C233.156 243.424 241.15 234.823 251.391 230.089C228.919 200.495 229.71 151.055 229.71 151.055ZM301.361 146.692C262.608 164.965 261.194 210.222 262.056 226.794C267.554 225.849 273.175 226.005 278.597 227.253C284.019 228.501 289.136 230.817 293.652 234.067C308.031 199.521 350.987 175.193 350.987 175.193C329.577 153.402 301.361 146.692 301.361 146.692ZM226.602 264.94C189.751 269.9 147.578 244.779 147.578 244.779C139.398 274.462 147.562 302.435 147.562 302.435C182.449 326.946 222.113 305.276 235.957 296.142C232.429 291.832 229.786 286.858 228.18 281.504C226.575 276.151 226.039 270.525 226.602 264.948L226.602 264.94Z" fill="url(#paint1_radial_9_286)"></path>
</g>
<defs>
<filter id="filter0_d_9_286" x="0.0999985" y="0.0999985" width="537.8" height="537.8" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix>
<feOffset></feOffset>
<feGaussianBlur stdDeviation="56.95"></feGaussianBlur>
<feColorMatrix type="matrix" values="0 0 0 0 0.984314 0 0 0 0 0.396078 0 0 0 0 0.533333 0 0 0 1 0"></feColorMatrix>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_9_286"></feBlend>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_9_286" result="shape"></feBlend>
</filter>
<filter id="filter1_d_9_286" x="252.042" y="255.34" width="33.2189" height="35.0177" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix>
<feOffset dy="2"></feOffset>
<feGaussianBlur stdDeviation="0.45"></feGaussianBlur>
<feComposite in2="hardAlpha" operator="out"></feComposite>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"></feColorMatrix>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_9_286"></feBlend>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_9_286" result="shape"></feBlend>
</filter>
<filter id="filter2_d_9_286" x="104.438" y="107.192" width="328.836" height="323.451" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix>
<feOffset></feOffset>
<feGaussianBlur stdDeviation="19.75"></feGaussianBlur>
<feComposite in2="hardAlpha" operator="out"></feComposite>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.333333 0 0 0 0 0.513726 0 0 0 0.49 0"></feColorMatrix>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_9_286"></feBlend>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_9_286" result="shape"></feBlend>
</filter>
<radialGradient id="paint0_radial_9_286" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(269 269) rotate(90) scale(155)">
<stop offset="0.899174" stop-color="#FF5583"></stop>
<stop offset="0.930337" stop-color="#FFC3D3"></stop>
<stop offset="0.952774" stop-color="white"></stop>
<stop offset="0.978951" stop-color="#FDB8C8"></stop>
<stop offset="1" stop-color="#FB6588"></stop>
</radialGradient>
<radialGradient id="paint1_radial_9_286" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(267.272 265.865) rotate(-179.444) scale(123.548 120.687)">
<stop stop-color="#FA6988"></stop>
<stop offset="0.227238" stop-color="#F89A9B"></stop>
<stop offset="1" stop-color="#FF5583"></stop>
</radialGradient>
</defs>
</svg>

          </div>

          <div class="sim-miner fadeInDown "><span id="trxAmount">0.000000</span>
             <p data-sim="" style="color: #F84B73;">TRX</p>
          </div>


          <div class="container-xl">

<div class="row align-items-center">
<div class="col-lg-3">
</div>
				<div class="col-lg-6">



<script>
(function () {
	var writeTo = document.getElementById("trxAmount");
	var sec = 0.000000;
	var a = setInterval(function () {
		sec = sec + (12.000000/1000);
		writeTo.innerHTML = sec.toFixed(6);
	}, 100)
})();
</script>
<style>
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
    
	background: rgba(44, 18, 57, 0.62) !important;
}
</style>
<?php if ($uid) { ?>
    <div class="m-auto text-center">
<a href="/user/dashboard" class="btn btn-lg btn-danger btn-home me-auto">START</a>
</div>
  <?php } else { ?>
    <form action="" method="POST"> 
    <div class="mb-3 login-home">
      <input type="text" name="tron" class="form-control notranslate" placeholder="Your TRON Address" style="line-height: auth;background-color: #241534 !important;">
    </div> 

    <div class="m-auto text-center">
    <button name="reg" type="submit" class="btn btn-lg btn-danger btn-home animated shake m-auto">START</button>
    </div>
    </form>

  <?php } ?>
</div>
</div>


  </div>



        </div>




  
</div>