<?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');
//$coalm = $_SESSION["user_al"];
$bupro = trim($_POST["buspro"]);
$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>Catalogo de Productos</h1></center>
<center><a class="btn btn-success" href="vt225.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><center>Codigo</center></th>
	<th>Nombre Producto</th>
	<th><center>Imagen</center></th>
	<th><center>Existencia</center></th>
	<th><center>Precio Venta</center></th>
	<th><center>Ubicacion</center></th>
	<th><center>Seleccion</center></th>
	<th><center>Seleccion</center></th>
   </thead>
<?php
if (strlen($bupro) > 0):
   $mysql = "select * from inart
             where  inartdesc like '%$bupro%'
             order  by 2";
else:
   $mysql = "select * from inart
             order  by 2";
endif;
$result = mysql_query($mysql);
while ($row = mysql_fetch_array($result)): ?>
   <tr class="modo1">
   <td><center><?php echo $row[inartcart];?></center></td>
   <td><?php echo $row[inartdesc];?></td>
   <td><center><img src="<?php echo $row[inartimag]; ?>" alt="" width="35" height="40" /></center></td>
   <td><center><?php echo number_format($row[inartcant],2);?></center></td>
   <td><center><?php echo number_format($row[inartpven],2);?></center></td>
   <td><center><?php echo $row[inartubic];?></center></td>
   <?php
   if ($row[inartstat] == 0): ?>
      <td><center><a class="btn btn-primary btn-sm" href="vt222.php?id=<?php echo $row[inartcart];?>">Modificar</a></center></td>
      <td><center><a class="btn btn-danger btn-sm" href="vt223.php?id=<?php echo $row[inartcart];?>">Dar de Baja</a>
      </center></td><?php
   else: ?>
      <td><center><a href="?id=<?php echo $row[inartcart];?>"></a></center></td>
      <td><center><a class="btn btn-success btn-sm" href="vt224.php?id=<?php echo $row[inartcart];?>">Dar de Alta</a>
      </center></font></td><?php
   endif; ?>
   </tr>
   <?php
endwhile; ?>
</table></center>
</div>
</body>
