<?php
 
session_start();
$com = "C";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
include("DF30000.inc");
include("DF80000.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>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=valeryus40000_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	
	include('valeryus40000_CL.php');
	$varible_clase = new clase();
	$res=$varible_clase->lista_busqueda($_POST["bot"]);
	$reg=mysqli_fetch_array($res);
	if(!isset($_POST['fcodtarifa'])){
	$_REQUEST['fcodtarifa']=$reg['fcodtarifa'];
	$_REQUEST['fnumres']=$reg['fnumres'];
	$_REQUEST['fnumcto']=$reg['fnumcto'];
	$_REQUEST['fnum']=$reg['fnum'];
	$_REQUEST['fnumctos']=$reg['fnumctos'];
	$_REQUEST['ffecllegada']=chfecha($reg['ffecllegada'],'Y-m-d','d/m/Y');
	//$_REQUEST['ffecllegada']=$reg['ffecllegada'];
	$_REQUEST['ffecsalida']=chfecha($reg['ffecsalida'],'Y-m-d','d/m/Y');
	//$_REQUEST['ffecsalida']=$reg['ffecsalida'];
	$_REQUEST['fnumadu']=$reg['fnumadu'];
	$_REQUEST['fnummenor']=$reg['fnummenor'];
	$_REQUEST['ffecalt']=chfecha($reg['ffecalt'],'Y-m-d','d/m/Y');
	$_REQUEST['ffeccam']=chfecha($reg['ffeccam'],'Y-m-d','d/m/Y');
	//$_REQUEST['ffecalt']=$reg['ffecalt'];
	$_REQUEST['select1']=$reg['status'];
	$_REQUEST['select2']=$reg['estact'];
	$_REQUEST['ftipocto']=$reg['ftipocto'];
	
	//datos
	$_REQUEST['fcodgrupo']=$reg['fcodgrupo'];
	$_REQUEST['fcodagen']=$reg['fcodagen'];
	$_REQUEST['fcodmeca']=$reg['fcodmeca'];
	$_REQUEST['fplan']=$reg['fplan'];
	$_REQUEST['smerf']=$reg['smerf'];
	$_REQUEST['fnorasvip']=$reg['fnorasvip'];
	$_REQUEST['fhorallega']=$reg['fhorallega'];
	$_REQUEST['codseg']=$reg['codseg'];
	//forma de pago
	$_REQUEST['fformpago']=$reg['fformpago'];
	$_REQUEST['fnumtar']=$reg['fnumtar'];
	$_REQUEST['fsaldo']=$reg['fsaldo'];
	$_REQUEST['flimite']=$reg['flimite'];
	$_REQUEST['fcodseg']=$reg['fcodseg'];
	//direccion
	$_REQUEST['fnombre']=$reg['fnombre'];
	$_REQUEST['fapellido']=$reg['fapellido'];
	$_REQUEST['flengua']=$reg['flengua'];
	$_REQUEST['fempresa']=$reg['fempresa'];
	$_REQUEST['ftelefono']=$reg['ftelefono'];
	$_REQUEST['fvip']=$reg['fvip'];
	$_REQUEST['femail']=$reg['femail'];
	$_REQUEST['fmail']=$reg['fmail'];
	$_REQUEST['fdireccion']=$reg['fdireccion'];
	$_REQUEST['tcol']=$reg['fgntd'];
	$_REQUEST['tcp']=$reg['fcp'];
	$_REQUEST['pais']=$reg['fpais'];
	$_REQUEST['estados']=$reg['festado'];
	$_REQUEST['tmun']=$reg['fciudad'];
	$_REQUEST['fvehiculo']=$reg['fvehiculo'];
	$_REQUEST['fplacas']=$reg['fplacas'];
	$_REQUEST['ftelemp']=$reg['ftelemp'];
	}
?>
<body
<?php
 
if(isset($_POST['bot3'])){
	echo ' onLoad="deshab()"';
}
?>
>
<form  name="frm1" method="post" action="">
<input name="bot" type="hidden" value="<?php
 echo $_POST["bot"]?>">
  <table width="943"  align="center">
        <tr>
          <th colspan="13" class=\"titulo\"><div align="center"> CONSULTAR REGISTRO DE RESERVACIONES DE GRUPO </div></th>
        </tr>
		
		<tr>
      <td>ALTA:        </td>
      <td width="44"><input name="ffecalt" type="text"  class="styTabEspA" id="ffecalt" onKeyPress="return validar(event)" size="7" disabled="disabled" value="<?php
echo $_REQUEST['ffecalt'];?>"></td>
      <td><input name="fusualta" type="text" id="fusualta" disabled="disabled" size="20" value=" <?php
 
		echo  $_SESSION['usuario']  ;?>"></td>
      <td>CAMBIO:</td>
      <td colspan="2"><label><input name="ffeccam" type="text"  class="styTabEspA" id="ffeccam" onKeyPress="return validar(event)" size="7" disabled="disabled" value="<?php
echo $_REQUEST['ffeccam'];?>"></label></td>
      <td width="76">&nbsp;</td>
      <td width="50">&nbsp;</td>
      <td colspan="2"><div align="right">STATUS:</div></td>
      <td colspan="2"><select name="select1">
        <option value="RESERVA GRUPO"<?php
if($_REQUEST['select1']=="RESERVA GRUPO") echo 'selected';?>>RESERVA GRUPO</option>
        </select></td>
		</tr>
    <tr>
      <td colspan="2"><label>FECHA DE LLEGADA:
          
      </label></td>
      <td width="137"><label>
        <input name="ffecllegada" type="text" id="ffecllegada" tabindex="20" onKeyPress="return validar(event)" size="15" disabled="disabled" value="<?php
echo $_REQUEST['ffecllegada'];?>">
      </label></td>
      <td width="89">DIAS:</td>
      <td width="138"><input name="fnumctos" type="text" id="fnumctos" tabindex="20" onKeyPress="return validar(event)" size="15" disabled="disabled" value="<?php
echo $_REQUEST['fnumctos'];?>"></td>
      <td width="54">
        TIPO DE HABITACION: </td>
      <td colspan="2"><select name="ftipocto" id="ftipocto" tabindex="11" onChange="javascript: document.getElementById('frm1').submit()">
         <option>--SELECCIONE--</option>
		  <?php
 
@$sql = mysqli_query($con ,"SELECT * FROM valeryus05");
while(@$reg=mysqli_fetch_array($sql)){
	if($_REQUEST['ftipocto']==$reg['descripcion'] ){
		echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
	}
}
?>
        </select></td>
      <td colspan="3"><div align="center" class="Estilo18">NOTAS:</div></td>
    </tr>
    <tr>
      <td colspan="2">FECHA DE SALIDA: </td>
      <td><input name="ffecsalida" type="text" id="ffecsalida" tabindex="20" onKeyPress="return validar(event)" size="15" disabled="disabled" value="<?php
echo $_REQUEST['ffecsalida'];?>"></td>
      <td>NUMERO DE ADULTOS: </td>
      <td><input name="fnumadu" type="text" id="fnumadu" tabindex="20" onKeyPress="return validar(event)" disabled="disabled" size="5"  value="<?php
echo $_REQUEST['fnumadu'];?>"></td>
      <td colspan="2">CANTIDAD DE HABITACIONES: </td>
      <td><input name="fnumcto" type="text" id="fnumcto" tabindex="20" size="5" disabled="disabled" value="<?php
echo $_REQUEST['fnumcto'];?>"></td>      
      <td colspan="4" rowspan="2"><div align="center">
        <textarea name="fnorasvip" cols="30" rows="2" id="fnorasvip" tabindex="4"><?php
echo $_REQUEST['fnorasvip'];?>
		</textarea>
      </div></td>
    </tr>
    <tr>
      <td colspan="2">HORA DE LLEGADA: </td>
      <td><input name="fhorallega" type="text" id="fhorallega" tabindex="20" onKeyPress="return validar(event)" disabled="disabled" size="6"  value="<?php
echo $_REQUEST['fhorallega'];?>"></td>
      <td>NUMERO DE MENORES: </td>
      <td><input name="fnummenor" type="text" id="fnummenor" tabindex="20" onKeyPress="return validar(event)" disabled="disabled" size="5"  value="<?php
echo $_REQUEST['fnummenor'];?>"></td>
      <td># DE HABITACIONES: </td>
      <td colspan="2"><label>
        <input name="fnum" type="text" id="fnum" tabindex="20" onKeyPress="return validar(event)" disabled="disabled" size="5"  value="<?php
echo $_REQUEST['fnum'];?>">
      </label></td>
    </tr>
	
	
	<tr>
      <th colspan="13" class="titulo"><div align="center" class="Estilo18">CONSULTAR SEGMENTOS </div></th>
    </tr>
    <tr>
      <td width="70"><span class="Estilo18">GRUPO:</span></td>
      <td colspan="3"><span class="Estilo18">
        <select name="fcodgrupo" id="fcodgrupo">
        <option value="">----------SELECCIONE----------</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus04");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['fcodgrupo']==$reg['gdescrip'] ){
		echo '<option value="' . $reg['gdescrip'] . '" selected>' . $reg['gdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['gdescrip'] . '">' . $reg['gdescrip'] . '</option>';
	}
}
?>
      </select>
		
        
      </span></td>
      <td><span class="Estilo18">MERCADO: </span></td>
      <td colspan="4"><span class="Estilo18">
        <select name="fcodmeca" id="fcodmeca">
        <option value="">-----SELECCIONE-----</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM tipmerca");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['fcodmeca']==$reg['tdescrip'] ){
		echo '<option value="' . $reg['tdescrip'] . '" selected>' . $reg['tdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['tdescrip'] . '">' . $reg['tdescrip'] . '</option>';
	}
}
?>
      </select>
      </span></td>
      <td>EMPRESA:</td>
      <td><select name="fempresa" id="fempresa">
        <option value="">-----SELECCIONE-----</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fcompas");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['fempresa']==$reg['pdesco'] ){
		echo '<option value="' . $reg['pdesco'] . '" selected>' . $reg['pdesco'] . '</option>';
	}else{
		echo '<option value="' . $reg['pdesco'] . '">' . $reg['pdesco'] . '</option>';
	}
}
?>
      </select></td>
    </tr>
    <tr>
      <td><span class="Estilo18">AGENCIA</span></td>
      <td colspan="3"><span class="Estilo18">
        <select name="fcodagen" id="fcodagen">
        <option value="">--SELECCIONE--</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus07");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['fcodagen']==$reg['agdescrip'] ){
		echo '<option value="' . $reg['agdescrip'] . '" selected>' . $reg['agdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['agdescrip'] . '">' . $reg['agdescrip'] . '</option>';
	}
}
?>
      </select>
      </span></td>
      <td><span class="Estilo18">PLAN:</span></td>
      <td colspan="4"><span class="Estilo18">
        <select name="fplan" id="fplan">
        <option value="">--SELECCIONE--</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM pplan");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['fplan']==$reg['pdescrip'] ){
		echo '<option value="' . $reg['pdescrip'] . '" selected>' . $reg['pdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['pdescrip'] . '">' . $reg['pdescrip'] . '</option>';
	}
}
?>
      </select>
      </span></td>
      <td>SEGMENTO:</td>
      <td><select name="codseg" id="codseg">
          <option value="">--SELECCIONE--</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus06");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['codseg']==$reg['descripcion'] ){
		echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
	}
}
?>
      </select></td>
    </tr>
    <tr>
      <td><span class="Estilo18">TARIFA:</span></td>
      <td colspan="3"><select name="fcodtarifa" id="fcodtarifa">
          <option value="">---Selecciona---</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM ftarifas");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['fcodtarifa']==$reg['gclave'] ){
		echo '<option value="' . $reg['gclave'] . '" selected>' . $reg['gdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['gclave'] . '">' . $reg['gdescrip'] . '</option>';
	}
}
?>
            </select></td>
      <td><span class="Estilo18">SMERF:</span></td>
      <td colspan="4"><span class="Estilo18">
        <select name="smerf" id="smerf">
        <option value="">--SELECCIONE--</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fsmerf");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['smerf']==$reg['descripcion'] ){
		echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
	}
}
?>
      </select>
      </span></td>
      <td colspan="2">&nbsp;</td>
    </tr>

