<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
?>
<html>
<HEAD> <meta name="tipo_contenido" content="text/html;" http-equiv="content-type" charset="utf-8"></HEAD>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<body>
<?php
 
$ayuda = 'DX2100A_PR.php';
include("DYAYUDA.php");
?>
<div align="center">  
<form name="form1" method="post" action="" accept-charset="UTF-8">
  <table width="460"  align="center">
    <tr>
      <th colspan="2">PAISES</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="tbus" type="text"  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="" >
    <?php
 
	@$sql = mysqli_query($con ,"SELECT * FROM dxpaises order by cve_pais");
	include("DE10000.php");
	?>
    <table border='1'>
      <tr>
        <th colspan="3">
			<div align="left">
            <input type="button" name="Submit6" value="Agregar" onClick="openpage('cat_paises_AG.php','_self')"/>
            <input type="Submit" name="bot3" value="Consultar"  onClick="openpage('cat_paises_CO.php','_self')"/>
            <input type="button" name="bot2" value="Modificar" onClick="openpage('cat_paises_MO.php','_self')"/>
            <input type="button" name="bot1" value="Eliminar" onClick="openpage('cat_paises_EL.php','_self')"/>
            <input type="button" name="bot4" value="Imprimir " onClick="openpage('cat_paises_IM.php','_self')"/>
            <input type="button" name="Submit" value="Mostrar todo" onClick="openpage('cat_paises_PR.php','_self')"/>
        	</div>
		</th>
      </tr>
      <tr>
        <th colspan="3">Conceptos - Pa&iacute;ses </th>
      </tr>
      <tr>
	    <th><div align="center">Sel</div></th>
        <th><div align="center">Clave</div></th>
        <th><div align="center">Nombre</div></th>
      </tr>
<?php

	echo '<input name="txt_bus" type="hidden" value="'.$_POST['tbus'].'">';
	if($_POST['r1']=="clave")
	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM dxpaises WHERE cve_pais = '".$_POST['tbus']."'");
		
	}elseif($_POST['r1']=="nombre")
	{
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM dxpaises WHERE des_pais like '%".$_POST['tbus']."%'");
	}
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["cve_pais"].'"></div></td>';
		echo "<td> <div align='center'>" . $reg["cve_pais"] . "&nbsp</div></td>";
		echo "<td> <div align='left'>" . $reg["des_pais"] . "&nbsp</div></td>";
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
</div>
</body>
</html>
