<?php
 
session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
require_once("DFJQUERY.inc");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<?php

if ($_REQUEST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=valeryus70000_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('valeryus70000_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
		$_REQUEST['tap2']=$reg['pdescrip'];
		$_REQUEST['n_reg']=$reg['n_reg'];
		$_REQUEST['apellido']=$reg['apellido'];
		$_REQUEST['calle']=$reg['calle'];
		$_REQUEST['tcp']=$reg['codigo'];
		$_REQUEST['tcol']=$reg['colonia'];
		$_REQUEST['pais']=$reg['pais'];
		$_REQUEST['estados']=$reg['estados'];
		$_REQUEST['tmun']=$reg['municipio'];
		$_REQUEST['tel_eme']=$reg['tel_eme'];
		$_REQUEST['tel_casa']=$reg['tel_casa'];
		$_REQUEST['celular']=$reg['celular'];
		$_REQUEST['tel_1']=$reg['tel_1'];
		$_REQUEST['tel_2']=$reg['tel_2'];
		$_REQUEST['correo']=$reg['correo'];
		$_REQUEST['notas']=$reg['notas'];
		}
?>

<script language="javascript">
function ocultaMuestra(divVent){
	if(divVent.style.display=='none'){
		divVent.style.display='';

	}else{
		divVent.style.display='none';

	}
}	
	</script>
<body>

<form name="frm1" method="post" action="" enctype="multipart/form-data">
  <p>
    <input name="bot" type="hidden" value="<?php
 echo $_REQUEST['bot'];?>"> 
  </p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table width="668" border="0" align="center">
    <tr>
      <th colspan="4"><span class="Estilo21">MODIFICAR CONTACTO.</span> </th>
    </tr>
    <tr>
      <td width="100"  ><span class="Estilo21"><strong>CODIGO</strong></span></td>
      <td width="552" colspan="3" style="#66CCFF"><span class="Estilo19">
        <input name="n_reg" type="text" id="n_reg" tabindex="20" size="15" value="<?php
echo $_REQUEST['n_reg'];?>">
        <input name="bot1" type="button" class="form" onClick="openpage('valeryus70000_MC.php','_self')" value="Modificar"/>
        <input name="bot4" type="button" class="form" onClick="openpage('valeryus70000_PR.php','_self')" value="Regresar"/>
      </span></td>
    </tr>
  </table>
  <div id="divVent" style="display:">
    <table width="668" border="0" align="center"  >
      <tr>
        <td width="100"  ><span class="Estilo20">TIPO</span></td>
        <td colspan="3" style="#66CCFF"><label></label></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">NOMBRE</span></td>
        <td width="220" style="#66CCFF"><input name="tap2" id="tap2" type="text" tabindex="2" value="<?php
echo $_REQUEST['tap2'];?>"
		  onBlur="may(this)" size="35"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['pdescrip'].'"';
		}
		?>></td>
        <td width="100"  ><span class="Estilo20">APELLIDO</span></td>
        <td width="220" style="#66CCFF"><input name="apellido" type="text" id="apellido" size="35" value="<?php
echo $_REQUEST['apellido'];?>"/></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">CALLE Y NUMERO </span></td>
        <td style="#66CCFF"><input name="calle" type="text" id="calle" size="25" value="<?php
echo $_REQUEST['calle'];?>"/></td>
        <td  ><span class="Estilo20">CODIGO POSTAL </span></td>
        <td style="#66CCFF"><input name="tcp" type="text" onKeyPress="return validar(event)" value="<?php
echo $_REQUEST['tcp'];?>" size="10" maxlength="5" tabindex="27">
          <span class="Estilo1">
          <input name="?3" type="button" class="form" onClick="window.open('DX40000_AG1.php?retPag=valeryus70000_MO.php','popuppage','width=750,height=300,top=100,left=50,scrollbars=yes,menubar=yes,status=yes')" value="...." >
        </span></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">COLONIA</span></td>
        <td style="#66CCFF"><span class="Estilo1">
          <input type="hidden" name="tcol1" id="tcve" value="<?php
echo $_REQUEST['tcve'];?>">
          <input name="tcol" type="text" id="tcol" value="<?php