<tr>
      <th colspan="13" class="titulo"><div align="center" class="Estilo18">CONSULTAR FORMA DE PAGO </div></th>
    </tr>
    <tr>
      <td>FORMA DE PAGO: </td>
      <td colspan="3"><span class="Estilo18">
        <select name="fformpago" id="fformpago">
		<option value="">----SELECCIONE----</option>
                <?php
 
$sql = mysqli_query($con ,"SELECT * FROM formapago");
while($reg=mysqli_fetch_array($sql)){
	if($_REQUEST['fformpago']==$reg['fdescrip'] ){
		echo '<option value="' . $reg['fdescrip'] . '" selected>' . $reg['fdescrip'] . '</option>';
	}else{
		echo '<option value="' . $reg['fdescrip'] . '">' . $reg['fdescrip'] . '</option>';
	}
}
?>
      </select>
      </span></td>
      <td>SALDO:</td>
      <td colspan="4"><input name="fsaldo" type="text" id="fsaldo" tabindex="20" size="15" disabled="disabled" value="<?php
echo $_REQUEST['fsaldo'];?>"></td>
      <td width="56">LIMITE:</td>
      <td width="162"><input name="flimite" type="text" id="flimite" tabindex="20" size="15" disabled="disabled" value="<?php
echo $_REQUEST['flimite'];?>"></td>
    </tr>
    <tr>
      <td>NUMERO DE TARJETA: </td>
      <td colspan="3"><input name="fnumtar" type="text" id="fnumtar" tabindex="20" size="15" disabled="disabled" value="<?php
