<?php	require_once('../preheader1.php'); // <-- this include file MUST go first before any HTML/output
$user=$_SESSION['MM_Username'];
if(!isset($user)) header("Location:" . "../../index.php?deslogeo");
require_once('../../Connections/odonto_connection1.php'); 

$query_rs_todos = "SELECT negocio,categ FROM ingreso WHERE user LIKE '$user'";
$rs_ingreso0 = mysqli_query($odonto_connection,$query_rs_todos) or die(mysqli_error());
$row_rs_ingreso0 = mysqli_fetch_assoc($rs_ingreso0);
$categ=$row_rs_ingreso0[categ];
$negocio=$row_rs_ingreso0[negocio];

$q = "SELECT DISTINCT mozo FROM mesas WHERE negocio LIKE '$negocio'";
$rs = mysqli_query($odonto_connection,$q) or die(mysqli_error());
$num_rows = mysqli_num_rows($rs);

#the code for the class
include ('../ajaxCRUD.class.php'); // <-- this include file MUST go first before any HTML/output

#this one line of code is how you implement the class
########################################################
##

$tabla1 = new ajaxCRUD("MESAS", "zonas", "id", "../");

$tabla1->omitPrimaryKey();

$tabla1->displayAs("zona", "ZONA");
$tabla1->displayAs("habilitado", "Habilita botones mozo y carta");
$tabla1->displayAs("habilit_pedidos", "Habilita pedidos con carta virtual");
$tabla1->omitField("negocio");

$tabla1-> addWhereClause("WHERE (negocio = '$negocio') AND zona <= $num_rows");
//$tabla1->turnOffAjaxEditing();

$tabla1->addOrderBy("ORDER BY id ASC");

$tabla1->defineCheckbox("habilitado", "1", "0");
$tabla1->defineCheckbox("habilit_pedidos", "1", "0");
//set field fldCheckbox to be a checkbox
//$tabla1->defineCheckbox("fldCheckbox");

$tabla1->disallowDelete();

$tabla1->hover_color = "#E9E8DC";
$tabla1->setLimit(110);

$numRows = $tabla1->getNumRows();
$tabla1->disallowAdd();
$tabla1->setCSSFile('greysuit.css');

?>

<!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('../../inc/bootstrap.php');?>
	
</head>
<body style="background-color:#0D1749"/>
	
	<?php	 require_once('menu.php');?>
	<br>
	<?php	 require_once('botones.php');?>
		
		<!-- <div class="row" ><b>
<span style="border-image: initial; border: 2px solid white;">MESAS Y MOZOS</span>
</b><p>
		</div> -->
<b>
	<!--
	Para ver los codigos QR de las mesas el siguiente <a href='http://ponderzone.com/mesas_qr/<?php echo $negocio;?>/' target='_blank' style='color:orange'>link</a></b>
	-->
	<div class="container-fluid text-center">
		<div class="row">
			<div class="col">
				<h3>Habilitacion de las Zonas</h3>
			</div>
		</div>
		<div class="row">
			<div class="col">
			<?php $tabla1->showTable();?>
			</div>
		</div>
	</div>

</body>
</html>

