<?php
 
session_start();
$com = "A";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DF30000.inc");
include("DF80000.php");
include("JQUERY.inc");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>

<script type="text/javascript" language="JavaScript1.2" src="RSSCRIPT.js"></script>


<script language="javascript">
function ajax(){
			new Ajax('script.php', {
							update: $('resultado'),
							postBody: $('frm1').toQueryString()
						}).request();
		}
</script> 
<script src="mootools.js" type="text/javascript"></script>







<body onLoad="restaFechas()" >
<div id="resultado" style="text-align:center;"></div>
<form  name="frm1" id="frm1" method="post" action=""   enctype="multipart/form-data" >
  <?php
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////checar habitaciones
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (isset($_POST['Submit2'])){
 include ("rec_miscelaneos_AC.php");
}
?>
 <table width="1031"  align="center" bordercolor=" " bordercolordark=" ">
    <tr>
      <th colspan="13" class=\"titulo\"><div align="center">AGREGAR MISCELANEOS</div></th>
    </tr>
    <tr>
      <td width="65"  ><span class="Estilo20"><strong>ALTA</strong></span></td>
      <td width="48" style="#A15E8D"><input name="ffecalt" type="text" class="styTabEspA" id="ffecalt" disabled="disabled" value="<?php
echo date('d/m/Y') ?>"size="7" ></td>
      <td colspan="3" style="#A15E8D"><input name="fusualta" type="text" id="fusualta" disabled="disabled" size="20" value=" <?php
 
		echo  $_SESSION['usuario']  ;?>"></td>
      <td colspan="3" style="#A15E8D"><div align="center"><span class="Estilo1">
        <input name="?323" type="button" class="original" tabindex="3" onClick="
	  	openWindow(
		{
			action:'rec_miscelaneos_VE.php',
			width:700,
			height:350
		},{
			val:'fnumcto',
			des:'ftipocto'
		})" value="Buscar Miscelaneos" >
      </span></div></td>
      <td colspan="2"  ><div align="center" class="Estilo20"><strong>NOTAS</strong></div></td>
    </tr>
    <tr>
      <td colspan="2"  ><span class="Estilo20">
        <label><strong>FECHA DE LLEGADA</strong> </label>
      </span></td>
      <td width="128" style="#A15E8D"><span class="Estilo32">
	  <input name="ffecllegada" type="text" class="emplea datefrom" id="ffecllegada" size="10"
	  <?php
 
				if(isset($_POST['ffecllegada']))
			  		echo 'value="'.$_POST['ffecllegada'].'"'; 
			  	else
			  		echo 'value="'.date('d/m/Y').'"'; 
			?>
	  ></span></td>
      <td  ><span class="Estilo20"><strong>DIAS</strong></span></td>
      <td width="52" style="#A15E8D"><input name="fnumctos" id="fnumctos" value="<?php
echo (daydiff ((isset($_POST['ffecsalida']))?$_POST['ffecsalida']:"",(isset($_POST['ffecllegada']))?$_POST['ffecllegada']:"",'d/m/Y'));?>" type="text" size="5" READONLY></td>
	  <td  ><span class="Estilo20">
	    <label><strong>TIPO DE HABITACION</strong>        </label>
	  </span></td>
      <td colspan="2" style="#A15E8D"><input name="ftipocto" type="text" id="ftipocto" onBlur="may(this)" size="25" READONLY
	  <?php

				if(isset($_POST['ftipocto'])){ //este es el truco
					echo 'value="' . $_POST['ftipocto'] .  '"';
				}
			?>></td>
      <td colspan="5" rowspan="2" style="#A15E8D"><div align="center"><span class="Estilo1">
        <textarea name="fnorasvip" cols="26" rows="3" id="fnorasvip" tabindex="4"
	  onBlur="may(this)"><?php

				if(isset($_POST['fnorasvip'])){ //este es el truco
					echo $_POST['fnorasvip'];
				}
			?>
	    </textarea>
      </span></div></td>
    </tr>
    <tr>
      <td colspan="2"  ><span class="Estilo20"><strong>FECHA DE SALIDA</strong></span></td>
      <td style="#A15E8D"><span class="Estilo32">
	  <input name="ffecsalida" type="text" class="emplea dateto" id="ffecsalida" size="10" onChange="restaFechas()"
	  <?php
 
				if(isset($_POST['ffecsalida']))
			  		echo 'value="'.$_POST['ffecsalida'].'"'; 
			  	else
			  		echo 'value="'.date('d/m/Y').'"'; 
			?>
	  >
       
      </span></td>
      <td  ><span class="Estilo20"><strong>HORA DE LLEGADA</strong></span></td>
      
				<?php
 
				if ('fnumctos'==-1){
				echo hola;
				}
				?>
                <td style="#A15E8D"><input name="fhorallega" type="text" class="tdan" id="fhorallega" value="<?php
