<?php session_set_cookie_params(0);
require_once('../../Connections/odonto_connection1.php');
?>
  
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>PonderZone</title>
<link href="./iconic/font/css/open-iconic-bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="../../bootstrap4/css/bootstrap.min.css" />

<style>
#number {
  font-size:50px;
  color:#434343;
}
</style>
<script>

function myFunction0(bot) {
	var codigo = document.getElementById("codigo").value;
	if(codigo != ""){
	window.open("./auxi_warn.php?boton="+bot+"&codigo="+codigo,"_parent");
	}
	else {
		document.getElementById("demo").innerHTML = "Ingresa Codigo!";
		alert('Ingresa Codigo');
		}
}
</script>

</head>
<body style="background-color:black">

<div class="container-fluid">
<br>


<?php
echo "<input type='text' class='form-control text-center";
if(isset($_SESSION['inicio'])){echo " invisible";}
echo "' id='codigo' name='codigo' aria-label='Default' aria-describedby='inputGroup-sizing-default' style='height:3rem;font-size:1.5rem' placeholder='Codigo de Mesa' required='true' ";
if(isset($_SESSION['inicio'])){
	$codigo=$_SESSION['codigo'];
echo "value=".$codigo;
}
echo "></input>";
?> 

<?php if(isset($_SESSION['codigo'])){

$codigo=$_SESSION['codigo'];
$query_rs_todos = "SELECT * FROM `mesas` WHERE codigo LIKE '$codigo'";
$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 * FROM `datos` WHERE negocio LIKE '$negocio'";
$rs_ingreso5 = mysqli_query($odonto_connection,$query_rs_todos) or die(mysqli_error());
$row_rs_ingreso5 = mysqli_fetch_assoc($rs_ingreso5);
$logo = $row_rs_ingreso5['logo'];

echo "<font style='position:absolute;top:2rem;left:35%;font-size:1.0rem;width:12rem;color:#fff'><b>";
if ($logo == '1') echo "<img src='logos/".$negocio.".jpg'/>";
else echo $row_rs_ingreso5['nombre'];
echo " - mesa ".$mesa."</b></font>";

echo "<a href='auxi_warn.php?deslog=1'><font style='position:absolute;top:2rem;left:7%;font-size:1.0rem;width:15rem;color:#fff'><b><span class='oi oi-account-logout'></span> Salir</b></font></a>";
}
?>
<small class"form-text text-muted text-center" style="color:white" id="demo"></small>  
<br>
<button type="button" class="btn btn-warning btn-lg btn-block" style="height:7rem;font-size:2.0rem;color:white;background-color:#FB9D19" name="mozo" onclick="myFunction0(1)" ><span class="oi oi-bell" title="bell" aria-hidden="true"></span><b> Llama Mozo/a</b></button>
  
<button type="button" class="btn btn-danger btn-lg btn-block" style="height:7rem;font-size:2.0rem;color:white" name="carta" onclick="myFunction0(2)" ><span class="oi oi-align-left"></span><b> Solicita Carta</b></button>

<button type="button" class="btn btn-success btn-lg btn-block" style="height:7rem;font-size:2.0rem;color:white;background-color:#339646" name="cuenta" onclick="myFunction0(3)"><span class="oi oi-dollar"></span><b> Pide Cuenta</b></button>

<button type="button" class="btn btn-secondary btn-lg btn-block" style="height:7rem;font-size:2.0rem;color:white;background-color:#216AB1" name="pedido" onclick="myFunction0(6)"><span class="oi oi-location"></span><b> Arma Pedido</b></button>


<button type="button" class="btn btn-primary btn-lg btn-block" style="height:7rem;font-size:2.0rem;color:white" name="servicio" onclick="myFunction0(4)"><b>Califica Servicio</b></button>

<button type="button" class="btn btn-info btn-lg btn-block" style="height:7rem;font-size:2.0rem;color:white" name="sugerencias" onclick="myFunction0(5)"><b>Tus Sugerencias</b></button>

<div id="number"><?php 
//echo $_SESSION['inicio'];
//echo $_SESSION['codigo'];
//$horaInicio = new DateTime($_SESSION['inicio']);
//$horaTermino = new DateTime($timer);
//$interval = $horaInicio->diff($horaTermino);
//echo $interval->format('%h %i %s');
//echo phpinfo();
?></div>

</div>


<script src="../../bootstrap4/jquery-3.3.1.min.js"></script>
<script src="../../bootstrap4/js/bootstrap.js"></script>

</body>
</html>