<?php
 
session_start();
$com = "C";
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(!isset($_REQUEST['bot']))$_REQUEST['bot']="";
if ($_REQUEST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=cat_empresas_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('cat_empresas_CL.php');
		$varible_clase = new clase();
		$res=$varible_clase->lista_busqueda($_REQUEST["bot"]);
		$reg=mysqli_fetch_array($res);
		$_REQUEST['tap2']=$reg['pdesco'];
		$_REQUEST['agdescrip']=$reg['agdescrip'];
		$_REQUEST['n_reg']=$reg['n_reg'];
		$_REQUEST['arfc']=$reg['arfc'];
		$_REQUEST['adireccion']=$reg['adireccion'];
		if(!isset($_REQUEST['aciuda']))$_REQUEST['aciuda']="";
		if(!isset($reg['aciuda']))$reg['aciuda']="";
		$_REQUEST['aciuda']=$reg['aciuda'];
		$_REQUEST['amail']=$reg['amail'];
		$_REQUEST['pobser']=$reg['pobser'];
		$_REQUEST['tmun']=$reg['aciudad'];
		if(!isset($_REQUEST['anumext']))$_REQUEST['anumext']="";
		if(!isset($reg['anumext']))$reg['anumext']="";
		$_REQUEST['anumext']=$reg['anumext'];
		$_REQUEST['afax']=$reg['afax'];
		$_REQUEST['atelefono']=$reg['atelefono'];
		$_REQUEST['acontacto']=$reg['acontacto'];
		$_REQUEST['estados']=$reg['pestado'];
		$_REQUEST['pais']=$reg['ppais'];
		$_REQUEST['tcol']=$reg['acolonia'];
		$_REQUEST['tcp']=$reg['acp'];
		}