echo $_REQUEST['fnumtar'];?>"></td>
      <td>CODIGO DE SEGURIDAD: </td>
      <td colspan="4"><input name="fcodseg" type="text" id="fcodseg" tabindex="20" size="15" disabled="disabled" value="<?php
echo $_REQUEST['fcodseg'];?>"></td>
      <td colspan="2"><div align="center">
        <input type="submit" name="Submit" value="Depositos">
      </div></td>
    </tr>
	
	<tr>
      <th colspan="13" class="titulo"><div align="center" class="Estilo18">CONSULTAR DATOS</div></th>
    </tr>
    <tr>
      <td>NOMBRE:</td>
      <td colspan="2">
        <input name="fnombre" type="text" id="fnombre" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['fnombre'];?>"></td>
      <td>APELLIDO:</td>
      <td colspan="2"><input name="fapellido" type="text" id="fapellido" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['fapellido'];?>"></td>
      <td colspan="6"><div align="center" class="Estilo18">VIP
        <input name="fvip" type="checkbox" id="fvip" disabled="disabled" value="SI" <?php
if($_REQUEST['fvip']=='SI') echo 'checked';?>>
      </div></td>
    </tr>
    <tr>
      <td><span class="Estilo18">TELEFONO:</span></td>
      <td colspan="2"><input name="ftelefono" type="text" id="ftelefono" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['ftelefono'];?>"></td>
      <td>E-MAIL:</td>
      <td colspan="2"><input name="fmail" type="text" id="fmail" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['fmail'];?>"></td>
      <td colspan="3">TELEFONO EMPRESA: </td>
      <td colspan="4">
        <input name="ftelemp" type="text" id="ftelemp" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['ftelemp'];?>">	  </td>
    </tr>
    <tr>
      <td><span class="Estilo18">E-MAIL EMPRESA: </span></td>
      <td colspan="2"><input name="femail" type="text" id="femail" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['femail'];?>"></td>
	  
	  <td>DIRECCION:</td>
	  <td colspan="2"><input name="fdireccion" type="text" id="fdireccion" tabindex="20" size="20" disabled="disabled" value="<?php
