<?php
 
session_start();
$com = "M";
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=FRG50000_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	
	include('FRG50000_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['ffecllegada']=chfecha($reg['ffecllegada'],'Y-m-d','d/m/Y');
	$_REQUEST['ffecsalida']=chfecha($reg['ffecsalida'],'Y-m-d','d/m/Y');
	$_REQUEST['fnumadu']=$reg['fnumadu'];
	$_REQUEST['fnum']=$reg['fnum'];
	$_REQUEST['fnummenor']=$reg['fnummenor'];
	$_REQUEST['fhorallega']=$reg['fhorallega'];
	$_REQUEST['fnumctos']=$reg['fnumctos'];
	$_REQUEST['ffecalt']=chfecha($reg['ffecalt'],'Y-m-d','d/m/Y');
	$_REQUEST['ftipocto']=$reg['ftipocto'];
	$_REQUEST['fnum']=$reg['fnum'];
	//forma de pago
	$_REQUEST['fformpago']=$reg['fformpago'];
	$_REQUEST['fnumtar']=$reg['fnumtar'];
	$_REQUEST['fsaldo']=$reg['fsaldo'];
	$_REQUEST['flimite']=$reg['flimite'];
	$_REQUEST['fcodseg']=$reg['fcodseg'];
	//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'];
	//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'];
	$_REQUEST['tipo']=$reg['tipo'];
	}
?>

<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="1059"  align="center">
        <tr>
          <th colspan="15" class=\"titulo\"><div align="center"> MODIFICAR REGISTRO DE RESERVACIONES DE GRUPO </div></th>
        </tr>
    <tr>
      <td width="94">ALTA:</td>
      <td width="47"><input name="ffecalt" type="text"  class="styTabEspA" id="ffecalt" onKeyPress="return validar(event)" size="7" disabled="disabled" value="<?php
echo $_REQUEST['ffecalt'];?>"></td>
      <td width="139"><input name="fusualta" type="text" id="fusualta" disabled="disabled" size="20" value=" <?php
 
		echo  $_SESSION['usuario']  ;?>"></td>
      <td colspan="2">CAMBIO:</td>
      <td colspan="3"><input name="ffeccam" type="text" class="styTabEspA" id="ffeccam"  value="<?php
echo date('d/m/Y') ?>"size="7" ></td>
      <td width="48">&nbsp;</td>
      <td width="3">&nbsp;</td>
      <td>&nbsp;</td>
      <td width="43"><div align="right">STATUS:</div></td>
      <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="2">FECHA DE LLEGADA:      </td>
      <td><label>
      <script type="text/javascript">
	Calendar.setup(
			{
			  inputField  : "ffecllegada",        // ID of the input field
			  ifFormat    : "%d/%m/%Y",    // the date format
			  button      : "bot_a"      // ID of the button
			}
		  );
        </script>
      </label></td>
      <td colspan="2">DIAS:</td>
      <td>&nbsp;</td>
      <td colspan="2"><label></label>        
        <label></label>
      TIPO DE HABITACION: </td>
      <td colspan="4"><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="2"><div align="center" class="Estilo18">NOTAS:</div></td>
    </tr>
    <tr>
      <td colspan="2">FECHA DE SALIDA: </td>
      <td><script type="text/javascript">
		  Calendar.setup(
			{
			  inputField  : "ffecsalida",        // ID of the input field
			  ifFormat    : "%d/%m/%Y",    // the date format
			  button      : "bot_b"      // ID of the button
			}
		  );
        </script></td>
      <td colspan="2">NUMERO DE ADULTOS: </td>
      <td>&nbsp;</td>
      <td colspan="2">CANTIDAD DE HABITACION: </td>
      <td colspan="4"><input name="fnumcto" type="text" id="fnumcto" tabindex="20" size="10"  value="<?php
echo $_REQUEST['fnumcto'];?>"></td>
      <td colspan="2" rowspan="2"><div align="center"></div></td>
    </tr>
    <tr>
      <td colspan="2">HORA DE LLEGADA: </td>
      <td>&nbsp;</td>
      <td colspan="2">NUMERO DE MENORES: </td>
      <td>&nbsp;</td>
      <td colspan="2">NUMERO DE HABITACION: </td>
      <td colspan="4"><label>
        <input name="fnum" type="text" id="fnum" tabindex="20" onKeyPress="return validar(event)" size="5"  value="<?php
