<?php
 
session_start();
include("DMMYSQLG.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 = 'DP18000A_PR.php';
include("DYAYUDA.php");
?>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="460"  align="center">
      <tr>
			<th colspan="2">COLORES</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="nombre" tabindex="2">
        Nombre</th>
      </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" />
        </div></td>
      </tr>
    </table>
  </form>
</div>
<div align="center">
  <form name="frm1" method="post" action="" >
    <p>
    <?php
 
	@$sql = mysqli_query($con ,"SELECT * FROM dpcatcol");
	?>
    </p>
    <table  align="center">
      <tr>
        <th colspan="7"><div align="left">
          <input type="button" name="Submit6" value="Agregar" onClick="openpage('dpcatcol_AG.php','_self')"/>
          <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('dpcatcol_CO.php','_self')"/>
          <input type="button" name="bot2" value="Modificar" onClick="openpage('dpcatcol_MO.php','_self')"/>
          <input type="button" name="bot1" value="Eliminar" onClick="openpage('dpcatcol_EL.php','_self')"/>
          <input type="button" name="bot4" value="Imprimir " onClick="openpage('dpcatcol_IM.php','_self')"/>
          <input type="button" name="Submit" value="Mostrar todo" onClick="openpage('dpcatcol_PR.php','_self')"/>
        </div></th>
      </tr>
      <tr>
        <th colspan="3">Concepto - Colores </th>
      </tr>
      <tr>
        <th width><div align="center">Sel</div></th>
        <th width><div align="center">Clave</div></th>
		<th width><div align="center">Nombre</div></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 dpcatcol WHERE cve = '".$_POST['t1']."'");
		
	}elseif($_POST['r1']=="nombre"){
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dpcatcol WHERE color 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["cve"].'">&nbsp</div></td>';
		echo '<td><div align="center">' . $reg["cve"] . '&nbsp</div></td>';
		echo '<td><div align="center">' . $reg["color"] . '&nbsp</div></td>';
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>