echo date('H:i:s') ?>"size="9" ></td>
                <td width="129"  ><span class="Estilo1 Estilo20">NUMERO DE HABITACION</span></td>
      <td colspan="2" style="#A15E8D"><input name="fnumcto" type="text" id="fnumcto" READONLY
	  onBlur="may(this)" size="8"
	  		<?php

				if(isset($_POST['fnumcto'])){ //este es el truco
					echo 'value="' . $_POST['fnumcto'] .  '"';
				}
			?>/></td>
    </tr>
      
    <tr>
      <th colspan="13" class="titulo"><div align="center" class="Estilo18">AGREGAR SEGMENTOS </div></th>
    </tr>
    <tr>
      <td height="28"  ><span class="Estilo20"><strong>MERCADO</strong></span></td>
      <td colspan="3" style="#A15E8D"><span class="Estilo18">
        <select name="fcodmeca" id="fcodmeca" onmousemove="restaFechas()">
          <option value="">-----SELECCIONE-----</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM tipmerca order by tdescrip");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['fcodmeca']==$reg['tdescrip'] ){
		echo '<option style="background-color:'.$reg["color"].'" value="' . $reg['tdescrip'] . '" selected>' . $reg['tdescrip'] . '</option>';
	}else{
		echo '<option style="background-color:'.$reg["color"].'" value="' . $reg['tdescrip'] . '">' . $reg['tdescrip'] . '</option>';
	}
}
?>
        </select>
      </span></td>
      <td  ><span class="Estilo20"><strong>SEGMENTO</strong></span></td>
      <td colspan="3" style="#A15E8D"><select name="codseg" id="codseg">
        <option value="">--SELECCIONE--</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus06 order by descripcion");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['codseg']==$reg['descripcion'] ){
		echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
	}
}
?>
      </select></td>
      <td width="66"  ><span class="Estilo20"><strong>PLAN</strong></span></td>
      <td width="197" style="#A15E8D"><span class="Estilo1">
        <input name="fplan" id="fplan" value="EXTRAS" disabled="disabled"/>
      </span></td>
    </tr>
    <tr>
      <td height="26"  ><span class="Estilo1 Estilo20">AGENCIA</span></td>
      <td colspan="3" style="#A15E8D"><span class="Estilo1">
        <select name="fcodagen" id="fcodagen" onChange="javascript: document.getElementById('frm1').submit()" tabindex="8">
          <option value="">--SELECCIONE--</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus07");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['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="Estilo1 Estilo20">GRUPO</span></td>
      <td colspan="3" style="#A15E8D"><span class="Estilo1">
        <select name="fcodgrupo" id="fcodgrupo" onChange="javascript: document.getElementById('frm1').submit()" tabindex="5">
          <option value="">--------SELECCIONE--------</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus04");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['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="Estilo20"><strong>EMPRESA</strong></span></td>
      <td colspan="2" style="#A15E8D"><select name="fempresa" id="fempresa" onChange="javascript: document.getElementById('frm1').submit()" tabindex="7">
        <option value="">-----SELECCIONE-----</option>
        <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fcompas");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['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 height="26"  ><span class="Estilo20"><strong>SMERF</strong></span></td>
      <td height="26" colspan="10" style="#A15E8D"><label></label><label><span class="Estilo18">
        <select name="smerf" id="smerf" onChange="javascript: document.getElementById('frm1').submit()" tabindex="11">
          <option value="">--SELECCIONE--</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM fsmerf");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['smerf']==$reg['descripcion'] ){
		echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
	}
}
?>
        </select>
      </span></label></td>
    </tr>
	
	<tr>
      <th colspan="10" class="titulo"><div align="center" class="Estilo18">AGREGAR FORMA DE PAGO </div></th>
    </tr>
    <tr>
      <td  ><span class="Estilo1 Estilo20">FORMA DE PAGO</span></td>
      <td colspan="2" style="#A15E8D"><label></label>
        <label><span class="Estilo1">
        <select name="fformpago" id="fformpago" onChange="javascript: document.getElementById('frm1').submit()" tabindex="14">
          <option value="">---SELECCIONE---</option>
          <?php
 
