<?php 
session_start();

include_once '../../conexao/index.php';

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

$status = 'Aberto';

$sqlBox = "SELECT diaperiodo FROM periodo WHERE diaperiodo = '$status' AND usuario = '$userID'";
$rsBox = mysqli_query($db, $sqlBox);
if (mysqli_num_rows($rsBox) > 0) {
$sql = "SELECT SUM(totalfiladeespera) AS TOT FROM filadeespera WHERE usuariofiladeespera = '$userID'";
$rs = mysqli_query($db, $sql);
while ($dados = mysqli_fetch_array($rs)) {
	$total = $dados['TOT'];
	echo $total;
}
}
