<?php
 
session_start();
include("DMMYSQLG.php");
$com = "A";
include("DSA3000.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 = 'DX2300A_AG.php';
include("DYAYUDA.php");
?>

<form name="frm1" method="post" action="">
  <table width="400"  align="center">
    <tr>
      <th colspan="2" class=\"titulo\"><div align="center">DELEGACION / MUNICIPIO </div></th>
    </tr>
    <tr>
      <td>Pais:</td>
      <td>
        <select id="paises1" name="paises1" onChange="javascript:recibeid('valeryus10300_AG1.php','num_pais='+this.value,'','estados1');">
		<option value=""></option>
		<?php
 
		if(isset($_POST['paises1'])){ //este es el truco
		@$resultado2=mysqli_query($con ,"select * from dxpaises where cve_pais=$_POST['paises1']");
			while($registro2=mysqli_fetch_array($resultado2)){
				echo '<option value="'. $registro2['cve_pais'] .'">'.$registro2['des_pais'].'</option>';
			}
		}
			$resultado=mysqli_query($con ,"select * from dxpaises") or die ("Consulta inválida");
			while($registro=mysqli_fetch_array($resultado)){
				echo '<option value="' . $registro['cve_pais'] . '">' . $registro['des_pais'] . '</option>';
			}			
		?>
        </select></td>
    </tr>
    <tr>
      <td>Estado:</td>
      <td><div id="estados1">
         
        <select name="select">
        </select>
        
      </div>
</td>
    </tr>
    <tr>
      <td width="80">Delegacion / Municipio: </td>
      <td width="304"><input name="tmun" type="text" id="tcta_pais" size="45"/></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">
          <input type="button" name="Submit2" value="Guardar" onClick="openpage('valeryus10300_AC.php','_self')"/>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="button" name="Submit2" value="Regresar" onClick="openpage('valeryus10300_PR.php','_self')"/>
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>
