<?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"] < 2):
   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"];
$conex = conectar();
?>
<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" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
   $(function() {
      $("#fecini").datepicker({
         dateFormat: 'dd-mm-yy'});
      $("#fecfin").datepicker({
         dateFormat: 'dd-mm-yy'});
   });
</script>
<style type="text/css">
   .campos{
      border-radius: 5px;
      border: 1px solid #39c;
      text-align: center;
      font-family: Arial;
      font-size: 9pt;
      background-color: #E9E9E9;
   }

   .select{
      border-radius: 5px;
      border: 1px solid #39c;
   }
</style>
<div class="col-xs-12">
<br>
<center><h1>Resumen de Ventas</h1></center>
<form method="POST" action="vt421.php">
<table width="550" border="0" cellpadding="3" cellspacing="1" align="center">
<tr height="50">
<center>
<FONT FACE="times new roman"><strong>Fecha Ini :</strong></FONT>
<input type="text" name="fecini" id="fecini" size="10" class="campos" required>
&nbsp;
<FONT FACE="times new roman"><strong>Fecha Fin :</strong></FONT>
<input type="text" name="fecfin" id="fecfin" size="10" class="campos" required>
&nbsp;
<FONT FACE="times new roman"><strong>Usuario :</strong></FONT>
&nbsp;
<select name="xusua" style="width:100px" class="campos">
<?php
$dausr = "select * from vtusr
          order  by 1";
$squsr = mysql_query($dausr);
while ($liusr = mysql_fetch_assoc($squsr)):
   if ($liusr["vtusrusua"] == $miusr):
      echo "<option  value='".$liusr['vtusrusua']."' selected>".$liusr['vtusrusua']."</option>";
   else:
      echo "<option  value='".$liusr['vtusrusua']."'>".$liusr['vtusrusua']."</option>";
   endif;
endwhile;
?>
</select>
&nbsp;
<button type="submit" name="enviar" class="btn btn-success btn-sm">Generar</button>
&nbsp;
<a href="vt000.php" class="btn btn-danger btn-sm">Salir</a></center>
</center>
</tr>
</table>
</form>
