<?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=CXC10400_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	if(!isset($_REQUEST['tap2'])){
		include('CXC10400_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['stipodaily']=$reg['stipodaily'];
		$_REQUEST['direccion']=$reg['direccion'];
		$_REQUEST['numero']=$reg['numero'];
		$_REQUEST['tcp']=$reg['tcp'];
		$_REQUEST['tcol']=$reg['tcol'];
		$_REQUEST['pais']=$reg['pais'];
		$_REQUEST['estados']=$reg['estados'];
		$_REQUEST['tmun']=$reg['tmun'];
		$_REQUEST['rfc']=$reg['rfc'];
		$_REQUEST['cuenta']=$reg['cuenta'];
		$_REQUEST['observacion']=$reg['observacion'];
		}
?>

<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="648"  align="center">
    <tr>
      <th colspan="4">CONSULTAR PROVEEDOR. </th>
    </tr>
    <tr>
      <td width="90"><strong>CODIGO.</strong></td>
      <td width="542" colspan="3"><span class="Estilo19">
        <input name="n_reg" type="text" id="n_reg" tabindex="20" size="15" value="<?php
echo $_REQUEST['n_reg'];?>" disabled="disabled"
		<?php
 
		if(isset($_REQUEST['bot'])){
		echo 'value="'.$reg['n_reg'].'"';
		}
		?>
		>
      </span></td>
    </tr>
  </table>
  <div id="divVent" style="display:">
    <table width="648"  align="center"  >
      <tr>
        <td width="90"><strong>RAZON SOCIAL.</strong></td>
        <td colspan="3"><label>
        <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['pdescrip'].'"';
		}
		?>>
        </label></td>
      </tr>
      <tr>
        <td height="29"><strong>DIRECCION.</strong></td>
        <td width="220" height="29"><label>
          <input name="direccion" type="text" id="direccion" value="<?php
echo $_REQUEST['direccion'];?>" size="30" disabled="disabled">
        </label></td>
        <td width="90"><strong>NUMERO.</strong></td>
        <td width="220"><label>
          <input name="numero" type="text" id="numero" value="<?php
echo $_REQUEST['numero'];?>" size="5" disabled="disabled">
        </label></td>
      </tr>
      <tr>
        <td><strong>COLONIA.</strong></td>
        <td><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>
        <td><strong>CODIGO POSTAL. </strong></td>
        <td><input name="tcp" type="text" onKeyPress="return validar(event)" value="<?php
echo $_REQUEST['tcp'];?>" size="15" maxlength="5" disabled="disabled"></td>
      </tr>
      <tr>
        <td><strong>PAIS.</strong></td>
        <td><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 '<option value="' . $registro['cve_pais'] . '" selected>' . $registro['des_pais'] . '</option>';
				}else{
					echo '<option value="' . $registro['cve_pais'] . '">' . $registro['des_pais'] . '</option>';
				}
				
			}			
		?>
        </select></td>
        <td><strong>ESTADO.</strong></td>
        <td><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>
      </tr>
      <tr>
        <td><strong>DELEGACION O MUNICIPIO. </strong></td>
        <td colspan="2"><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>
        <td><div align="center"><strong>OBSERVACIONES.</strong></div></td>
      </tr>
      <tr>
        <td height="29"><strong>R.F.C.</strong></td>
        <td height="29" colspan="2"><label>
          <input name="rfc" type="text" id="rfc" value="<?php
echo $_REQUEST['rfc'];?>" size="35" disabled="disabled">
        </label></td>
        <td rowspan="2"><textarea name="observacion" cols="22" rows="3" id="observacion" tabindex="4" disabled="disabled"><?php
echo $_REQUEST['observacion'];?>
		</textarea></td>
      </tr>
      <tr>
        <td height="29"><strong>CUENTA CONTABLE. </strong></td>
        <td height="29" colspan="2"><label>
          <input name="cuenta" type="text" id="cuenta" value="<?php
echo $_REQUEST['cuenta'];?>" disabled="disabled">
        </label></td>
      </tr>
      <tr>
        <td height="29" colspan="4">
          <div align="center">
            <input type="button" name="bot4" value="Regresar" onClick="openpage('CXC10400_PR.php','_self')"/>
          </div></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="CXC10400_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 <?php
 
}
?>
</body>
</html>
<?php
 mysqli_close($con);?>

</body>
</html>



