<?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;
$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">
$(document).ready(function(){
	function formatItem(row) {
		return " (<strong>" + row[1] + "</strong>)"+row[0];
	}
	var pagRes='valeryus51100_CPS.php';
	var idObjDes='ftarifaxa';
	var idObjCve='ia';//esto es num de adultos no id de tarifa
	var idObjTotal='fmonadu';
	//var idObjManual='manual';
	
	var nomObjRad='tip_bus_ope';
//ademas el autocomplete se va a ejecutar con la descripcion no con la clave
	$("#"+idObjDes).autocomplete({
            source:pagRes,
		 change: function (event, ui) {
                                          if (ui.item == null || ui.item == undefined) {
                                            $("#"+idObjDes).val( "");
                                                $("#"+idObjTotal).val("");
                                                  $("#"+idObjCve).val("");                                                                                    
                                        }
                         },
		minChars: 1,                 //Caracteres Minimos antes de autocompletar
		max:20,                      //maximo de resultados mostrados, se manda como limit en autosugestion
		                 //ancho del cuadro de despliegue
		 delay: 200,           //Resalta letras coincidentes
		autoFill: true,             //autocompleta en texto la posible palabra
		scroll: true,				 //si cuadro tiene barra scroll
		scrollHeight: 100,           //alto del cuadro para el scroll
		
                           select: function( event, ui ) {
                        
                     $("#"+idObjDes).val( ui.item.gdescrip);
		$("#"+idObjTotal).val(ui.item.gtotal);
         }
	});		
});
<!---------------
$(document).ready(function(){
	function formatItem(row) {
		return " (<strong>" + row[1] + "</strong>)"+row[0];
	}
	var pagRes='valeryus51200_CPS.php';
	var idObjDes='ftarifaxm';
	var idObjCve='im';
	var idObjTotal='fmonmen';
	var nomObjRad='tip_bus_ope';
	$("#"+idObjDes).autocomplete({
            source:pagRes,
		 change: function (event, ui) {
                                          if (ui.item == null || ui.item == undefined) {
                                            $("#"+idObjDes).val( "");
                                                $("#"+idObjTotal).val("");
                                                  $("#"+idObjCve).val("");                                                                                    
                                        }
                         },
		minChars: 1,                 //Caracteres Minimos antes de autocompletar
		max:20,                      //maximo de resultados mostrados, se manda como limit en autosugestion
		minLength: 0,     
		 delay: 200,           //Resalta letras coincidentes
		autoFill: true,             //autocompleta en texto la posible palabra
		scroll: true,				 //si cuadro tiene barra scroll
		scrollHeight: 100,           //alto del cuadro para el scroll
                           select: function( event, ui ) {
                     $("#"+idObjDes).val( ui.item.gdescrip);
		$("#"+idObjTotal).val(ui.item.gtotal);
         }
	});	
});
-->
    function sumaTex(){
	var objTex1=document.getElementById('tex4'),
		objTex2=document.getElementById('tex5'),
		objTex3=document.getElementById('tex6');
	objTex3.value=(parseFloat(objTex1.value)*parseFloat(objTex2.value)).toFixed(2);
}
</script>
<?php
$fechall='';
if(!isset($_POST['bot']))$_POST['bot']="";
if ($_POST['bot']==""){
$_REQUEST['bot']=isset($bot)?$bot:"";
$_POST['bot']=isset($bot)?$bot:"";
}else{
$_REQUEST['bot']=$_REQUEST['bot'];
$_POST['bot']=$_POST['bot'];
}
if (isset($_POST['bot']) && $_POST['bot']==""){
	echo '<h2>!!! SELECCIONE UN REGISTRO !!!</h2>';
	echo '<meta content="1; url=rec_checkin_PR.php"  HTTP-EQUIV="REFRESH">';
}else{
	include('rec_checkin_CL.php');
	$varible_clase = new clase();
	$res=$varible_clase->lista_busqueda((isset($_POST["bot"]))?$_POST["bot"]:"");
	$reg=mysqli_fetch_array($res);
	if(!isset($_POST['fnombre'])){
	$_REQUEST['fcodtarifa']=$reg['fcodtarifa'];
	$_REQUEST['fnumres']=$reg['fnumres'];
	$_REQUEST['fnumcto']=$reg['fnumcto'];
	$fechall=$reg['ffecllegada'];
	$_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['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['select1']=$reg['status'];
	$_REQUEST['fusualta']=$reg['fusualta'];
	
	//direccion
	$_REQUEST['fnombre']=$reg['fnombre'];
	$_REQUEST['fapellido']=$reg['fapellido'];
	
	$_REQUEST['tex']=$reg['tex'];
	$_REQUEST['tex2']=$reg['tex2'];
	$_REQUEST['tex3']=$reg['tex3'];
	$_REQUEST['tex4']=$reg['tex4'];
	$_REQUEST['tex5']=$reg['tex5'];
	$_REQUEST['tex6']=$reg['tex6'];
	
	$_REQUEST['cuarto_seguro']=$reg['cuarto_seguro'];
	$_REQUEST['fnumadulx']=$reg['fnumadulx'];
	$_REQUEST['fnummenorx']=$reg['fnummenorx'];
	$_REQUEST['ftarifaxa']=$reg['ftarifaxa'];
	$_REQUEST['ftarifaxm']=$reg['ftarifaxm'];
	$_REQUEST['fmonadu']=$reg['fmonadu'];
	$_REQUEST['fmonmen']=$reg['fmonmen'];
	$_REQUEST['folio']=$reg['folio'];
	$_REQUEST['status']=$reg['status'];
	}
?>
<style type="text/css">
BODY {
SCROLLBAR-FACE-COLOR:#0000CC; SCROLLBAR-HIGHLIGHT-COLOR:#00CCFF; SCROLLBAR-SHADOW-COLOR:#0000CC; SCROLLBAR-3DLIGHT-COLOR:#0000CC; SCROLLBAR-ARROW-COLOR:#FFFFFF; SCROLLBAR-TRACK-COLOR:#FFFFFF; SCROLLBAR-DARKSHADOW-COLOR: #330000
}
<!--
#Layer2 {
	position:absolute;
	 left:378px;
	top:221px; 
	width:172px;
	height:87px;
	z-index:1;
	overflow:auto;
	right:auto;
	 ;
}
.pp {
background-color:#666666;
 ;
}

-->

</style>

<body  onLoad="sumaTex();">
<form  name="frm1" method="post" action="" enctype="multipart/form-data">
<input name="bot" type="hidden" value="<?php
 echo (isset($_POST["bot"]))?$_POST["bot"]:"" ;?>">
<?php

if (!isset($_POST['Submit2'])){

//CHECA HABITACION OCUPADA O DESCUPADA EN EL MOMENTO DE ESTAR INGRESANDO DATOS
	$fec = $_REQUEST['ffecllegada'];
		include('DF20000.php');
		$fini = $f_m;
		$fec = $_REQUEST['ffecsalida'];
		include('DF20000.php');
		$fsal = $f_m;
	
	if ($_REQUEST['fnumcto']!=$reg['fnumcto']){
//COMPARACION DE FECHAS PARA LA rec_ocupacion DE CUARTOS
  		$dt_user=mysqli_fetch_array(mysqli_query($con ,"SELECT  count(*) as numRows, fnumcto FROM valeryus19 WHERE fnumcto='".$_REQUEST['fnumcto']."' AND ffecllegada < '$fini' AND ffecsalida > '$fini' "));
  echo mysqli_error($con);
   $dt_uper=mysqli_fetch_array(mysqli_query($con ,"SELECT  count(*) as numRows, fnumcto FROM valeryus19 WHERE fnumcto='".$_REQUEST['fnumcto']."' AND 
		ffecllegada < '$fsal' AND ffecsalida > '$fsal' "));
  echo mysqli_error($con);
   $dt_uwer=mysqli_fetch_array(mysqli_query($con ,"SELECT  count(*) as numRows, fnumcto FROM valeryus19 WHERE fnumcto='".$_REQUEST['fnumcto']."' AND 
		ffecllegada > '$fini' AND ffecsalida < '$fsal' "));
  echo mysqli_error($con);
  
  		if($dt_user['numRows']!=0){
		  	$oc1=1;
				}else  
  		if($dt_uper['numRows']!=0){
 		  		$oc2=1;
				} else
  		if($dt_uwer['numRows']!=0){
		 		$oc3=1;
				}else{
				$oc1=0;
				$oc2=0;
				$oc3=0;
				}
		if( ($oc1==1) || ($oc2==1) || ($oc3==1)){ 
	echo '	<script language="javascript">
		alert("LA HABITACION ESTA OCUPADA!!!");
			</script>';
		$_REQUEST['fnumcto']='';
		$_REQUEST['ftipocto']='';
				
		}
	}	
}

     $fecha = daydiff ($_REQUEST['ffecsalida'],$_REQUEST['ffecllegada'],'d/m/Y');
 
         for ($i=0; $i<$fecha; $i++)   
    {   
        $Segundos = $Segundos + 86400;         
        $caduca = date("D",time()+$Segundos);     
            if ($caduca == "Fri")   
            {    
				$val1=$val1+1;  
            }   
            else if ($caduca == "Sat")   
            {   
				$val2=$val2+1;
            }   
            else  
            {   
                $FechaFinal = date("Y-m-d",time()+$Segundos);  
				$cuenta=$cuenta+1; 
            }   
    }  
	$sabd=$val1+$val2;
	  
$lkjsa = daydiff ($_REQUEST['ffecsalida'],$_REQUEST['ffecllegada'],'d/m/Y');

  $difd = daydiff ($fechall,$dt_empres['fec_alta'],'Y-m-d');
echo $difd;

$feccmb=($difd<0)?chfecha($reg['fec_alta'],'Y-m-d','d/m/Y'):$_REQUEST['ffecllegada'];
//$reg['ffecsalida'],'Y-m-d'
?>

<table width="601" border="0" align="center" onMouseOver="sumaTex();">
  <tr><th colspan="7" class=\"titulo\"><div align="center"> CAMBIO DE HABITACION </div></th></tr>
  <tr>
    <td colspan="6">
	<div align="center" id="capa"><?php

	$fotografia = 'foto/valeryus19/NO_'. $reg["n_reg"] .'.JPG';
			if (file_exists($fotografia)) {
				echo '<img src="foto/valeryus19/NO_'.$reg["n_reg"].'.JPG" width="150" height="175">';
			}else{
				echo '<img src="foto/Sin_Foto.jpg" width="150" height="175">';
			}
			?>
      </div>	<span class="Estilo22">   
      
      </span>	  </td>
    </tr>
  
  <tr>
    <td width="72"  ><span class="Estilo26">FOLIO</span></td>
    <td width="326" style="#66CCFF">
	  <span class="Estilo22">
	  <input name="ffecllegada" type="hidden" id="ffecllegada" size="10" onKeyPress="return validar(event)" value="<?php echo $feccmb?>">	  
	  <input name="respaldoFnumcto" type="hidden"value="<?php echo $reg['fnumcto'];?>">	  
	  <span class="Estilo21"><?php
 echo "". (isset($_POST['bot']))?$_POST['bot']:""."";?> </span></span></td>
    <td colspan="2"  ><span class="Estilo27"><strong>FECHA DE LLEGADA</strong></span></td>
    <td width="107" colspan="2" style="#66CCFF"><span class="Estilo23"><?php
 echo "". $_REQUEST['ffecllegada']."";?></span></td>
    </tr>
  <tr>
    <td  ><span class="Estilo26">NOMBRE Y APELLIDO</span></td>
    <td style="#66CCFF"><span class="Estilo22">
      <input name="ffecsalida" type="hidden" id="ffecsalida" size="10" onKeyPress="return validar(event)" value="<?php echo $_REQUEST['ffecsalida'];?>" >      
      <span class="Estilo21"><?php
 echo "". $_REQUEST['fnombre']." ".$_REQUEST['fapellido'] ."";?></span></span> </td>
    <td colspan="2"  ><span class="Estilo27"><strong>FECHA DE SALIDA </strong></span></td>
    <td colspan="2" style="#66CCFF"><span class="Estilo23"><?php
 echo "". $_REQUEST['ffecsalida']."";?> </span></td>
    </tr>
  <tr>
    <td  ><span class="Estilo26">TARIFA </span></td>
    <td colspan="5" style="#66CCFF"> 
	  <span class="Estilo22">
        <input name="tex" type="text" id="tex" size="3" value="<?php if(isset($_POST['tex'])){
		  echo $_POST['tex'];
		  }else{
		  echo $_REQUEST['tex'];
		  }?>" readonly="true"/>
          <input name="tex2" type="text" id="tex2" size="25" value="<?php if(isset($_POST['tex2'])){
		  echo $_POST['tex2'];
		  }else{
		  echo $_REQUEST['tex2'];
		  }
		  ?>" READONLY>
          <input name="tex3" type="hidden" id="tex3" size="4" value="<?php echo $_REQUEST['tex3'];?>" readonly="true">
          <span class="Estilo24">$</span></span>
          <span class="Estilo22">
		  
		  <input name="manual" type="hidden" id="manual" size="3" value="<?php 
		  if(isset($_POST['manual'])){
		  echo $_POST['manual'];
		  }else{
		  echo $_REQUEST['manual'];
		  }
		  ?>"/>
		<?php
 
		@$sql = mysqli_query($con ,"select * from dxopemaex where nombre like '".$_SESSION['usuario']."'");
        @$reg = mysqli_fetch_array($sql);
//		if ($_POST['manual']=='SI' and $reg['manual']=='1'){?>
		<input name="tex4" type="text" id="tex4" size="5" value="<?php  if(isset($_POST['tex4'])){ echo $_POST['tex4']; }else{ echo $_REQUEST['tex4'];
		  }?>" onMouseOver="sumaTex()"  readonly="true"/>
		<?php
 //}else{ ?>
	
		<?php
 // }?>
		            
		  <input name="tex5" type="text" id="tex5" size="2" value="<?php  if (isset($cuenta) && $cuenta==''){ echo '0';	}else{	echo "".(isset($cuenta))?$cuenta:""."";	}  ?>"          onMouseOver="sumaTex()" readonly="true">
          <span class="Estilo25">=<strong>$</strong></span></span>
          <span class="Estilo22">
<input name="tex6" type="text" id="tex6" size="5" onMouseOver="sumaTex()" value="<?php echo $_REQUEST['tex6']; ?>" readonly="true">          
      </span></td>
    </tr>
  <tr>
    <td  ><span class="Estilo26">NUM ADULTO  EXTRA</span></td>
    <td colspan="5" style="#66CCFF"><input name="fnumadulx" type="text" id="fnumadulx" onBlur="may(this)" size="5" value="<?php echo $_REQUEST['fnumadulx'];?>"/>
      <span class="Estilo22">
      <!--input name="ia" type="text" id="ia" size="3" value="<?php //echo $_REQUEST['ia'];?>" /-->
      <input name="ftarifaxa" type="text" id="ftarifaxa" size="40" value="<?php echo $_REQUEST['ftarifaxa'];?>" />
      <input name="fmonadu" type="text" id="fmonadu" size="5" value="<?php  if ($_REQUEST['fmonadu']!='') { echo $_REQUEST['fmonadu']; } else { echo '0'; }?>" />
	  <input name="status" type="hidden" id="status" tabindex="20" size="25" value="<?php echo $_REQUEST['status'];?>">
	<input name="folio" type="hidden" id="folio" tabindex="20" size="25" value="<?php echo $_REQUEST['folio'];?>">
      </span></td>
  </tr>
  <tr>
    <td  ><span class="Estilo26">NUM MENOR EXTRA</span></td>
    <td colspan="5" style="#66CCFF"><input name="fnummenorx" type="text" id="fnummenorx"
	  onBlur="may(this)" size="5" value="<?php echo $_REQUEST['fnummenorx'];?>"/>
      <span class="Estilo22">
      <!--input name="im" type="text" id="im" size="3" value="<?php //echo $_REQUEST['im'];?>" /-->
      <input name="ftarifaxm" type="text" id="ftarifaxm" size="40" value="<?php echo $_REQUEST['ftarifaxm'];?>" />
      <input name="fmonmen" type="text" id="fmonmen" size="5" value="<?php  if ($_REQUEST['fmonmen']!='') { echo $_REQUEST['fmonmen']; } else { echo '0'; }?>" />
      </span></td>
  </tr>
  <tr>
    <td colspan="6"  ><div align="center">
      <input name="?323" type="button" class="bot_ZaZ" tabindex="3" onClick="
	  	openWindow(
		{
			action:'FRGC20000.php',
			width:700,
			height:350
		},{
			val:'fnumcto',
			des:'ftipocto',
			alta:'tex4',
			baja:'text4'
		})" value="Buscar Habitacion" >
    </div></td>
    </tr>
  <tr>
    <td  ><span class="Estilo27">
      <label><strong>TIPO DE HABITACION</strong></label>
    </span></td>
    <td colspan="5" style="#66CCFF"><input name="ftipocto" type="text" id="ftipocto" value="<?php echo $_REQUEST['ftipocto'];?>" READONLY></td>
    </tr>
  <tr>
    <td  ><span class="Estilo27"><strong>NUMERO DE HABITACION </strong></span></td>
    <td colspan="5" style="#66CCFF"><input name="fnumcto" type="text" id="fnumcto" tabindex="20" size="5"  value="<?php echo $_REQUEST['fnumcto'];?>" READONLY></td>
    </tr>
	
	<?php

	$habAnt="".$_REQUEST['fnumcto']."";
	?>
  
  <tr>
    
	      <td  ><span class="Estilo27"><strong>MOTIVO DE CAMBIO DE CUARTO</strong></span>
	      <td colspan="5" style="#66CCFF">          
          
	      <textarea name="camb_hab" cols="60" rows="4" id="camb_hab" onBlur="may(this)" tabindex="4"><?php echo ( (isset($_REQUEST['camb_hab']))?$_REQUEST['camb_hab']:"" );?></textarea>                          </tr>

  <tr>
    <td colspan="7"><div align="center">
      <input name="Submit2" type="submit" class="original" tabindex="29" value="Cambiar Hab." />
      &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_checkin_PR.php','_self')" value="Regresar"/>
    </div></td>
    </tr>
</table>

</form>
  <?php
if(isset($_POST['bot3'])){
	echo '<div align="center">
	<form id="form1" name="form1" action="rec_checkin_PR.php" target="_self">
		<input type="submit" name="submit" value="Regresar">
	</form>
	</div>';
	}
if (isset($_POST['Submit2'])){
	/////////////////////////////////////////////////////////////SENTENCIA DE REGISTRO///////////////////////////////////////
	

    if (isset($_POST['fcodmeca'])&&$_POST['fcodmeca'] == 'USO CASA' || isset($_POST['fcodmeca'])&&$_POST['fcodmeca'] == 'CORTESIA'){
	
	}else{
	
	if (isset($_POST['check'])&&$_POST['check'] == 1 && $_POST['check_baja'] == 0){
	  $dfk = $_POST['tex4'] * $_POST['tex5']; // 6
	    if ($dfk != $_POST['tex6']){
	      echo alert_JS ("���TOTAL TARIFA ALTA INCORRECTA!!!");
	        return false;
	  $iei = $dfk + 0; // 8
	    if ($iei != $_POST['ftotal']){
	      echo alert_JS ("���TOTAL INCORRECTO!!!");
	        return false;
	}
	  }else{}
}
	if (isset($_POST['check_baja'])&&$_POST['check_baja'] == 1 && $_POST['check'] == 0){
	$kai = $_POST['text4'] * $_POST['text5']; // 7
	  if ($kai != $_POST['text6']){
	    echo alert_JS ("���TOTAL TARIFA BAJA INCORRECTA!!!");
	       return false;
	$iei = 0 + $kai; // 8
	  if ($iei != $_POST['ftotal']){
	    echo alert_JS ("���TOTAL INCORRECTO!!!");
	      return false;
	}
	}else{}
}
	
	if (isset($_POST['check_baja'])&&$_POST['check_baja'] == 1 && $_POST['check'] == 1){
	  $dfk = $_POST['tex4'] * $_POST['tex5']; // 6
	    if ($dfk != $_POST['tex6']){
	      echo alert_JS ("���TOTAL TARIFA ALTA INCORRECTA!!!");
	        return false;}
	  $kai = $_POST['text4'] * $_POST['text5']; // 7
	    if ($kai != $_POST['text6']){
	      echo alert_JS ("���TOTAL TARIFA BAJA INCORRECTA!!!");
	        return false;}		
	  $iei = $dfk + $kai; // 8
	    if ($iei != $_POST['ftotal']){
	      echo alert_JS ("���TOTAL INCORRECTO!!!");
	        return false;
	}
	}
	
	
	}	
	/////////////////////////////////> select n_reg,fnumcto,fmuncto,cuarto_seguro,status,ffecllegada,ffecsalida,fecha_real,fnumctos,cancelado,folio,tex4,tiporh from valeryus19 where (status='RESERVA INDIVIDUAL' OR status='RESERVA GRUPO') and cancelado='0' and ffecsalida='0000-00-00'order by ffecllegada;
//////////////////////////////////SENTANCIA DE DATOS////////////////////////////////////
	if(isset($_POST['fnumcto'])){
		include("DMMYSQLG.php");
        include("DMMYSQLG.php");
		$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']);
		$s_folio=mysqli_real_escape_string($con,$_POST['folio']);
		$s_status=mysqli_real_escape_string($con,$_POST['status']);
		
  		if ($s_folio=='EXTRAS' and $s_status=='MISCELANEOS'){
		
		}else{
		$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']."' and cancelado='0' and extra1='0' "));
        $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']."' and cancelado='0' and extra1='0' "));//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;
				}
				}
				if ($s_folio=='EXTRAS' and $s_status=='MISCELANEOS'){
		
		}else{
		$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']."' and cancelado='0' and extra1='0' "));
        $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']."' and cancelado='0' and extra1='0' "));//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;
				}
				}
				
				if ($s_folio=='EXTRAS' and $s_status=='MISCELANEOS'){
		
		}else{
		 $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']."' and cancelado='0' and extra1='0' "));
		 $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']."' and cancelado='0' and extra1='0' "));//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 ("valeryus60300_MC.php");
		}
		?>
</body>
<?php
 
mysqli_close($con);
}
?>
</html>
<?php

//980-->500
//500-->400 ultima actualizacion 4/JULIO/2012
//661
?>