?>

 	 	
<body>
<div align="center">
<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>
  <table width="583" align="center">
    <tr> <th colspan="5">CONSULTAR COMPA&Ntilde;IA</th> </tr>
    <tr>
      <td width="85"  ><span class="Estilo21"><strong>CODIGO</strong></span></td>
      <td width="486" colspan="4" style="#A15E8D"><span class="Estilo19">
        <input name="tclave" type="text" id="tclave" tabindex="20" disabled="disabled" size="15" value="<?php
 echo $_REQUEST['n_reg'];?>">
      </span></td> </tr>
      <tr>  <td  ><span class="Estilo20">NOMBRE DE  COMPA&Ntilde;IA</span></td>
        <td colspan="4" style="#A15E8D"><input name="tap2" id="tap2" type="text" tabindex="2" value="<?php
 echo $_REQUEST['tap2'];?>" disabled="disabled"
		  onBlur="may(this)" size="50"
		 <?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['pdesco'].'"';
		}
		?>></td> </tr>
      <tr>
        <td  ><span class="Estilo20">DESCRIPCION</span></td>
        <td colspan="2" style="#A15E8D"><input name="agdescrip" type="text" id="agdescrip" value="<?php
 echo $_REQUEST['agdescrip'];?>" size="25" onBlur="may(this)" disabled="disabled"/></td>
        <td width="80"  ><span class="Estilo21"><strong>RFC</strong></span></td>
        <td style="#A15E8D"><input name="arfc" type="text" id="arfc" value="<?php
 echo $_REQUEST['arfc'];?>" size="30" onBlur="may(this)" disabled="disabled"/></td> </tr>
      <tr>
        <td  ><span class="Estilo20">DIRECCION</span></td>
        <td colspan="2" style="#A15E8D"><input id="adireccion" type="text" name="adireccion" size="25" value="<?php
 echo $_REQUEST['adireccion'];?>" onBlur="may(this)" disabled="disabled"/></td>
        <td  ><span class="Estilo21"><strong>COLONIA</strong></span></td>
        <td style="#A15E8D"><input type="hidden" name="tcol1" id="tcve" value="<?php
 echo $_REQUEST['tcve'];?>">
          <input name="tcol" type="text" id="tcol" size="30" value="<?php
 echo $_REQUEST['tcol'];?>" disabled="disabled"></td> </tr>
      <tr>
        <td  ><span class="Estilo20">CODIGO POSTAL </span></td>
        <td colspan="2" style="#A15E8D"><input name="tcp" type="text" onKeyPress="return validar(event)" value="<?php
 echo $_REQUEST['tcp'];?>" size="15" maxlength="5" disabled="disabled">
          <input name="?" type="button" disabled="disabled" class="original" onClick="window.open('DX40000_AG1.php?retPag=cat_empresas_MO.php','popuppage','width=750,height=300,top=100,left=50,scrollbars=yes,menubar=yes,status=yes')" value="..." ></td>
        <td  ><span class="Estilo21"><strong>PAIS</strong></span></td>
        <td style="#A15E8D"><select name="pais" id="pais" onChange="javascript: document.getElementById('frm1').submit()" disabled="disabled">
            <option value="">------Selecciona------</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 "<input name='atelefono' type='text' id='atelefono' value=".$registro['des_pais']." disabled='disabled'/>";
				
				}else{
					
					echo "<input name='atelefono' type='text' id='atelefono' value=".$registro['des_pais']." disabled='disabled'/>";
				
				}
				
			}			
		?>
        </select></td> </tr>
      <tr>
        <td  ><span class="Estilo20">ESTADO</span></td>
        <td colspan="2" style="#A15E8D"><select name="estados" onChange="javascript: document.getElementById('frm1').submit()" disabled="disabled">
          <option  value="">--Selecciona--</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></td>
        <td  ><span class="Estilo21"><strong>DELEGACION O MUNICIPIO</strong></span></td>
        <td style="#A15E8D"><select name="tmun" id="tmun" disabled="disabled">
            <option  value="">--Selecciona--</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></td> </tr>
      <tr> <td  ><span class="Estilo20">TELEFONO</span></td>
        <td colspan="2" style="#A15E8D"><input name="atelefono" type="text" id="atelefono" value="<?php
 echo $_REQUEST['atelefono'];?>" disabled="disabled"/></td>
        <td  >&nbsp;</td>
        <td  ><div align="center" class="Estilo21"><strong>OBSERVACIONES</strong></div></td> </tr>
      <tr>
        <td  ><span class="Estilo20">E-MAIL</span></td>
        <td colspan="3" style="#A15E8D"><input name="amail" type="text" id="amail" value="<?php
 echo $_REQUEST['amail'];?>" size="30" disabled="disabled"/></td>
        <td width="226" rowspan="7" style="#A15E8D"><textarea name="pobser" cols="25" rows="6" disabled="disabled" id="pobser"><?php
 echo $_REQUEST['pobser'];?> 
		</textarea></td> </tr>
      <tr>
        <td  ><span class="Estilo20">NOMBRE DEL CONTACTO</span></td>
        <td colspan="3" style="#A15E8D"><input name="acontacto" type="text" id="acontacto" value="<?php
 echo $_REQUEST['acontacto'];?>" size="30" onBlur="may(this)" disabled="disabled"/></td> </tr>
      <tr>
        <td  ><span class="Estilo21"><strong>FAX</strong></span></td>
        <td colspan="3" style="#A15E8D"><input name="afax" type="text" id="afax" value="<?php
 echo $_REQUEST['afax'];?>" size="30" disabled="disabled"/></td> </tr>
      <tr> <th height="29" colspan="4">
 <div align="center">  <input name="bot4" type="button" class="bot_WsW" onClick="openpage('cat_empresas_PR.php','_self')" value="Regresar"/>
          </div></th> </tr>
    </table>
</form>
</div>
 <?php
 
}
?>
</body>
</html>
<?php
 mysqli_close($con);//304-->199?>
</body>
</html>