<?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>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="315"  align="center">
      <tr>
			<th colspan="2">TIPO ALIMENTO A PREPARAR</th>
      </tr>
      <tr>
        <td width="151" class="estilotabla"> <div align="center">
            <input name="r1" type="radio" tabindex="1" value="id" <?php
 if($_POST["id_empresa"]=="id_empresa") echo 'checked'?>>
            <span class="Estilo2">Clave</span></div></td>
        <td width="148" class="estilotabla"><div align="center">
            <input name="r1" type="radio" value="nombre" tabindex="2" <?php
 if($_POST["nom_emp"]=="nom_emp") echo 'checked'?>>
        <span class="Estilo2"> Descripci&oacute;n        </span></div></td>
      </tr>
      <tr>
        <td colspan="2"><input name="t1" type="text" id="t1" size="75"/></td>
      </tr>
       <tr>
        <td colspan="2"><div align="center">
          <input type="submit" name="Submit32" value="Buscar" openpage('RC50000_PR.php','_self')/>
        </div></td>
      </tr>
    </table>
  </form>
</div>
<div align="center">
  <form name="frm1" method="post" action="" >
    <p>    </p>
    <table  align="center">
      <tr>
        <th colspan="8" nowrap><div align="left">
          <input type="button" name="Submit6" value="Agregar" onClick="openpage('RC50000_AG.php','_self')"/>
          <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('RC50000_CO.php','_self')"/>
          <input type="button" name="bot2" value="Modificar" onClick="openpage('RC50000_MO.php','_self')"/>
          <input type="button" name="bot1" value="Eliminar" onClick="openpage('RC50000_EL.php','_self')"/>
          <input type="button" name="bot4" value="Imprimir " onClick="openpage('RC50000_IM.php','_self')"/>
        </div></th>
      </tr>
      <tr>
        <th nowrap><div align="center">Sel</div></th>
        <th nowrap>Cve</th>
        <th nowrap><div align="center">Descripci&oacute;n</div></th>
      </tr>
<?php


	if($_POST['r1']=="id"){
		$sq="SELECT * FROM rctipali WHERE cve_tipali like '$_POST['t1']%' order by cve_tipali";
	}elseif($_POST['r1']=="nombre"){
		$sq="SELECT * FROM rctipali WHERE des_tipali like '%".$_POST['t1']."%' order by des_tipali";
	}else{
		$sq="SELECT * FROM rctipali order by des_tipali";
	}
	echo '<input type="hidden" name="tbus" id_empresa="tbus" value="'.$sq.'">';
	@$sql = mysqli_query($con ,$sq);
	while($reg = mysqli_fetch_array($sql))
	{
	
	  	echo "<tr>";
		echo '<td><div align="center"><input name="bot" type="radio" value="'. $reg["id_tipali"].'">&nbsp</div></td>';
		echo '<td><div align="left">' . $reg["cve_tipali"] . '&nbsp</div></td>';
		echo '<td><div align="left">' . $reg["des_tipali"] . '&nbsp</div></td>';
		
		
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>