<?php
session_start();
if (!isset($_SESSION["user_id"]) || $_SESSION["user_id"] == null || $_SESSION["user_st"] != 0):
   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');
$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" />
<center><h1>Consulta de Usuarios</h1></center>
<center><a class="btn btn-success" href="vt512.php">Nuevo</a>
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;&nbsp;
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&ensp;&nbsp;&nbsp;
<a class="btn btn-danger" href="vt000.php">Salir</a></center>
<center><table border="0" cellpadding="0" cellspacing="0" class="tabla">
   <thead>
	<th>Usuario</th>
	<th>Nombre Completo</th>
	<th>Correo Electronico</th>
	<th><center>Seleccion</center></th>
	<th><center>Seleccion</center></th>
   </thead>
<?php
$mysql = mysql_query("select * from adusr
                      order  by 1");
while ($rowid = mysql_fetch_array($mysql)): ?>
   <tr class="modo1">
   <td><?php echo $rowid[0];?></td>
   <td><?php echo $rowid[1];?></td>
   <td><?php echo $rowid[2];?></td>
   <?php
   if ($rowid[adusrstat] == 0): ?>
      <td><center><a class="btn btn-primary btn-sm" href="vt513.php?id=<?php echo $rowid[0];?>">Modificar</a></center></td>
      <td><center><a class="btn btn-danger btn-sm" href="vt514.php?id=<?php echo $rowid[0];?>">Dar de Baja</a>
      </center></td><?php
   else: ?>
      <td><center><a href="?id=<?php echo $rowid[0];?>"></a></center></td>
      <td><center><a class="btn btn-success btn-sm" href="vt515.php?id=<?php echo $rowid[0];?>">Dar de Alta</a>
      </center></font></td><?php
   endif; ?>
   </tr>
   <?php
endwhile; ?>
</table></center>
</div>
</body>
