<?php
session_start();
if (!isset($_SESSION["user_id"]) || $_SESSION["user_id"]==null):
   print "<script>alert(\"Acceso Invalido!\");
   window.location='login.php';</script>";
endif;
if ($_SESSION["user_at"] < 4):
   print "<script>alert(\"Sin Acceso a Transaccion!\");
   window.location='vt000.php';</script>";
endif;
include_once ("lib/fpdf/funci.php");
date_default_timezone_set('America/La_Paz');
$miusr = $_SESSION["user_id"];
$coalm = $_SESSION["user_al"];
$conex = conectar();
$fehoy = date("Y-m-d");
//$fehoy = "2021-06-12";
?>
<body bgcolor="#E0FFFF">
<div class="main-wrapper">
<link href="css/tabla.css" rel="stylesheet" type="text/css" />
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" />
<center><h1>Resumen de Ventas</h1></center>
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
<a class="btn btn-danger" href="vt000.php">Salir</a>
<center><table border="0" cellpadding="0" cellspacing="0" class="tabla">
   <thead>
	<th><center>Trans</center></th>
	<th><center>Factura</center></th>
	<th><center>Fecha</center></th>
	<th>Cliente</th>
	<th><center>Importe</center></th>
	<th><center>Opcion</center></th>
   </thead>
<?php
$mysql = "select vecabntra,vecabnfac,vecabfech,vecabncli,vecabtven
          from   vecab
          where  vecabfech = '$fehoy'
          and    vecabusua = '$miusr'
          and    vecabstat = 0
          order  by 1";
$result = mysql_query($mysql);
$toven = 0;
while ($row = mysql_fetch_array($result)):
   $toven += $row[vecabtven];
   ?>
   <tr class="modo1">
   <td><center><?php echo $row[vecabntra];?></center></td>
   <td><center><?php echo $row[vecabnfac];?></center></td>
   <td><center><?php echo date("d-m-Y",strtotime($row[vecabfech]));?></center></td>
   <td><?php echo $row[vecabncli];?></td>
   <td><center><?php echo number_format($row[vecabtven],2);?></center></td>
   <td><center><a class="btn btn-danger btn-xs" href="vt213.php?id=<?php echo $row[vecabntra];?>">Eliminar</a>
   </tr>
   <?php
endwhile; ?>
</table></center>
<h3><center>Total Venta : <?php echo number_format($toven,2); ?></center></h3>
</div>
</body>
