<?php

session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
$f_f="";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<head>
<?php

require_once("JQUERY.inc");
?>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Registro con AJAX</title>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="RSSCRIPT.js"></script>
</head>
<body>

<div align="center">
  <form name="form1" method="post" action="">
    <table width="458"  align="center" bordercolor=" " bordercolordark=" ">
      <tr>
        <th colspan="2">MISCELANEOS</th>
      </tr>
      <tr>
        <th width="297"> <input name="r1" type="radio" value="clave" tabindex="1"># DE FOLIO </th>
        <th width="297"><input name="r1" type="radio" value="nombre" tabindex="2">
        X APELLIDO DEL CLIENTE</th>
      </tr>
      <tr>
        <td colspan="2">
		<img src="magnifier.png" alt="Buscar" onClick="alert('Buscar')" />
		<input name="tbus" type="text" onBlur="may(this)" size="65"/></td>
      </tr>
      <tr>
        <td colspan="2"><div align="center"><input name="Submit" type="submit" class="bot_WsW" value="Buscar" />
        </div></td>
      </tr>
    </table>
  </form>
</div>
<form name="frm1" method="post" action="" >

<body>
<div align="center">
<?php
 
	$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE status = 'MISCELANEOS' ORDER BY fnumcto desc");
	include("DE10000.php");
	?>
<table width="806" border='1' bordercolor=" " bordercolordark=" ">
      <tr>
        <th colspan="7"> 
          <div align="center">  
		  <input name="Submit6" type="button" class="original" onClick="openpage('rec_miscelaneos_AG.php','_self')" value="Agregar"/>
          <input name="bot3" type="Submit" class="bot_WsW"  onClick="openpage('rec_miscelaneos_CO.php','_self')" value="Consultar"/>
          <input name="bot2" type="button" class="original" onClick="openpage('rec_miscelaneos_MO.php','_self')" value="Modificar"/>
          <input name="bot4" type="button" class="bot_WsW" onClick="openpage('rec_miscelaneos_IM.php','_self')" value="Imprimir"/>
		  <input name="Submit" type="button" class="original" onClick="openpage('rec_miscelaneos_PR.php','_self')" value="Mostrar todo"/>
          </div>
   		</th></tr>
<tr>
      <th width="35"><div align="center">SEL</div></th>
        <th width="59"><div align="center">FOLIO</div></th>
        <th width="123"><div align="center">HABITACION</div></th>
		<th width="222"><div align="center">CLIENTE </div></th>
		<th width="115"><div align="center">STATUS</div></th>
		<th width="109"><div align="center">FECHA DE ENTRADA</div></th>
	  <th width="97"><div align="center">FECHA DE SALIDA</div></th>
	</tr>
	  <?php
//if(!isset($_POST['tbus']))$_POST['tbus']="";
          $var1=(isset($_POST['r1']))?$_POST['r1']:"";
          $vars=(isset($_POST['submit']))?$_POST['submit']:"";
	echo '<input name="txt_bus" type="hidden" value="'.$_POST['tbus'].'">';
	if($vars=="" && $var1=="clave")
	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE n_reg = '".$_POST['tbus']."' and status = 'MISCELANEOS'");
		if(!isset($_POST['tbus']))$_POST['tbus']="";
	}elseif($vars=="" && $var1=="nombre")
	{
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		@$sql = mysqli_query($con ,"SELECT * FROM valeryus19 WHERE fapellido like '%".$_POST['tbus']."%' AND status = 'MISCELANEOS' ORDER BY fapellido");
	}
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		if ($reg['cancelado'] == 1){
			echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["n_reg"].'" disabled></div></td>';
		}else{
			echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["n_reg"].'"></div></td>';
		}
		echo "<td> <div align='center'><h5>" . $reg["n_reg"] . "&nbsp;</h5></div></td>";
		echo "<td> <div align='center'><h5>" . $reg["fnumcto"] . "&nbsp;</h5></div></td>";
		echo "<td> <div align='center'><h5>" . $reg["fapellido"] . ' '. $reg["fnombre"] . "&nbsp;</h5></div></td>";
		echo "<td> <div align='center'><h5>" . $reg["status"] . "&nbsp;</h5></div></td>";
		$fec1=$reg["ffecllegada"];
		include('DF20000.php');
		echo "<td> <div align='center'><h5>" . $f_f . "&nbsp</h5></div></td>";
		$fec1=$reg["ffecsalida"];
		include('DF20000.php');
		echo "<td> <div align='center'><h5>" . $f_f . "&nbsp</h5></div></td>";
		echo "</tr>";
	}
	mysqli_close($con);
	?>
  </table>
</div>
</body>
</form>
</html>