<?php
//$q = intval($_GET['q']);
$q = $_GET['q'];
$r = $_GET['r'];
$codigo = $_GET['codigo'];
$recib = $_GET['recib'];

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

$con = mysqli_connect($hostname_odonto_connection,$username_odonto_connection,$password_odonto_connection,$database_odonto_connection);
if (!$con) {die('Could not connect: ' . mysqli_error($con));}

$sql="SELECT cant,recibido FROM pedidos WHERE negocio = '".$q."' AND mesa = '".$codigo."'";
$result = mysqli_query($con,$sql);
$row_rs_ingreso = mysqli_fetch_assoc($result);
$row_cnt = mysqli_num_rows($result);

$count = 0;
$count_recib = 0;

do{
	$count = $count + $row_rs_ingreso['cant'];
	$count_recib = $count_recib + $row_rs_ingreso['recibido'];
}
while($row_rs_ingreso= mysqli_fetch_assoc($result));

$dif = $count - $r;
$dif_recib = $count_recib - $recib;
//echo "<font style='color:white'>".$row_cnt."</font><br>";
//echo "<font style='color:white'>".$recib."</font><br>";
//echo "<font style='color:white'>".$count."</font><br>";
if($dif != '0'){
echo "aqxi";
}
if($dif_recib != '0'){
echo "aqux"; //echo aqui
}
mysqli_close($con);
?>
