<?php
 
session_start();
$com = "M";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DF30000.inc");
include("DF80000.php");
include ("varfun.php");
include ("JQUERY.inc");
$val1=0;
$val2=0;
$f_f="";
$Segundos=0;
$cuenta=0;
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="RSSCRIPT.js"></script>
<script language="javascript">
//function openWindow(dataGen,valores){
//	var objDate=document.getElementById('ffecllegada');
//	var objDate2=document.getElementById('ffecsalida');	
//	var getVars,getVarsAux,distPage;
//	var idVentana;
//	for(getVarsAux in valores){
//		getVars +='&'+getVarsAux+'='+valores['getVarsAux'];
//	}
//	if(typeof dataGen.width=='undefined') dataGen.width='800';
//	if(typeof dataGen.height=='undefined') dataGen.height='600';
//	distPage='&feclle='+objDate.value;
//	distPage2='?fecsal='+objDate2.value;
//	idVentana=window.open(dataGen.action+distPage2+distPage+'&'+getVars,dataGen.name,'width='+dataGen.width+',height='+dataGen.height+',top=100,left=50,scrollbars=yes,menubar=yes,status=yes');
//	return idVentana;
//}
function sumaTex(){
	var objTex1=document.getElementById('tex4'),
		objTex2=document.getElementById('tex5'),
		objTex9=document.getElementById('tex6');
	objTex9.value=(parseFloat(objTex1.value)*parseFloat(objTex2.value)).toFixed(2);
}
function sumTex(){
	var objTex1=document.getElementById('text4'),
		objTex2=document.getElementById('text5'),
		objTex9=document.getElementById('text6');
	objTex9.value=(parseFloat(objTex1.value)*parseFloat(objTex2.value)).toFixed(2);
}
function resTex(){
	var objTex1=document.getElementById('tex6'),
		objTex2=document.getElementById('text6'),
		objTex9=document.getElementById('ftotal');
	objTex9.value=(parseFloat(objTex1.value)+parseFloat(objTex2.value)).toFixed(2);
}
</script>
<?php

