<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php");
include("DF30000.inc");
require_once("DF80000.php");
 

if(isset($_POST['gc'])){
		$selRancho=$_POST['ir'];
		$selCorral=$_POST['sc'];
		
		$fec = '30/01/2014';
		include('DF20000.php');
		$fecha_inicial = $f_m;
		$fec = '31/01/2014';
		include('DF20000.php');
		$fecha_final = $f_m;
		
		@$sq_corrales = mysqli_query($con ,$sq="SELECT * FROM valeryus19 WHERE (ffecllegada <= '$fecha_inicial' AND ffecsalida > '$fecha_inicial' and ftipocto = '$selRancho' and status != 'HISTORICO' and cancelado = '0') or (ffecllegada < '$fecha_final' AND ffecsalida >= '$fecha_final' and ftipocto = '$selRancho' and status != 'HISTORICO' and cancelado = '0') or (ffecllegada > '$fecha_inicial' AND ffecsalida < '$fecha_final' and ftipocto = '$selRancho' and status != 'HISTORICO' and cancelado = '0') ");
		
		//$i = 0;
		while ($as = mysqli_fetch_array ($XoXo)){
		  $OCU = $as['fnumcto'];
		   //$i++;
		}
		
		
		
		/*
		
		
	
@$resultado = mysqli_query($con ,"SELECT * FROM valeryus05 where clavetp!='MTA' order by n_reg");
echo mysqli_error($con);
$g=1;
$count=mysqli_num_rows($resultado);
while(@$registro=mysqli_fetch_array(@$resultado)){


	$ToT = $registro['totalcuartos'];
		$TiPo = $registro['descripcion'];
		
		
		
		
		
		
		
		
		
		
		$aMa = mysqli_query($con ,"SELECT * FROM valeryusst08 WHERE (fec_ini <= '$fecha_inicial' AND fec_fin > '$fecha_inicial' and ftipocto = '$TiPo' ) or (fec_ini < '$fecha_final' AND fec_fin >= '$fecha_final' and ftipocto = '$TiPo' ) or (fec_ini > '$fecha_inicial' AND fec_fin < '$fecha_final' and ftipocto = '$TiPo') ");
		$a = 0;
		while ($status = mysqli_fetch_array ($aMa)){
		  $desocupadas = $status['fnumcto'];
		
		   $a++;
		   
		} 
		 
		$rEs =$ToT -$i-$a;
		
		echo '<input name="ver1" type="hidden" value="'.$registro['descripcion'].'">';     
		
		echo "<td style=' '>";
		
		
		
		echo "<em> Hay ".$rEs." Habitaciones ".$registro['descripcion']. " desocupadas </em></td>";    
		
		
	
	$g++;
} */
		
		echo '<table border="0" width="190">';
		echo "
		<tr>
			<td colspan=\"2\" class=\"footCorr\"><input type=\"button\" value=\"Aceptar\" onclick=\"devCheCorr2()\"></td>
		</tr>";		

		echo "
		<tr>
			<td class=\"encCorr\" width=\"50\"><input type=\"checkbox\" value=\"\" onclick=\"checkAllBox(this.checked)\">Sel.</td>
			<td class=\"encCorr\" width=\"134\">".$selRancho."Descripcion</td>
		</tr>";

		while($dt_corrales=mysqli_fetch_array($sq_corrales)){
			if(strpos($selCorral,"|".$dt_corrales['id_dedran']."|")!==false){
				$checked='checked';
			}else{
				$checked="";
			}
			echo "
			<tr>
				<td><input type=\"checkbox\" value=\"$dt_corrales['fnumcto']\" name=\"checorr\" $checked></td>
				<td>".$dt_corrales['fnumcto']."</td>
				<td>$dt_corrales['des_corral']</td>
			</tr>";			
		}
		echo "</table>";
}
?>