echo $_REQUEST['fdireccion'];?>"></td>
      <td colspan="3">COLONIA:</td>
      <td colspan="2"><span class="Estilo18">
        <input type="hidden" name="tcol1" id="tcve" value="<?php
echo $_REQUEST['tcve'];?>">
        <input type="text" name="tcol" id="tcol" disabled="disabled"value="<?php
echo $_REQUEST['tcol'];?>">
      </span></td>
    </tr>
    <tr>
      <td><span class="Estilo18">CODIGO POSTAL:</span></td>
      <td colspan="2"><input name="tcp" type="text" disabled="disabled" onKeyPress="return validar(event)" value="<?php
echo $_REQUEST['tcp'];?>" maxlength="5"></td>
      <td>PAIS: </td>
      <td colspan="2"><span class="Estilo18">
        <select name="pais" id="pais" onChange="javascript: document.getElementById('frm1').submit()">
          <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>
      </span></td>
      <td colspan="3">ESTADO:</td>
      <td colspan="2"><span class="Estilo18">
        <select name="estados" onChange="javascript: document.getElementById('frm1').submit()">
          <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>
      </span></td>
    </tr>
    <tr>
      <td height="29"><span class="Estilo18">DELEGACION O MUNICIPIO :</span></td>
      <td colspan="2"><span class="Estilo18">
        <select name="tmun" id="tmun" >
          <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>
      </span></td>
      <td>VEHICULO: </td>
      <td colspan="2"><input name="fvehiculo" type="text" id="fvehiculo" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['fvehiculo'];?>"></td>
      <td colspan="3">PLACAS:</td>
      <td colspan="4"><label>
        <input name="fplacas" type="text" id="fplacas" tabindex="20" size="25" disabled="disabled" value="<?php
echo $_REQUEST['fplacas'];?>">
      </label></td>
    </tr>
  </table>
</form>
  <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="valeryus40000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
 </body>
<?php
 
mysqli_close($con);
}
?>
</html>