echo $_REQUEST['tcol'];?>" size="25" tabindex="26">
        </span></td>
        <td  ><span class="Estilo20">PAIS</span></td>
        <td style="#66CCFF"><span class="Estilo1">
          <select name="pais" id="pais" onChange="javascript: document.getElementById('frm1').submit()" tabindex="28">
            <option value="">-----SELECCIONE-----</option>
            <?php
   
		  include("DMMYSQLG.php");
			@$resultado=mysqli_query($con ,"select * from dxpaises");
			if(!isset($_REQUEST['pais'])){
				$dt_paises=mysqli_fetch_array($resultado);
				$selPais=$dt_paises['cve_pais'];
				if(mysqli_num_rows($resultado)>0)
					mysqli_data_seek($resultado,0);		
			}else{
				$selPais=$_REQUEST['pais'];
			}
			while($registro=mysqli_fetch_array($resultado)){
				if($selPais==$registro['cve_pais']){
					echo '<option value="' . $registro['cve_pais'] . '" selected>' . $registro['des_pais'] . '</option>';
				}else{
					echo '<option value="' . $registro['cve_pais'] . '">' . $registro['des_pais'] . '</option>';
				}
				}			
		?>
          </select>
        </span></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">ESTADO</span></td>
        <td style="#66CCFF"><span class="Estilo1">
          <select name="estados" onChange="javascript: document.getElementById('frm1').submit()" tabindex="29">
            <option  value="">-----SELECCIONE-----</option>
            <?php
  
		@$resultado=mysqli_query($con ,"select * from dxestado where cve_pais='$selPais'");
		if(!isset($_REQUEST['estados'])){
			$dt_estado=mysqli_fetch_array($resultado);
			$selEnt=$dt_estado['cve_estado'];
			if(mysqli_num_rows($resultado)>0)
				mysqli_data_seek($resultado,0);		
		}else{
			$selEnt=$_REQUEST['estados'];
		}
		while($registro=mysqli_fetch_array($resultado)){
			if($selEnt==$registro['cve_estado'] ){ 
				echo '<option value="' . $registro['cve_estado'] . '" selected>' . $registro['des_estado'] . '</option>';
			}else{
				echo '<option value="' . $registro['cve_estado'] . '">' . $registro['des_estado'] . '</option>';
			}
			}
?>
          </select>
        </span></td>
        <td  ><span class="Estilo20">DELEGACION O MUNICIPIO </span></td>
        <td style="#66CCFF"><span class="Estilo1">
          <select name="tmun" id="tmun" tabindex="30" >
            <option  value="">-----SELECCIONE-----</option>
            <?php
 
		@$resultado=mysqli_query($con ,"select * from dxdelmun where cve_estado='$selEnt' and cve_pais='$selPais'");
		if(!isset($_REQUEST['tmun'])){
			$dt_delmun=mysqli_fetch_array($resultado);
			$selDelMun=$dt_delmun['cve_delmun'];
			if(mysqli_num_rows($resultado)>0)
				mysqli_data_seek($resultado,0);		
		}else{
			$selDelMun=$_REQUEST['tmun'];
		}
		while(@$registro=mysqli_fetch_array($resultado)){
			if($selDelMun==$registro['cve_delmun']){ 
				echo '<option value="' . $registro['cve_delmun'] . '" selected>' .$registro['des_delmun'] . '</option>';
			}else{
				echo '<option value="' . $registro['cve_delmun'] . '">' . $registro['des_delmun'] . '</option>';
			}
		}
?>
          </select>
        </span></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">TELEFONO DE EMERGENCIAS </span></td>
        <td style="#66CCFF"><input name="tel_eme" type="text" id="tel_eme" size="25" value="<?php
echo $_REQUEST['tel_eme'];?>"/></td>
        <td  ><span class="Estilo20">TELEFONO CASA </span></td>
        <td style="#66CCFF"><input name="tel_casa" type="text" id="tel_casa" size="25" value="<?php
echo $_REQUEST['tel_casa'];?>"/></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">CELULAR</span></td>
        <td colspan="3" style="#66CCFF"><input name="celular" type="text" id="celular" size="25" value="<?php
echo $_REQUEST['celular'];?>"/></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">TELEFONO EXTRA 1 </span></td>
        <td style="#66CCFF"><input name="tel_1" type="text" id="tel_1" size="25" value="<?php
echo $_REQUEST['tel_1'];?>"/></td>
        <td  ><span class="Estilo21"><strong>TELEFONO EXTRA 2</strong> </span></td>
        <td style="#66CCFF"><input name="tel_2" type="text" id="tel_2" size="25" value="<?php
echo $_REQUEST['tel_2'];?>"/></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">CORREO ELECTRONICO</span></td>
        <td colspan="3" style="#66CCFF"><input name="correo" type="text" id="correo" size="40" value="<?php
echo $_REQUEST['correo'];?>"/></td>
      </tr>
      <tr>
        <td  ><span class="Estilo20">NOTAS</span></td>
        <td colspan="3" style="#66CCFF"><textarea name="notas" cols="30" rows="3" id="notas" tabindex="4"><?php
echo $_REQUEST['notas'];?>
		</textarea></td>
      </tr>
    </table>
  </div>
  <div id="divArt" style="display:none">
</form>
    <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center"
<?php
 mysqli_close($con);?>>
	<form id="form1" name="form1" action="valeryus70000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 <?php
 
}
?>
</body>
</html>
<?php
 mysqli_close($con);?>

</body>
</html>



