<?php	session_set_cookie_params(0);

require_once('../preheader1.php'); // <-- this include file MUST go first before any HTML/output

session_start();

if(isset($_SESSION['inicio']))
{
	$codigo=$_SESSION['codigo'];
	
	if($_SESSION['estoy_logueado']) header("Location:" . "https://ponderzone.com/warn/ajax/examples/index0.php");
	$_SESSION['voy'] = 'negativo';
}
else {
	session_destroy();
	header("Location:" . "http://ponderzone.com");
	}

require_once('../../Connections/odonto_connection1.php');

$query_rs_todos = "SELECT negocio FROM mesas WHERE codigo LIKE '$codigo' LIMIT 1";
$rs_ingreso0 = mysqli_query($odonto_connection,$query_rs_todos) or die(mysqli_error());
$row_rs_ingreso0 = mysqli_fetch_assoc($rs_ingreso0);
$mesa=$row_rs_ingreso0['mesa'];
$negocio=$row_rs_ingreso0['negocio'];

$query_rs_todos = "SELECT nombre,imagen_index,cliente_habilitado FROM datos WHERE negocio LIKE '$negocio' LIMIT 1";
$rs_ingreso1 = mysqli_query($odonto_connection,$query_rs_todos) or die(mysqli_error());
$row_rs_ingreso1 = mysqli_fetch_assoc($rs_ingreso1);
$nombre_negocio = $row_rs_ingreso1['nombre'];
$imagen_index = $row_rs_ingreso1['imagen_index'];
$cliente_habilitado = $row_rs_ingreso1['cliente_habilitado'];
$display = "none";
if($cliente_habilitado) $display = "block";

?>

<!DOCTYPE HTML>
<html>
<head>
<!--<meta http-equiv="refresh" content="7" charset="UTF-8"> -->
<meta charset="UTF-8">
<title>PonderZone</title>
<link rel="icon" href="../../pondercode.jpg">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,maximum-scale=1.0" />


<?php 
require_once($_SERVER['DOCUMENT_ROOT'] .'/warn/bootstrap/bootstrap_js_gral.php');
require_once($_SERVER['DOCUMENT_ROOT'] .'/warn/bootstrap/bootstrap_css_gral.php');
?>

<link href='https://fonts.googleapis.com/css?family=Handlee' rel='stylesheet'>

<link rel="stylesheet" href="estilos_mgp.css" />
<?php require_once("../../inc/css_warn.php");?>

<script>

var Nomb_negocio = <?php echo "'".$nombre_negocio."'";?>;

function AnimaMaxi(){
	var count = 0;
	var id = setInterval(frame, 800);
	function frame() {
		if (count == 0) {
		  	document.getElementById("Dejanos_anim").className = "fas fa-address-card";
		  	document.getElementById("Yalos_anim").className = "fas fa-hand-point-right";
		  	document.getElementById("Nomb_anim").innerHTML = "<h2 class='text-white' class='texto_sombra'>"+ Nomb_negocio + " Digital</h2>";
		  	count++;
			} else {
			document.getElementById("Dejanos_anim").className = "far fa-address-card";
			document.getElementById("Yalos_anim").className = "far fa-hand-point-right";
			document.getElementById("Nomb_anim").innerHTML = "<h2 style='color:lightgrey' class='texto_sombra'>"+ Nomb_negocio + " Digital</h2>";
			count = 0;
		}
  }
}

	$(document).ready(function(){
		$("#myBtn").click(function(){
		$("#myModal").modal();
		});
		});
	

function myFunction() {
  window.open("https://ponderzone.com/warn/ajax/examples/index0.php","_parent");
}

</script>
		
<style>
<?php
	$link_imagen = "fondos/".$negocio."/".$imagen_index;
?>

.container_maxi{
   background: url(<?php echo $link_imagen;?>) no-repeat fixed center;
   -webkit-background-size: cover;
   -moz-background-size: cover;
   -o-background-size: cover;
   background-size: cover;
   height: 100%;
   width: 100% ;
   text-align: center;
}		
</style>

