<?php include 'concha.php';



mysql_connect("$host","$usuario","$contra");



mysql_select_db ("$basedatos");



$sql = "SELECT * FROM `sesiones`";



$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{

$user_con = $row["user"];







}



mysql_free_result($consulta);





$sql = "SELECT * FROM `usuarios` WHERE `usuario` LIKE '$user_con'";



$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{

$nombre_user = $row["nombre"];

$cat_user = $row["cat"];





}



mysql_free_result($consulta);



$sql = "SELECT * FROM `caja` ORDER BY ID desc LIMIT 1";



$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{

$total_caja = $row["total_caja"];





}



mysql_free_result($consulta);









$sql = "SELECT * FROM `caja_tarjeta` ORDER BY ID desc LIMIT 1";



$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{

$total_caja_tarjeta = $row["total_caja"];





}



mysql_free_result($consulta);









$sql = "SELECT * FROM `caja_fiado` ORDER BY ID desc LIMIT 1";



$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{

$total_caja_fiado = $row["total_caja"];





}



mysql_free_result($consulta);



$sql = "SELECT * FROM `caja_proveedores` ORDER BY ID desc LIMIT 1";



$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{

$total_caja_proveedores = $row["total_caja"];





}



mysql_free_result($consulta);







$sql = "SELECT * FROM `caja_cigarrillos` ORDER BY ID desc LIMIT 1";



$consulta = mysql_query ($sql);



while ($row = mysql_fetch_array($consulta))



{

$total_caja_cigarrillo = $row["total_caja"];





}



mysql_free_result($consulta);



?>