<?php
 
session_start();
include("DMMYSQLG.php");
$com = "M";
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>
<?php

if ($_POST['bot']==""){
	echo '<h2>!!! SELECCIONA UN REGISTRO... ACTUALIZANDO !!!</h2>';
	echo '<meta content="1; url=DX22000_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	include('DX21000_CL.php');
	$varible_clase = new clase_paises();
	$res=$varible_clase->lista_busqueda($_POST["bot"]);
	$reg=mysqli_fetch_array($res);
?>
<body
<?php
 
if(isset($_POST['bot3'])){
	echo ' onLoad="deshab()"';
}
?>
>
<form  name="frm1" method="post" action="">
<input name="t_num" type="hidden" value="<?php
 echo $_POST["bot"]?>">
  <table width="400"  align="center">
    <tr>
      <th colspan="2" class=\"titulo\"><div align="center">ESTADO</div></th>
    </tr>
    <tr>
      <td width="80">Pais: </td>
      <td width="304"><select name="paises1">
  <?php

$sql=mysqli_query($con ,"select * from dxestado where cve_estado='".$_POST['bot']."'");
$reg=mysqli_fetch_array($sql);
   
$sql1 = mysqli_query($con ,"SELECT * FROM dxpaises");
while($row=mysqli_fetch_array($sql1)){
	if($row['cve_pais'] == $reg['cve_pais']){
		echo '<option value="' . $row['cve_pais'] . '" selected>' . $row['des_pais'].'</option>';
	}else{
		echo '<option value="' . $row['cve_pais'] . '">' . $row['des_pais'].'</option>';
	}
}  
  
/*if(isset($_POST['bot'])){ 
	//conocer el numero de pais
	@$sql=mysqli_query($con ,"select * from dxestado where cve_estado='".$_POST['bot']."'");
	$reg=mysqli_fetch_array($sql);
	//buscar le pais
	@$sql=mysqli_query($con ,"select * from dxpaises where cve_pais='$reg['cve_pais'].'");
	$reg1=mysqli_fetch_array($sql);
	echo '<option value="'. $reg1['cve_pais'] .'">'.$reg1['des_pais'].'</option>';
}
@$sql=mysqli_query($con ,"select * from dxpaises");
while($reg1=mysqli_fetch_array($sql)){
	echo '<option value="' . $reg1['cve_pais'] . '">' . $reg1['des_pais'] . '</option>';
}	*/		
?>
      </select>      </td>
    </tr>
    <tr>
      <td> Clave de Estado: </td>
      <td><input name="testado" type="text" id="testado" tabindex="2" value="<?php
 echo $reg['cve_estado'] ?>" size="15"></td>
    </tr>
	<tr>
      <td> Estado: </td>
      <td><input name="testado" type="text" id="testado" tabindex="2" value="<?php
 echo $reg['des_estado'] ?>" size="45"></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">
          <input type="button" name="Submit2" value="Modificar" onClick="openpage('DX22000_MC.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('DX22000_PR.php','_self')"/>
      </div></td>
    </tr>
  </table>
</form>
<?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="DX22000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 </body>
<?php
 
mysqli_close($con);
}
?>
</html>