<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA2000.php");

include("DFJSISCI.inc");
?>
<html>
<head>

<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<?php

require_once("DFJQUERY.inc");
?>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>	
 
</head>
<body onLoad = "self.focus (); document.form1.tbus2.focus ()">

<div align="center">
  <form name="form1" method="post" action="">
    <p>&nbsp;</p>
    <table  align="center">
      
	  <tr>
        <th width="398" colspan="2"> CATALOGO DE PERMISOS </th>
      </tr>
      
      <tr>
        <th>BUSQUEDA</th>
      </tr>
    
      <tr>
        <td colspan="2"><div align="center">
          <input type="submit" name="Submit" value="Buscar" />
          <img src="magnifier.png" onClick="alert('Buscar')" />
          <input name="tbus" type="text" onBlur="may(this)" size="50"/>
        </div></td>
      </tr>
      <tr>
        <td colspan="2"><label>
        <input name="r1" type="radio" value="al" id="al" >
        </label>
        <span class="Estilo16">ALMACEN 
        <label>
        <input name="r1" type="radio" value="co" id="co" >
        </label>
        COSTOS        </span>
        <label>
        <input name="r1" type="radio" value="valeryus" id="valeryus" >
        </label>
        <span class="Estilo16">HOTEL</span>
        <label>
        <input name="r1" type="radio" value="pv" id="pv" >
        </label>
        <span class="Estilo16">PUNTO VENTA</span>
        <label>
        <input name="r1" type="radio" value="bq" id="bq" >
        </label>
        <span class="Estilo16">BOUTIQUE</span>
        <label>
        <input name="r1" type="radio" value="nm" id="nm" >
        </label>
        <span class="Estilo16">MINI BAR</span></td>
      </tr>
         
    </table>
  </form>
</div>
<div align="center">
<form name="frm1" id="frm1" method="post" action=""
<?php
 
	$sql = mysqli_query($con ,"SELECT * FROM dxaccgen ORDER BY n_reg");
	include("DE10000.php");
	?>
>
<table width="695" border='1'>
      <tr>
        <th colspan="13"> <div align="center">
          <input type="button" name="bot2" value="Agregar" onClick="openpage('UTI10000_AG.php','_self')"/>
		  <input type="button" name="bot2" value="Modificar" onClick="openpage('UTI10000_MO.php','_self')"/>
          <input type="button" name="bot1" value="Eliminar" onClick="openpage('UTI10000_EL.php','_self')"/>
        </div></th>
      </tr>
      <tr>
        <th width="23"  nowrap><div align="center">SEL</div></th>
        <th width="84"  nowrap><div align="center">N_REG</div></th>
		<th width="172"  nowrap><div align="center">MODULO</div></th>
		<th width="247"  nowrap><div align="center">DESCRIPCION</div></th>
		<th width="135"  nowrap><div align="center">TIPO</div></th>
      </tr>
	  <?php

	echo '<input name="txt_bus" type="hidden" value="'.$_POST['tbus'].'">';
	if($_POST['r1']=="")
	{
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxaccgen WHERE modulo like '%".$_POST['tbus']."%' order by n_reg");
	}elseif($_POST['r1']=="al"){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxaccgen WHERE modulo like '%AL%' order by n_reg"); 
	}elseif($_POST['r1']=="co"){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxaccgen WHERE modulo like '%CO%' order by n_reg"); 
	}elseif($_POST['r1']=="valeryus"){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxaccgen WHERE modulo like '%valeryus%' order by n_reg"); 
	}elseif($_POST['r1']=="pv"){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxaccgen WHERE modulo like '%PV%' order by n_reg"); 
	}elseif($_POST['r1']=="bq"){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxaccgen WHERE modulo like '%BQ%' order by n_reg"); 
	}elseif($_POST['r1']=="nm"){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxaccgen WHERE modulo like '%NM%' order by n_reg"); 
	}
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["n_reg"].'"></div></td>';
		echo "<td> <div align='center'><span class='Estilo16'>" . $reg["n_reg"] . "&nbsp;</span></div></td>";
		echo "<td> <div align='center'><span class='Estilo16'>" . $reg["modulo"] . "&nbsp;</span></div></td>";
		echo "<td> <div align='center'><span class='Estilo16'>" . $reg["descrip"] . "&nbsp;</span></div></td>";
		echo "<td> <div align='center'><span class='Estilo16'>" . $reg["tipo"] . "&nbsp;</span></div></td>";
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>