<div align="center">
  <form name="form1" method="post" action="">
    <table width="458"  align="center">
      <tr>
        <th colspan="2">REGISTRO DE RESERVACIONES DE GRUPO </th>
      </tr>
      <tr>
        <th width="297"> <input name="r1" type="radio" value="clave" tabindex="1">X # DE HABITACION </th>
        <th width="297"><input name="r1" type="radio" value="nombre" tabindex="2">
        X APELLIDO DEL CLIENTE</th>
      </tr>
      <tr>
        <td colspan="2"><input name="tbus" type="text" onBlur="may(this)" size="75"/></td>
      </tr>
      <tr>
        <td colspan="2"><div align="center">
          <input type="submit" name="Submit" value="Buscar" />
        </div></td>
      </tr> 
    </table>
  </form>
</div>
<div align="center" id="formulario" style="display:none;"></div>
<form name="frm1" method="post" action="" >
<?php

//consulta todos los empleados
$sql=mysqli_query($con ,"SELECT * FROM valeryus19 WHERE status = 'RESERVA GRUPO' ORDER BY fnumcto");
//muestra los datos consultados
//haremos uso de tabla para tabular los resultados
?>
<table width="870" border='1'>
      <tr>
        <th colspan="9"> <div align="center">
          <input type="submit" name="Submit6" value="Agregar" onClick="cargapag('DZA11111.php','_self')"/>
          <input type="Submit" name="bot3" value="Consultar"  onClick="cargapag('FRG50000_CO.php','_self')"/>
          <input type="button" name="bot2" value="Modificar" onClick="cargapag('FRG50000_MO.php','_self')"/>
          <input type="button" name="bot1" value="Cancelar" onClick="cargapag('FRG50000_EL.php','_self')"/>
          <input type="button" name="bot4" value="Imprimir " onClick="cargapag('FRG50000_IM.php','_self')"/>
          <input type="button" name="Submit" value="Mostrar todo" onClick="cargapag('FRG50000_PR.php','_self')"/>
        </div></th>
      </tr>
	  <tr>
        <th colspan="9">REGISTRO DE RESERVACIONES DE GRUPO </th>
      </tr>
<tr>
      <th width="30"><div align="center">SEL</div></th>
        <th width="58"><div align="center">CLAVE </div></th>
        <th width="205"><div align="center">GRUPO</div></th>
	  <th width="108"><div align="center">TIPO DE HABITACION</div></th>
	  <th width="102"><div align="center">HABITACION</div></th>
      <th width="108"><div align="center">CLIENTE </div></th>
	  <th width="78"><div align="center">FECHA DE ENTRADA</div></th>
	  <th width="59"><div align="center">FECHA DE SALIDA</div></th>
      <th width="64"><div align="center">STATUS </div></th>
    </tr>
<?php


echo '<input name="txt_bus" type="hidden" value="'.$_POST['tbus'].'">';
	if($_POST['r1']=="clave")
	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fnumcto = '".$_POST['tbus']."' and status = 'RESERVA GRUPO'");
		
	}elseif($_POST['r1']=="nombre")
	{
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fapellido like '%".$_POST['tbus']."%' AND status = 'RESERVA GRUPO' ORDER BY fapellido");
	}

while($row = mysqli_fetch_array($sql)){
	echo "	<tr>";
	//mediante el evento onclick llamaremos a la funcion PedirDatos(), la cual tiene como parametro
	//de entrada el ID del empleado
	if ($row['cancelado'] == 1){
			echo '<td> <div align="center"><input name="bot" type="radio" value="'. $row["n_reg"].'" disabled></div></td>';
		}else{
			echo '<td> <div align="center"><input name="bot" type="radio" value="'. $row["n_reg"].'"></div></td>';
		}
	if ($row['cancelado'] == 1){
	echo "<td><div align='center'><a style=\"pedirDatos('".$row['n_reg']."')\">".$row['n_reg']." </div></a></td>";
	}else{
	echo "<td><div align='center'><a style=\"text-decoration:underline;cursor:pointer;\" onclick=\"pedirDatos('".$row['n_reg']."')\">".$row['n_reg']." </div></a></td>";
		}
	echo "<td> <div align='center'>" . $row["fcodgrupo"] . "&nbsp;</div></td>";
	echo "<td> <div align='center'>" . $row["ftipocto"] . "&nbsp;</div></td>";
	echo "<td> <div align='center'>" . $row["fnumcto"] . "&nbsp;</div></td>";
	echo "<td> <div align='center'>" . $row["fnombre"] . "&nbsp;</div></td>";
	$fec1=$row["ffecllegada"];
		include('DF20000.php');
		echo "<td> <div align='center'>" . $f_f . "&nbsp</div></td>";
	$fec1=$row["ffecsalida"];
		include('DF20000.php');
		echo "<td> <div align='center'>" . $f_f . "&nbsp</div></td>";
	   if ($row['cancelado'] == 1){
			echo '<td  style="#FF3300"> <div align="center"><h5>CANCELADO</h5></div></td>';
		}else{
		}
	echo "	</tr>";
}
mysqli_close($con);
?>
</table>
</form>