<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php");
include("DF30000.inc");
include("DF80000.php");
include("JQUERY.inc");
$f_f="";
$f_m="";
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<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
}
.Estilo3 {font-size: 16px}
</style>
<?php
 
$ayuda = 'DG1110A_PR.php';
/*include("DYAYUDA.php");*/
?>
<
<body>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="383" border="0" align="center">
      <tr>
        <th colspan="2"><span class="Estilo3">CONSULTA DE RESERVACIONES INDIVIDUALES/CANCELADAS</span></th>
      </tr>
      <tr>
        <th>FECHA DE LLEGADA </th>
        <th><div align="left">
          <input name="r1" type="radio" value="fecha" tabindex="2">
        <input name="fec" type="text" class="emplea date" id="fec" size="9" maxlength="20" 
			
			<?php
                         
				$fecha = (isset($dt_empres['fec_alta']))?$dt_empres['fec_alta']:"";
	            $fechita = chfecha($fecha,'Y-m-d','d/m/Y');
				if(isset($_POST['fec'])){ //este es el truco
					echo 'value="' . $_POST['fec'] .  '"';
				}else{
					echo 'value="'.$fechita.'"';
				}
			?>onkeypress="return soloNumeros(event)"
		/>
           <!-- <input name="bot" id="bot" type="image" value=" ... " src="logos/cal4.jpg"/>
        --></div></th>
      </tr>
      <tr>
        <th> APELLIDO DEL CLIENTE</th>
        <th><div align="left">
          <input name="r1" type="radio" value="nombre" tabindex="2">
        </div></th>
      </tr>
      <tr>
        <th width="204">          NUMERO DE HABITACION </th>
        <th width="169"><div align="left">
          <input name="r1" type="radio" value="clave" tabindex="1">
        </div></th>
      </tr>
      <tr>
        <td colspan="2">
		<img src="magnifier.png" alt="Buscar" onClick="alert('Buscar')" />
		<input name="tbus" type="text" onBlur="may(this)" size="55"/></td></tr>
      <tr>
        <td colspan="2"><div align="center"><input name="Submit" type="submit" class="form" value="Buscar" />
        </div></td></tr> 
    </table>
  </form>
</div>
<div align="center">
  <form name="frm1" method="post" action="" >
	<?php
 
	$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE status = 'RESERVA INDIVIDUAL' and cancelado = '1' ORDER BY fnumcto");
	include("DE10000.php");
	
	?>
    <table width="968" border='1' cellpadding="0" cellspacing="0">
      <tr>
        <th colspan="8"> <div align="center">
          <input name="bot3" type="Submit" class="form"  onClick="openpage('res_consulta_CO.php','_self')" value="Consultar"/>
		   <input name="bot32" type="Submit" class="form"  onClick="openpage('res_consulta_MO.php','_self')" value="Revivir"/>
        </div></th>
      </tr>
      <tr>
        <th colspan="8" ><strong>REGISTRO DE RESERVACIONES INDIVIDUALES </strong></th>
      </tr>
      <tr>
        <th width="34" height="32"><div align="center">SEL</div></th>
        <th width="59"><div align="center">FOLIO </div></th>
        <th width="109"><div align="center">HABITACION</div></th>
        <th width="186"><div align="center">STATUS </div></th>
		<th width="228"><div align="center">CLIENTE </div></th>
		<th width="114"><div align="center">FECHA DE ENTRADA</div></th>
		<th width="114"><div align="center">FECHA DE SALIDA</div></th>
		<th width="106"><div align="center">STATUS</div></th>
      </tr>
      <?php
      
	$fec = (isset($_POST['fec']))?$_POST['fec']:"";
		include('DF20000.php');
		$fecha_inicial = $f_m;
                $vart=(isset($_POST['tbus']))?$_POST['tbus']:"";
	echo '<input name="txt_bus" type="hidden" value="'.$vart.'">';
	$vars=(isset($_POST['Submit']))?$_POST['Submit']:"";
        $varr=(isset($_POST['r1']))?$_POST['r1']:"";
        if($vars="" &&$varr=="clave")
	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fnumcto = '".$vart."' and status = 'RESERVA INDIVIDUAL' AND cancelado = '1'");
		
	}elseif($vars="" &&$varr=="nombre")
	{
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fapellido like '%".$vart."%' AND status = 'RESERVA INDIVIDUAL' AND cancelado = '1' ORDER BY fapellido");
	}elseif($vars="" &&$varr=="fecha")
	{
		echo '<input name="tip_bus" type="hidden" value="fecha">';
		@$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE ffecllegada = fnumcto = '".$vart."' AND status = 'RESERVA INDIVIDUAL' AND cancelado = '1' ORDER BY fapellido");
	}//'$fecha_inicial'
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		
		if ($reg['cancelado'] == 1){
		echo'<td style="#FF3300"><div align="center"><input name="bot" type="radio" value="'. $reg["n_reg"].'"></div></td>';
		}
		if ($reg['cancelado'] == 1){
		echo "<td style='#FF3300'> <div align='center'><h5>" . $reg["n_reg"] . "&nbsp;</h5></div></td>";
		}
		
		if ($reg['cancelado'] == 1){
		echo "<td style='#FF3300'> <div align='center'><h5>" . $reg["fnumcto"] . "&nbsp;</h5></div></td>";
		}
		
		if ($reg['cancelado'] == 1){
		echo "<td style='#FF3300'> <div align='center'><h5>" . $reg["status"] . "&nbsp;</h5></div></td>";}
		
		if ($reg['cancelado'] == 1){
		echo "<td style='#FF3300'> <div align='center'><h5>" . $reg["fnombre"] . ' '. $reg["fapellido"] . "&nbsp;</h5></div></td>";}
		
		$fec1=$reg["ffecllegada"];
		include('DF20000.php');
		if ($reg['cancelado'] == 1){
		echo "<td style='#FF3300'> <div align='center'><h5>" . $f_f . "&nbsp</h5></div></td>";
		}
		
		$fec1=$reg["ffecsalida"];
		include('DF20000.php');
		if ($reg['cancelado'] == 1){
		echo "<td style='#FF3300'> <div align='center'><h5>" . $f_f . "&nbsp</h5></div></td>";
		}		
		if ($reg['cancelado'] == 1){
		echo '<td  style="#FF3300"> <div align="center"><h5>CANCELADO</h5></div></td>';
		if ($reg['fusucancela']!=''){
		echo "</tr>";
		echo "<tr>";
		echo "<td colspan=\"4\" style=\"#FF3300\" style=\"font-size:12px; font:Arial, Helvetica, sans-serif\"><strong>USUARIO: ".$reg['fusucancela']."</strong></td>";
		echo "<td colspan=\"2\" style=\"#FF3300\" style=\"font-size:12px; font:Arial, Helvetica, sans-serif\"><strong>FECHA CANCELACIÓN: ".$reg['fec_cancela']."</strong></td>";
		echo "<td colspan=\"2\" style=\"#FF3300\" style=\"font-size:12px; font:Arial, Helvetica, sans-serif\"><strong>HORA CANCELACIÓN: ".$reg['hor_cancela']."</strong></td>";
		echo "</tr>";
		}
		}else{
		}
		echo "</tr>";
	}
	mysqli_close($con);
	?>
    </table>
  </form>
  </div>
</body>
</html>