</head>

<body style="background-color:white;font-size:1rem" onload="AnimaMaxi()">
  <br>

<div class="container_maxi"> 

<div class='row text-center'>
	<div class='col'>
		<br>
		<div id='Nomb_anim'></div>
		
	</div>
</div>
<div class='row'>
	<div class='col'>
		<br>
	</div>
</div>
<div class='row'>
	<div class='col'>
		<button type='button' class='btn btn-light btn-lg btn-block btn-circle btn-xl pt-2 pb-2 shadow' style='height:4rem;font-size:1.6rem<?php echo ";display:".$display;?>' id='myBtn'><i id='Dejanos_anim'></i> Anotate</button>
	</div>
</div>

<div class='row'>
	<div class='col'>
		<br>
	</div>
</div>

<div class='row'>
	<div class='col'>
		<button type='button' class='btn btn-secondary btn-lg degrade btn-circle btn-xl pt-2 pb-2' style='height:4rem;font-size:1.8rem<?php echo ";display:".$display;?>' id='myBtn2' onclick="myFunction()"><i id='Yalos_anim'></i> Entrar</button>
		<br><br><br><br><br><br><br>
	</div>
</div>

  <!-- The Modal -->
  <div class="modal fade" id="myModal">
    <div class="modal-dialog">
      <div class="modal-content">
      
        
        <!-- Modal Header -->
        <div class="modal-header">
          <h4 class="modal-title" style='color:black'>Dejanos tus datos</h4>
          <button type="button" class="close" data-dismiss="modal">×</button>
        </div>
        
        <!-- Modal body -->
        <div class="modal-body">
			<div class='container' style='background-color:black;color:#fff'>
						<form id="asd" action="<?php echo "https://ponderzone.com/warn/ajax/examples/index0.php";?>" method="post">
						<div class="row">
								<div class="form-group col">
									<label for="apellido" >Apellido</label>
									<input type="text" class="form-control" id="apellido" pattern="^.{3,25}$" placeholder="Ingresa tu Apellido" name="apellido" required>
									<div class="invalid-feedback">Ingresa tu Apellido</div>
								</div>
						</div>
						<div class="row">
								<div class="form-group col">
									<label for="nombre" >Nombre</label>
									<input type="text" class="form-control" pattern="^.{3,25}$" id="nombre" placeholder="Ingresa tu Nombre" name="nombre" required>
									<div class="invalid-feedback">Ingresa tu Nombre</div>
								</div>
						</div>
						<div class="row">
							<div class="form-group col">
								  <label for="dni" >DNI:</label>
								  <input type="text" class="form-control" id="dni" placeholder="dni" name="dni" required>
							</div>
						</div>
						<div class="row">
							<div class="form-group col">
								  <label for="celular" >Celular</label>
									<input type="text" class="form-control" pattern="^(?=(?:\D*\d){7,15}\D*$)\+?[0-9]{1,3}[\s-]?(?:\(0?[0-9]{1,5}\)|[0-9]{1,5})[-\s]?[0-9][\d\s-]{5,7}\s?(?:x[\d-]{0,4})?$"  id="celular" placeholder="Tu Celular" name="celular" required>
									<div class="invalid-feedback">Sin el Cero ni el 15 (p. ej. 3416656878)</div>
							</div>
						</div>
						<div class="row">	
								<div class="form-group col">
								  <label for="email" >mail:</label>
								  <input type="email" class="form-control" id="email" placeholder="Tu e-mail" name="email">
							  </div>
						</div>
						<div class="row">	  
							<div class="form-group col">
								<button type="submit"  id="myBtn" style="width:10rem" name="button_form" class="btn btn-light"><span class="oi oi-thumb-up"></span><b> OK</b></button>
							</div>
						</div>

				</div>
		</div>
        
        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="button" class="btn btn-dark" data-dismiss="modal">Cerrar</button>
        </div>
        
      </div>
    </div>
  </div>


</div>
  

</body>