$sql = mysqli_query($con ,"SELECT * FROM valeryus09 WHERE pmontomax = 'ABONO' AND ppago = 'SI'");
while($reg=mysqli_fetch_array($sql)){
	if($_POST['fformpago']==$reg['descripcion'] ){
		echo '<option value="' . $reg['descripcion'] . '" selected>' . $reg['descripcion'] . '</option>';
	}else{
		echo '<option value="' . $reg['descripcion'] . '">' . $reg['descripcion'] . '</option>';
	}
}
?>
        </select>
        </span></label></td>
      <td  ><span class="Estilo20"><strong>NUMERO TARJETA</strong></span></td>
      <td colspan="2" style="#A15E8D"><input name="fnumtar" type="text" id="fnumtar" tabindex="15"
	  onBlur="may(this)"
	  		<?php

				if(isset($_POST['fnumtar'])){ //este es el truco
					echo 'value="' . $_POST['fnumtar'] .  '"';
				}
			?>/></td>
      <td width="83"  ><span class="Estilo20"><strong>CODIGO DE SEGURIDAD</strong></span></td>
      <td style="#A15E8D"><input name="fcodseg" type="text" id="fcodseg" tabindex="17"
	  onBlur="may(this)" size="12"
	  		<?php

				if(isset($_POST['fcodseg'])){ //este es el truco
					echo 'value="' . $_POST['fcodseg'] .  '"';
				}
			?>/></td>
      <td  ><span class="Estilo20"><strong>LIMITE</strong></span></td>
      <td style="#A15E8D"><input name="flimite" type="text" id="flimite" tabindex="18"
	  onBlur="may(this)" size="15"
	  		<?php

				if(isset($_POST['flimite'])){ //este es el truco
					echo 'value="' . $_POST['flimite'] .  '"';
				}
			?>/></td>
    </tr>
    <tr>
      <th colspan="13" class="titulo"><div align="center" class="Estilo18">AGREGAR DATOS</div></th>
    </tr>
    <tr>
      <td height="29"  ><span class="Estilo20"><strong>NOMBRE</strong></span></td>
      <td colspan="2" style="#A15E8D">
			 <textarea name="fnombre" cols="25" rows="3" id="fnombre" tabindex="19"
	  onBlur="may(this)"><?php

				if(isset($_POST['fnombre'])){ //este es el truco
					echo $_POST['fnombre'];
				}
			?></textarea>			 </td>
      <td width="107"  ><span class="Estilo20"><strong>APELLIDO</strong></span></td>
      <td colspan="2" style="#A15E8D">
			<textarea name="fapellido" cols="22" rows="3" id="fapellido" tabindex="20"
	  onBlur="may(this)"><?php

				if(isset($_POST['fapellido'])){ //este es el truco
					echo $_POST['fapellido'];
				}
			?></textarea>			</td>
      <td  ><span class="Estilo20"><strong>TIPO DE HUESPED </strong></span></td>
      <td colspan="2" style="#A15E8D">
	  <input name="ftiphuesped" id="ftiphuesped" value="CORTESIA" disabled="disabled"/></td>
      <th><div align="center"><span class="Estilo1"><strong><span class="Estilo19">VIP</span></strong>
              <input name="fvip" type="checkbox" id="fvip" tabindex="24" value="SI"<?php
