<?php  
session_start();
  if((isset($_SESSION["k_name"]))){
        // header("location:dashboard.php");
        }
        else{ 


?>

<!DOCTYPE html>
<html lang="es">



<head>
<?php include('head.php'); ?>
</head>

<body>



  <div class="loader"></div>
  <div id="app">
    <section class="section">
      <div class="container mt-5">
        <div class="row">
          <div class="col-12 col-sm-8 offset-sm-2 col-md-6 offset-md-3 col-lg-6 offset-lg-3 col-xl-4 offset-xl-4">
            <div class="card card-primary">

              <div class="main-sidebar sidebar-style-2" style="background-image: url('assets/img/front_samaria3.png'); height: 100%; background-repeat: no-repeat; height: 100%">
                <aside id="sidebar-wrapper">
                  <div class="sidebar-brand">
                    <a href="#"> <img alt="image" src="assets/img/l1.png" class="header-logo" /> 
                      <!-- <span class="logo-name">Sistema de Reservación de Áreas Comunes</span> -->
                    </a>
                  </div>
                </aside>
              </div>


              
      <div class="col-xl-12 col-lg-12 col-md-12">
            <?php 
            if (isset($_GET['success'])) {
            ?>

                <div class="alert alert-success alert-dismissible fade show" role="alert">
                    <strong>Registro exitoso!</strong> Espera tu activación y luego ingresa tu código para Reservar un área.
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

            <?php
            }


            if (isset($_GET['act'])) {
            ?>

            <div class="alert alert-info alert-dismissible fade show" role="alert">
                <strong>Debe esperar a que sea activado!</strong> 
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>

            <?php
            }

            if (isset($_GET['error'])) {
            ?>

            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <strong>Email no válido!</strong> 
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>

            <?php
            }

            if (isset($_SESSION['k_temp_ocupacion'])) {

              $tipoc = $_SESSION['k_temp_ocupacion'];

              switch ($tipoc) {
                case '1':
                  $sndto = "Huésped"; 
                  break;

                case '2':
                  $sndto = "Huésped Invitado"; 
                  break;

                case '3':
                  $sndto = "Propietario"; 
                  break;

                default:
                  $sndto = "Usuario";
                  break;
              }


            ?>

                <div class="alert alert-success alert-dismissible fade show" role="alert">
                    <strong>Estimado <?php echo $sndto. ", al ingresar un correo electrónico le será enviado la confirmación de cada reserva.";?></strong> 
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>

            <?php
            }

            ?>
        </div>

              <div class="card-header" style='text-align:center'>
                <h4>Email</h4>
              </div>
              <div class="card-body">
                <form method="POST" action="validation/register_mail.php" class="needs-validation" novalidate=""> 
                  <input type="hidden" value="<?php if (isset($_SESSION['k_temp_id'])) {
                    echo $_SESSION['k_temp_id'];
                  } ?>" name="ide">
                  <div class="form-group">
                    <div class="d-block">
                      <label for="password" class="control-label">Ingrese un correo electrónico.</label>
                      <div class="float-right">
                      
                      </div>
                    </div>
                    <input id="email" type="email" class="form-control" name="email" tabindex="2" required autofocus="">
                    <div class="invalid-feedback">
                     Por favor ingresa tu Email
                    </div>
                  </div> 
                  <div class="form-group">
                    <button type="submit" name="btn_send" class="btn btn-primary btn-lg btn-block" tabindex="4">
                      Acceder
                    </button>
                  </div>
                </form>
                <div class="text-center mt-4 mb-3">
                  <br><br>
                  <img src="assets/img/reserva.png" width="200px" alt="">
                  &nbsp;
                   <!-- <a href="re_code.php" class="text-small">Olvidaste tu codigo! </a> -->
                </div> 
              </div>
            </div>
            <div class="mt-5 text-muted text-center">
               <!-- No! tienes cuenta aún? <a href="register.php">Crear cuenta</a>  -->
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>
  <!-- General JS Scripts -->
  <script src="assets/js/app.min.js"></script>
  <!-- JS Libraies -->
  <!-- Page Specific JS File -->
  <!-- Template JS File -->
  <script src="assets/js/scripts.js"></script>
  <!-- Custom JS File -->
  <script src="assets/js/custom.js"></script>
</body>

 
</html>

<?php
  }
?>