if ($_POST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=rec_miscelaneos_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	//$sql="UPDATE valeryus19 SET ffecllegada='', ffecsalida='' WHERE n_reg ='".$_POST['bot']."'";
	//if (!mysqli_query($con ,$sql)){
		//die('Error: ' . mysqli_error($con));
		//exit();
//	}
	include('rec_miscelaneos_CL.php');
	$varible_clase = new clase();
	$res=$varible_clase->lista_busqueda($_POST["bot"]);
	$reg=mysqli_fetch_array($res);
	if(!isset($_POST['fnombre'])){
	$_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['fhorallega']=$reg['fhorallega'];
	$_REQUEST['fnumctos']=$reg['fnumctos'];
	$_REQUEST['ffecalt']=chfecha($reg['ffecalt'],'Y-m-d','d/m/Y');
	$_REQUEST['ftipocto']=$reg['ftipocto'];
	$_REQUEST['select1']=$reg['status'];
	$_REQUEST['fusualta']=$reg['fusualta'];
	
	//forma de pago
	$_REQUEST['fformpago']=$reg['fformpago'];
	$_REQUEST['fnumtar']=$reg['fnumtar'];
	$_REQUEST['fsaldo']=$reg['fsaldo'];
	$_REQUEST['flimite']=$reg['flimite'];
	$_REQUEST['fcodseg']=$reg['fcodseg'];
	$_REQUEST['codseg']=$reg['codseg'];
	//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['ftelemp']=$reg['ftelemp'];
	$_REQUEST['ftiphuesped']=$reg['ftiphuesped'];
	$_REQUEST['status']=$reg['status'];
	}
?>

<body
<?php
 
if(isset($_POST['bot3'])){
	echo ' onLoad="deshab()"';
}
?>
 onLoad="restaFechas()">
<div id="width_wrapper" align="left">
<form  name="frm1" method="post" action="" enctype="multipart/form-data">
<input name="bot" type="hidden" value="<?php
 echo $_POST["bot"]?>">
<?php

$fechaInicial = date("Y-m-d");    
     $fecha = daydiff ((isset($_POST['ffecsalida']))?$_POST['ffecsalida']:"",(isset($_POST['ffecllegada']))?$_POST['ffecllegada']:"",'d/m/Y');   
         for ($i=0; $i<$fecha; $i++)   
    {   
        $Segundos = $Segundos + 86400;         
        $caduca = date("D",time()+$Segundos);     
            if ($caduca == "Sat")   
            {    
				$val1=$val1+1;  
            }   
            else if ($caduca == "Sun")   
            {   
				$val2=$val2+1;
            }   
            else  
            {   
                $FechaFinal = date("Y-m-d",time()+$Segundos);  
				$cuenta=$cuenta+1; 
            }   
    }  
	$sabd=$val1+$val2;
?>
<table width="1035" align="center" bordercolor=" " bordercolordark=" ">
  <tr><td colspan="13" class="titulo"><div align="center"> MODIFICAR REGISTRO DE MISCELANEOS</div></td></tr>
  <tr>
    <th width="66"  ><div align="left"><span class="Estilo20">ALTA</span></div></th>
    <td width="48" style="#A15E8D"><!--input name="ffecalt" type="text" id="ffecalt" size="7" disabled="disabled" value="<?php //echo $_REQUEST['ffecalt'];?>"-->
	  <input name="ffecalt" type="text" id="ffecalt"  class="styTabEspA" disabled="disabled" size="7"
	  <?php
 
		if(isset($_POST['bot'])){
		$fec1=$reg["ffecalt"];
		include('DF20000.php');
		echo 'value="'.$f_f.'"';
		}
		?>/></td>
    <td width="121" style="#A15E8D"><input name="fusualta" type="text" disabled="disabled" id="fusualta" size="10"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['fusualta'].'"';
		}
		?>></td>
    <th colspan="2"  ><div align="left"><span class="Estilo20">ULTIMO CAMBIO</span></div></th>
    <td style="#A15E8D"><input name="ffeccam" type="text" class="styTabEspA" id="ffeccam" size="1" disabled="disabled"
	<?php
 
		if(isset($_POST['bot'])){
		$fec1=$reg["ffeccam"];
		include('DF20000.php');
		echo 'value="'.$f_f.'"';
		}
		?>>      
	<input name="fusucamb" type="text" id="fusucamb" disabled="disabled" size="1"
	<?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['fusucamb'].'"';
		}
		?>></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>
    <th colspan="3"  ><div align="center" class="Estilo21 Estilo18"><strong>NOTAS</strong></div></th>
    </tr>
  <tr>
    <th colspan="2"  ><div align="left"><span class="Estilo20">FECHA DE LLEGADA</span></div></th>
    <td style="#A15E8D"><label>
	  <input name="ffecllegada" type="text" class="emplea datefrom" id="ffecllegada" size="10" onKeyPress="return validar(event)" value="<?php echo $_REQUEST['ffecllegada'];?>"></label></td>
    <th colspan="2"  ><div align="left"><span class="Estilo20">DIAS</span></div></th>
    <td style="#A15E8D"><input name="fnumctos" type="text" id="fnumctos" tabindex="20" onKeyPress="return validar(event)" size="5" value="<?php echo (daydiff ((isset($_POST['ffecsalida']))?$_POST['ffecsalida']:0,(isset($_POST['ffecllegada']))?$_POST['ffecllegada']:0,'d/m/Y'));?>" READONLY></td>
    <th  ><div align="left"><span class="Estilo20">TIPO DE HABITACION</span></div>      <label></label></th>
    <td colspan="2" style="#A15E8D"><input name="ftipocto" type="text" id="ftipocto" value="<?php echo $_REQUEST['ftipocto'];?>" READONLY></td>
    <td colspan="3"   rowspan="2"><div align="center">
      <textarea name="fnorasvip" cols="30" rows="3" id="fnorasvip" onBlur="may(this)" tabindex="4"><?php echo $_REQUEST['fnorasvip'];?></textarea>
    </div></td></tr>
  <tr>
    <th colspan="2"  ><div align="left"><span class="Estilo20">FECHA DE SALIDA</span></div></th>
    <td style="#A15E8D"><input name="ffecsalida" type="text" class="emplea dateto" id="ffecsalida" size="10" onKeyPress="return validar(event)" value="<?php echo $_REQUEST['ffecsalida'];?>" onChange="restaFechas()">
      
        </td>
    <th colspan="2" style="#A15E8D"><div align="left"><span class="Estilo20">FOLIO</span></div></th>
    <td style="#A15E8D"><input name="ffecalt2" type="text" id="ffecalt2"  class="styTabEspA" disabled="disabled" size="7"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['n_reg'].'"';
		}
		?>/></td>
    <th width="95"  ><div align="left"><span class="Estilo20">NUMERO DE HABITACION</span></div></th>
    <td colspan="2" style="#A15E8D"><input name="fnumcto" type="text" id="fnumcto" tabindex="20" size="5"  value="<?php echo $_REQUEST['fnumcto'];?>" READONLY></td>
    </tr>
  <tr><td colspan="13" class="titulo"><div align="center" class="Estilo18">DATOS</div></td></tr>
  <tr>
    <th  ><div align="left"><span class="Estilo20">MERCADO</span></div></th>
    <td colspan="4" style="#A15E8D"><span class="Estilo18">
      <input name="fcodmeca" id="fcodmeca" disabled="disabled"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['fcodmeca'].'"';
		}
		?>/></span></td>
    <th width="101"  ><div align="left"><span class="Estilo20">SEGMENTO</span></div></th>
    <td colspan="3" style="#A15E8D">
	<input name="codseg" id="codseg" disabled="disabled"
	<?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['codseg'].'"';
		}
		?>/></td>
    <th width="85"  ><div align="left"><span class="Estilo20">PLAN</span></div></th>
    <td colspan="3" style="#A15E8D"><span class="Estilo18">
      <input name="fplan" id="fplan" disabled="disabled"
	  <?php
 
		if(isset($_POST['bot'])){
		echo 'value="'.$reg['fplan'].'"';
		}
		?>/></span></td></tr>
  <tr>
    <th  ><div align="left"><span class="Estilo18 Estilo21"><strong>AGENCIA</strong></span></div></th>
    <td colspan="4" style="#A15E8D"><span class="Estilo18">
      <select name="fcodagen" id="fcodagen" tabindex="8">
        <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>
    <th  ><div align="left"><span class="Estilo20">GRUPO</span></div></th>
    <td colspan="3" style="#A15E8D"><span class="Estilo18">
      <select name="fcodgrupo" id="fcodgrupo" tabindex="5">
        <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  >&nbsp;</td>
    <td colspan="3" style="#A15E8D">&nbsp;</td></tr>
  <tr>
    <th  ><div align="left"><span class="Estilo18 Estilo21"><strong>SMERF</strong></span></div></th>
    <td colspan="4" style="#A15E8D"><span class="Estilo18">
      <select name="smerf" id="smerf" tabindex="11">
        <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>
    <th  ><div align="left"><span class="Estilo20">EMPRESA</span></div></th>
    <td colspan="7" style="#A15E8D"><select name="fempresa" id="fempresa" tabindex="7">
      <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>
    <th  ><div align="left"><span class="Estilo21"><strong>FORMA DE PAGO</strong></span></div></th>
    <td colspan="3" style="#A15E8D">
	  <label></label><label><span class="Estilo18">
	  <select name="fformpago" id="fformpago" onChange="javascript: document.getElementById('frm1').submit()" tabindex="12">
        <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($_REQUEST['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>
    <th  ><div align="left"><span class="Estilo18 Estilo21"> <strong>NUMERO TARJETA</strong></span></div></th>
    <td style="#A15E8D"><strong><input name="fnumtar" type="text" id="fnumtar" tabindex="13" size="5" value="<?php echo $_REQUEST['fnumtar'];?>"></strong></td>
    <th colspan="2"  ><div align="left"><span class="Estilo21"><strong>CODIGO DE SEGURIDAD</strong></span></div></th>
    <td width="59" style="#A15E8D"><input name="fcodseg" type="text" id="fcodseg" tabindex="15" size="5" value="<?php echo $_REQUEST['fcodseg'];?>"></td>
    <th  ><div align="left"><span class="Estilo21"><strong>LIMITE</strong></span></div></th>
    <td colspan="2" style="#A15E8D"><input name="flimite" type="text" id="flimite" tabindex="16" size="15" value="<?php echo $_REQUEST['flimite'];?>"></td></tr>
  <tr>
    <td colspan="13" class="titulo"><div align="center" class="Estilo18">DIRECCION</div></td></tr>
  <tr>
    <th  ><div align="left"><span class="Estilo20">NOMBRE</span></div></th>
    <td colspan="3" style="#A15E8D">
	<textarea name="fnombre" cols="25" rows="2" id="fnombre" onBlur="may(this)" tabindex="4"><?php echo $_REQUEST['fnombre'];?></textarea>
    <th width="94"  ><div align="left"><span class="Estilo21"><strong>APELLIDO</strong></span></div></th>
    <td colspan="2" style="#A15E8D">
	<textarea name="fapellido" cols="20" rows="2" id="fapellido" onBlur="may(this)"tabindex="4"><?php echo $_REQUEST['fapellido'];?></textarea>	</td>
    <th width="97"  ><div align="left"><strong>E-MAIL</strong></div></th>
	<td colspan="2" style="#A15E8D"><input name="fmail" type="text" id="fmail" tabindex="23" size="15" value="<?php echo $_REQUEST['fmail'];?>"></td>
	<th colspan="2"><div align="center"><strong><span class="Estilo19">VIP</span></strong><span class="Estilo18">
      <input name="fvip" type="checkbox" id="fvip" value="SI" <?php if($_REQUEST['fvip']=='SI') echo 'checked';?>></span></div></th></tr>
  <tr>
    <th  ><div align="left"><span class="Estilo20">TELEFONO</span></div></th>
    <td colspan="3" style="#A15E8D"><input name="ftelefono" type="text" id="ftelefono" tabindex="20" size="25" value="<?php echo $_REQUEST['ftelefono'];?>"></td>
    <th  ><div align="left"><span class="Estilo21"><strong>DIRECCION</strong></span></div></th>
    <td colspan="2" style="#A15E8D"><input name="fdireccion" type="text" id="fdireccion" tabindex="25" size="15" onBlur="may(this)" value="<?php echo $_REQUEST['fdireccion'];?>"></td>
    <th  ><span class="Estilo21"><label></label>
      <div align="left"><strong>COLONIA</strong></div>
      </span></th>
    <td colspan="2" style="#A15E8D"><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="15" disabled="disabled">
    </span></td>
    <th width="59" style="#A15E8D"><div align="left"><strong>CODIGO POSTAL</strong></div></th>
    <td width="137" style="#A15E8D"><input name="tcp" type="text" onKeyPress="return validar(event)" value="<?php echo $_REQUEST['tcp'];?>" size="15" maxlength="5" disabled="disabled"></td>
  </tr>
  <tr>
    <th  ><div align="left"><span class="Estilo20">PAIS</span></div></th>
    <td colspan="3" style="#A15E8D"><span class="Estilo18">
      <input name="pais" type="text" id="pais" tabindex="20" size="20" disabled="disabled" value="MEXICO">
    </span></td>
    <th  ><div align="left"><span class="Estilo21"><strong>ESTADO</strong></span></div></th>
    <td colspan="2" style="#A15E8D"><span class="Estilo18">
      <input name="estado" type="text" id="estado" tabindex="20" size="20" disabled="disabled" value="MORELOS">
    </span></td>
    <th  ><div align="left"><strong>DELEGACION O MUNICIPIO</strong></div></th>
 <td colspan="4" style="#A15E8D"><span class="Estilo18">
   <input name="municipio" type="text" id="municipio" tabindex="20" size="20" disabled="disabled" value="CUERNAVACA">
 </span></td>
 </tr>
  <tr>
    <th colspan="13"><div align="center">
      <input name="Submit2" type="submit" class="original" tabindex="29" 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 name="Submit" type="button" class="bot_WsW" tabindex="30" onClick="openpage('rec_miscelaneos_PR.php','_self')" value="Regresar"/>
    </div></th></tr>
</table>
</form>
  <?php
 
if (isset($_POST['Submit2'])){
	/////////////////////////////////////////////////////////////SENTENCIA DE REGISTRO///////////////////////////////////////
	if($_POST['fnumctos'] == "" || $_POST['fnumctos'] == 0){
		echo alert_JS ("ĦĦĦESTA SEGURO DE GUARDAR LOS CAMBIOS!!!");
		return false;
	}
	///////////////////////////////////////////////////////////////////SENTANCIA DE DATOS////////////////////////////////////
	if($_POST['fnombre'] == "" ){
		echo alert_JS ("ĦĦĦCOMPLETE EL NOMBRE!!!");
		return false;
	
	}if($_POST['fapellido'] == "" ){
		echo alert_JS ("ĦĦĦCOMPLETE EL APELLIDO!!!");
		return false;
	}
	include("DMMYSQLG.php");
    include("DMMYSQLG.php"); 
	if(isset($_POST['fnumcto'])){
		$usu=mysqli_real_escape_string($con,$_POST['fnumcto']);
  		$dt_user=mysqli_fetch_array(mysqli_query($con ,"SELECT   count(*) as numRows, ncto FROM valeryus08 WHERE ncto='$usu' "));
  echo mysqli_error($con);
  
  		if($dt_user['numRows']==0){
		  		echo alert_JS("ĦĦĦĦLA HABITACION SELECCIONADA NO EXISTE!!!!");
				return false;
	 }
	 }
	 $fec = $_POST['ffecllegada'];
		include('DF20000.php');
		$fecha_inicial = $f_m;
		$fec = $_POST['ffecsalida'];
		include('DF20000.php');
		$fecha_final = $f_m;
		
		$usu=mysqli_real_escape_string($con,$_POST['fnumcto']);
  		
		$dt_user=mysqli_fetch_array(mysqli_query($con ,"SELECT  count(*) as numRows, fnumcto FROM valeryus19 WHERE fnumcto='$usu' AND ffecllegada <= '$fecha_inicial' AND ffecsalida > '$fecha_inicial' AND n_reg != '".$_POST['bot']."' "));
        $xox=mysqli_fetch_array(mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fnumcto='$usu' AND ffecllegada <= '$fecha_inicial' AND ffecsalida > '$fecha_inicial' AND n_reg != '".$_POST['bot']."' "));//ENTRADA ENTRE DOS FEHCAS
		echo mysqli_error($con);
  
  		if($dt_user['numRows']!=0){
		  		echo alert_JS("ĦĦĦĦLA HABITACION ESTA OCUPADA POR: ".$xox['fapellido']." ".$xox['fnombre']." !!!!");
				return false;
				}
				
		$dt_uper=mysqli_fetch_array(mysqli_query($con ,"SELECT  count(*) as numRows, fnumcto FROM valeryus19 WHERE fnumcto='$usu' AND ffecllegada < '$fecha_final' AND ffecsalida >= '$fecha_final' AND n_reg != '".$_POST['bot']."' "));
        $yoy=mysqli_fetch_array(mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fnumcto='$usu' AND ffecllegada < '$fecha_final' AND ffecsalida >= '$fecha_final' AND n_reg != '".$_POST['bot']."' "));//SALIDA ENTRE DOS FECHAS
		echo mysqli_error($con);
  
  		if($dt_uper['numRows']!=0){
		  		echo alert_JS("ĦĦĦĦLA HABITACION ESTA OCUPADA POR: ".$yoy['fapellido']." ".$yoy['fnombre']." !!!!");
				return false;
				}
				
		 $dt_uwer=mysqli_fetch_array(mysqli_query($con ,"SELECT  count(*) as numRows, fnumcto FROM valeryus19 WHERE fnumcto='$usu' AND ffecllegada > '$fecha_inicial' AND ffecsalida < '$fecha_final' AND n_reg != '".$_POST['bot']."' "));
		 $dod=mysqli_fetch_array(mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fnumcto='$usu' AND ffecllegada > '$fecha_inicial' AND ffecsalida < '$fecha_final' AND n_reg != '".$_POST['bot']."' "));//FECHA ENTRE DOS FECHAS
         echo mysqli_error($con);
  
  		if($dt_uwer['numRows']!=0){
		  		echo alert_JS("ĦĦĦĦLA HABITACION ESTA OCUPADA POR: ".$dod['fapellido']." ".$dod['fnombre']." !!!!");
				return false;
				}
	    include ("rec_miscelaneos_MC.php");
		}
		?>
</body>
<?php
 
mysqli_close($con);
}
?>
</html>