if(isset($_REQUEST['fvip']) && $_REQUEST['fvip']) echo 'checked';?>>
      </span> </div></th></tr>
    <tr>
      <td height="29"  ><span class="Estilo20"><strong>TELEFONO</strong></span></td>
      <td colspan="2" style="#A15E8D"><input name="ftelefono" type="text" id="ftelefono" tabindex="22"
	  onBlur="may(this)" size="30"
	  		<?php

				if(isset($_POST['ftelefono'])){ //este es el truco
					echo 'value="' . $_POST['ftelefono'] .  '"';
				}
			?>/></td>
      <td  ><span class="Estilo20"><strong>TELEFONO EMPRESA</strong></span></td>
      <td colspan="2" style="#A15E8D"><input name="ftelemp" type="text" id="ftelemp" tabindex="23"
	  onBlur="may(this)" size="25"
	  		<?php

				if(isset($_POST['ftelemp'])){ //este es el truco
					echo 'value="' . $_POST['ftelemp'] .  '"';
				}
			?>/></td>
      <td  ><span class="Estilo20"><strong>E-MAIL</strong></span></td>
      <td width="92"><input name="fmail" type="text" id="fmail" tabindex="25" size="15"
	  		<?php

				if(isset($_POST['fmail'])){ //este es el truco
					echo 'value="' . $_POST['fmail'] .  '"';
				}
			?>/></td>
      <td  ><span class="Estilo1 Estilo20">E-MAIL EMPRESA</span></td>
      <td><input name="femail" type="text" id="femail" tabindex="26" size="30"
	  		<?php

				if(isset($_POST['femail'])){ //este es el truco
					echo 'value="' . $_POST['femail'] .  '"';
				}
			?>/></td></tr>
    <tr>
      <td height="29"  ><span class="Estilo20"><strong>DIRECCION</strong></span></td>
      <td colspan="2" style="#A15E8D"><input name="fdireccion" type="text" id="fdireccion" tabindex="27"
	  onBlur="may(this)" size="20"
	  		<?php

				if(isset($_POST['fdireccion'])){ //este es el truco
					echo 'value="' . $_POST['fdireccion'] .  '"';
				}
			?>/></td>
      <td  ><span class="Estilo20"><strong>COLONIA</strong></span></td>
      <td colspan="2" style="#A15E8D"><span class="Estilo1">
        <input type="hidden" name="tcol1" id="tcve" value="<?php
echo $_REQUEST['tcve'];?>">
        <input name="tcol" type="text" id="tcol" value="CENTRO" size="20" disabled="disabled">
      </span></td>
      <td  ><span class="Estilo1 Estilo20">CODIGO POSTAL</span></td>
      <td colspan="3" style="#A15E8D"><input name="tcp" type="text" onKeyPress="return validar(event)" value="62000" size="15" maxlength="5" disabled="disabled">
        <span class="Estilo1">        </span></td></tr>
    <tr>
      <td height="29"  ><span class="Estilo20"><strong>PAIS</strong></span></td>
      <td colspan="2" style="#A15E8D"><span class="Estilo1">
        <input name="pais" id="pais" value="MEXICO" disabled="disabled"/>
      </span></td>
      <td  ><span class="Estilo20"><strong>ESTADO</strong></span></td>
      <td colspan="2" style="#A15E8D"><span class="Estilo1">
        <input name="estado" id="estado" value="MORELOS" disabled="disabled"/>
      </span></td>
      <td  ><span class="Estilo1 Estilo20">DELEGACION MUNICIPIO </span></td>
      <td colspan="3" style="#A15E8D"><span class="Estilo1">
        <input name="municipio" id="municipio" value="CUERNAVACA" disabled="disabled"/>
      </span></td>
    </tr>
    <tr>
      <th colspan="10"><div align="center">
        <input name="Submit2" type="submit" class="original" tabindex="31" onmousemove="restaFechas()"  value="Guardar"/>
        &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 name="Submit2" type="button" class="bot_WsW" tabindex="32" onClick="openpage('rec_miscelaneos_PR.php','_self')" value="Regresar"/>
      </div></th>
    </tr>
  </table>
</form>
</body>
</html>
