
<?php 
session_start();
if(!isset($_SESSION['idUsuario'])){
	header("location:../");
}
include_once '../conexao/index.php';

error_reporting(E_ALL);

$_SESSION['idUsuario'] = $_SESSION['idUsuario'];
$_SESSION['nomeUsuario'] = $_SESSION['nomeUsuario'];
$_SESSION['categoriaUsuario'] = $_SESSION['categoriaUsuario']; 
/*Variaveis do Sistema*/
/*********************************************/

?>

<!DOCTYPE html>
<html>
<head>
	<title>iVone</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width-device-width, initial-scale=1">
	<link rel="shorcut icon"  href="../img/config/5087847.png">
	<link rel="stylesheet" type="text/css" href="css/pos_mesas.css">
	<link rel="stylesheet" type="text/css" href="../font-awesome/css/font-awesome.css">
	<link rel="stylesheet" type="text/css" href="../font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="../css/jquery-ui.min.css"> 
	<link rel="stylesheet" type="text/css" href="../css/select2.min.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
	<link rel="stylesheet" href="../css/app.css">
	<link rel="stylesheet" type="text/css" href="../css/jquery-ui.css">
	<script type="text/javascript" src="../js/jquery-3.3.1.min.js"></script>
	<script type="text/javascript" src="../js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="../js/select2.min.js"></script>
	<script type="text/javascript" src="../js/jquery-ui.js"></script>
	<link rel="stylesheet" href="../css/choices.min.css" />
	<link rel="stylesheet" href="../css/perfect-scrollbar.css">
   <link rel="stylesheet" href="../css/bootstrap-icons/bootstrap-icons.css">
	<style type="text/css">
		*{font-size: 11pt;}

	</style>
</head>
<body>
<div class="principal">
	<div class="esquerda">
		<div class="cabecalhoEsquerda">
			<h4 class="operador">Utilizador: <?php echo $_SESSION['nomeUsuario']; ?></h4>
			<p class="relogio">
				<?php 
					$data_hora = date("Y-m-d H:i:s");
					echo $data_hora;
				?>
			</p>
			<a style="margin-left: 5px;" href="../"><i class="fa fa-sign-out" aria-hidden="true"></i></a>
		</div>
		<style type="text/css">
			.some{
				position: relative;
				z-index: 4;
				top: 20px;
				right: 30px;
			}
		</style>
		<div class="conteudoEsquerda">
			<div class="btn">
				<?php 
					$sql = "SELECT * FROM mesas";
					$rs = mysqli_query($db, $sql);
					while ($dados = mysqli_fetch_array($rs)) {
				?>
					<a href="vd.php?mesa=<?php echo $dados['numero']; ?>" >
						<span>
							<?php 
								$status = $dados['status'];
								if ($status == 1) {
									echo "<img class='some' src='../img/disponivel.png' style='width: 40px;'>";
								}else{
									echo "<img class='some' src='../img/indisponivel.png' style='width: 40px;'>";
								}
							?>
						</span>
						<img src="../img/mesa-redonda.png">
						<p>Mesa <?php echo $dados['numero']; ?></p>
					</a>
				<?php
					}
				?>
			</div>
		</div>
	</div>
	
</div>
<!--ELEMENTOS FLUTUANTES -->

	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
	<script src="../js/perfect-scrollbar.min.js"></script>
  <script src="../js/bootstrap.bundle.min.js"></script>

  <!-- Include Choices JavaScript -->
  <script src="../js/choices.min.js"></script>

	<script type="text/javascript">
		$(function() {

		});
	</script>
</body>
</html>