echo $_REQUEST['fnum'];?>">
      </label></td>
    </tr>
	
	
	
	<tr>
      <th colspan="15" class="titulo"><div align="center" class="Estilo18">MODIFICAR DATOS </div></th>
    </tr>
    <tr>
      <td><span class="Estilo18">GRUPO:</span></td>
      <td colspan="4">&nbsp;</td>
      <td width="97"><span class="Estilo18">MERCADO:</span></td>
      <td colspan="6">&nbsp;</td>
      <td width="57">EMPRESA:</td>
      <td width="202" colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td><span class="Estilo18">AGENCIA:</span></td>
      <td colspan="4">&nbsp;</td>
      <td><span class="Estilo18">PLAN:</span></td>
      <td colspan="6">&nbsp;</td>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr>
      <td>TARIFA:</td>
      <td colspan="4"><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="6">&nbsp;</td>
      <td colspan="3">&nbsp;</td>
    </tr>
	
	
	<tr>
      <th colspan="15" class="titulo"><div align="center" class="Estilo18">MODIFICAR FORMA DE PAGO </div></th>
    </tr>
    <tr>
      <td>FORMA DE PAGO </td>
      <td colspan="4">&nbsp;</td>
      <td>SALDO:</td>
      <td colspan="4">&nbsp;</td>
      <td width="41">LIMITE:</td>
      <td colspan="3">&nbsp; </td>
    </tr>
    <tr>
      <td>NUMERO DE TARJETA </td>
      <td colspan="3">&nbsp;</td>
      <td>CODIGO DE SEGURIDAD: </td>
      <td>&nbsp;</td>
      <td width="89"><input type="submit" name="Submit4" value="DEPOSITOS"></td>
      <td colspan="4"><div align="center"></div>        <div align="center"></div></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
	
	<tr>
      <th colspan="15" class="titulo"><div align="center" class="Estilo18">MODIFICAR DIRECCION</div></th>
    </tr>
    <tr>
      <td>NOMBRE:</td>
      <td colspan="3">&nbsp;</td>
      <td width="102">APELLIDO:</td>
      <td colspan="3">&nbsp;</td>
      <td colspan="6"><div align="center" class="Estilo18">VIP
        <input name="fvip" type="checkbox" id="fvip" value="SI" <?php
if($_REQUEST['fvip']=='SI') echo 'checked';?>>
      </div></td>
    </tr>
    <tr>
      <td>TELEFONO:</td>
      <td colspan="3">&nbsp;</td>
      <td>E-MAIL:</td>
      <td colspan="3">&nbsp;</td>
      <td colspan="3">TELEFONO EMPRESA: </td>
      <td colspan="4"><label></label></td>
    </tr>
    <tr>
      <td>E-MAIL EMPRESA: </td>
      <td colspan="3">&nbsp;</td>
      <td>DIRECCION:</td>
	  <td colspan="3">&nbsp;</td>
	  <td colspan="3"><span class="Estilo18">COLONIA:</span></td>
      <td colspan="3"><span class="Estilo18">
        <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="20">
        <input name="?" type="button" value="..." onClick="window.open('DX40000_AG1.php?retPag=FRG50000_MO.php','popuppage','width=750,height=300,top=100,left=50,scrollbars=yes,menubar=yes,status=yes')" >
      </span></td>
    </tr>
    <tr>
      <td>CODIGO POSTAL: </td>
      <td colspan="3"><input name="tcp" type="text" onKeyPress="return validar(event)" value="<?php
echo $_REQUEST['tcp'];?>" size="25" maxlength="5"></td>
      <td>PAIS:</td>
      <td colspan="3"><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"><span class="Estilo18">ESTADO:</span></td>
      <td colspan="3"><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">DELEGACION O MUNICIPIO:</td>
      <td colspan="3"><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><span class="Estilo18">
        <input name="tipo" type="checkbox" id="tipo" value="1" <?php
if($_REQUEST['tipo']=='1') echo 'checked';?>>
      </span></td>
      <td colspan="3"><label></label></td>
      <td colspan="3">&nbsp;</td>
      <td colspan="3"><label></label></td>
    </tr>
	
	
	
	
	<tr>
      <td colspan="15"><div align="center">
          <input name="Submit2" type="button" onClick="openpage('FRG50000_MC.php','_self')" value="Modificar"/>
          &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="Submit" value="Regresar" onClick="openpage('FRG50000_PR.php','_self')"/>
           
          <label></label>
      </div></td>
    </tr>
  </table>
</form>
  <?php
 
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="FRG50000_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	
}
?>
</body>
<?php
 
mysqli_close($con);
}
?>
</html>