<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<body>
<?php
 
$ayuda = 'DN1160A_PR.php';
include("DYAYUDA.php");
?>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="460"  align="center">
      <tr>
			<th colspan="2">CATALOGO DE MESAS </th>
      </tr>
      <tr>
        <th width="297"> <input name="r1" type="radio" tabindex="1" value="clave" checked>
        Clave</th>
        <th width="297"><input name="r1" type="radio" value="descripcion" tabindex="2">
        Nombre</th>
      </tr>
      <tr>
        <td colspan="2"><input name="t1" type="text" id="t1"  onBlur="may(this)" size="75"/></td>
      </tr>
      <tr>
        <td colspan="2"><div align="center">
          <input type="submit" name="Submit32" value="Buscar" />
        </div></td>
      </tr>
    </table>
  </form>
</div>
<div align="center">
  <form name="frm1" method="post" action="" >
    <p>
    <?php
 
	@$sql = mysqli_query($con ,"SELECT * FROM pvmesas");
	?>
    </p>
    <table width="527"  align="center">
      <tr>
        <th colspan="8"><div align="left">
          <input type="button" name="Submit6" value="Agregar" onClick="openpage('PV12000_AG.php','_self')"/>
          <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('PV12000_CO.php','_self')"/>
          <input type="button" name="bot2" value="Modificar" onClick="openpage('PV12000_MO.php','_self')"/>
          <input type="button" name="bot1" value="Eliminar" onClick="openpage('PV12000_EL.php','_self')"/>
          <input type="button" name="bot4" value="Imprimir " onClick="openpage('PV12000_IM.php','_self')"/>
          <input type="button" name="Submit" value="Mostrar todo" onClick="openpage('PV12000_PR.php','_self')"/>
        </div></th>
      </tr>
      <tr>
        <th colspan="6">Concepto - Mesas </th>
      </tr>
      <tr>
        <th width="73"><div align="center">Sel</div></th>
        <th width="62"><div align="center">Clave</div></th>
		<th width="262"><div align="center">Nombre</div></th>
        <th width="116">Area</th>
      </tr>
	<?php

	echo '<input name="txt_t1" type="hidden" value="'.$_POST['t1'].'">';
	if($_POST['r1']=="clave")	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM pvmesas WHERE cve_mesa = '".$_POST['t1']."'");
		
	}elseif($_POST['r1']=="descripcion"){
		echo '<input name="tip_bus" type="hidden" value="descripcion">';
		@$sql = mysqli_query($con ,"SELECT * FROM pvmesas WHERE des_mesa like '%".$_POST['t1']."%'");
	}
	include("DE10000.php");
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td><div align="center"><input name="bot" type="radio" value="'. $reg["id_mesa"].'">&nbsp</div></td>';
		echo '<td><div align="center">' . $reg["cve_mesa"] . '&nbsp</div></td>';
		echo '<td><div align="left">' . $reg["des_mesa"] . '&nbsp</div></td>';
		echo '<td><div align="left">' . $reg["id_area"] .  '&nbsp</div></td>';
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>