<?php
 
session_start();
$com = "A";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");  
include("DF30000.inc");
include("DF80000.php");
//echo '<meta content="7; url=FA2000_CH.php" HTTP-EQUIV="REFRESH">';
if (isset($_POST['limpio'])){
   @$ss = mysqli_query($con ,"UPDATE valeryus08 SET ocupado = '#00CC00',  acc_fec='".date('Y-m-d')."', acc_hor='".date('H:i:s')."', usuario= '".$_SESSION['usuario']."' WHERE ncto BETWEEN '".$_POST['l1']."' AND '".$_POST['l2']."'");
echo mysqli_error($con);
}if (isset($_POST['sucio'])){
@$ss = mysqli_query($con ,"UPDATE valeryus08 SET ocupado = '#FF0000',  acc_fec='".date('Y-m-d')."', acc_hor='".date('H:i:s')."', usuario= '".$_SESSION['usuario']."' WHERE ncto BETWEEN '".$_POST['s1']."' AND '".$_POST['s2']."'");
echo mysqli_error($con);
}if (isset($_POST['checar'])){
@$ss = mysqli_query($con ,"UPDATE valeryus08 SET ocupado = '#FFFF00',  acc_fec='".date('Y-m-d')."', acc_hor='".date('H:i:s')."', usuario= '".$_SESSION['usuario']."' WHERE ncto BETWEEN '".$_POST['c1']."' AND '".$_POST['c2']."'");
echo mysqli_error($con);
}if (isset($_POST['fuera'])){
@$ss = mysqli_query($con ,"UPDATE valeryus08 SET ocupado = '#000000',  acc_fec='".date('Y-m-d')."', acc_hor='".date('H:i:s')."', usuario= '".$_SESSION['usuario']."' WHERE ncto BETWEEN '".$_POST['f1']."' AND '".$_POST['f2']."'");
echo mysqli_error($con);
}if (isset($_POST['bloqueado'])){
@$ss = mysqli_query($con ,"UPDATE valeryus08 SET ocupado = '#0000CC',  acc_fec='".date('Y-m-d')."', acc_hor='".date('H:i:s')."', usuario= '".$_SESSION['usuario']."' WHERE ncto BETWEEN '".$_POST['b1']."' AND '".$_POST['b2']."'");
echo mysqli_error($con);
}if (isset($_POST['asignado'])){
@$ss = mysqli_query($con ,"UPDATE valeryus08 SET ocupado = '#FF00CC',  acc_fec='".date('Y-m-d')."', acc_hor='".date('H:i:s')."', usuario= '".$_SESSION['usuario']."' WHERE ncto BETWEEN '".$_POST['a1']."' AND '".$_POST['a2']."'");
echo mysqli_error($con);
}
?>


<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<body>
<div align="center">
<form name="frm1" id="frm1" method="post" action="" >
 <table width="250" >
      <tr>
        <td colspan="3"><div align="center"><span class="men">Vista Del Hotel</span> </div></td>
      </tr>
      <tr class="men">
        <td width="152"><div align="center" class="men Estilo17">ROOM STATUS </div></td>
        <td width="32" class="men Estilo18"><div align="center"><strong>PISO.</strong></div></td>
        <td width="44" class="men Estilo18 Estilo27"><div align="center">TOTAL.</div>          <div align="center"></div></td>
	  </tr>
      <tr>
        <td><div align="center">
          <input name="limpio" type="submit" style="background:#00CC33" size="50" value="     LIMPIO    "/>
        </div></td>
        <td>
          <div align="left">
            <input name="l1" type="text" size="5" id="l1"/>		
          </div></td>
         <td>
           <div align="left">
             <input name="l2" type="text" size="5" id="l2"/>		
             </div>
         <div align="center"></div></td>
	  </tr>
      <tr>
        <td><div align="center">
          <input name="sucio" type="submit" style="background:#FF0000" size="50" value="     SUCIO     "/>
        </div></td>
        <td><input name="s1" type="text" size="5" id="s1"/></td>
        <td><input name="s2" type="text" size="5" id="s2"/></td>
      </tr>
      <tr>
        <td><div align="center">
          <input name="checar" type="submit" style="background:#FFFF00" size="50" value="  CHECAR  "/>
        </div></td>
        <td><input name="c1" type="text" size="5" id="c1"/></td>
        <td><input name="c2" type="text" size="5" id="c2"/></td>
	  </tr>
      <tr>
        <td><input name="fuera" type="submit" class="error" style="background:#000000" value="FUERA DE SERVICIO"/></td>
        <td><input name="f1" type="text" size="5" id="f1"/></td>
        <td><input name="f2" type="text" size="5" id="f2"/></td>
	  </tr>
      <tr>
        <td><div align="center">
          <input name="bloqueado" type="submit" class="error" style="background:#0000CC" value=" BLOQUEADO " size="50"/>
        </div></td>
        <td><input name="b1" type="text" size="5" id="b1"/></td>
        <td><input name="b2" type="text" size="5" id="b2"/></td>
	  </tr>
	  <tr>
        <td><div align="center">
          <input name="asignado" type="submit" style="background:#FF00CC" value=" ASIGNADO " size="50"/>
        </div></td>
        <td><input name="a1" type="text" size="5" id="a1"/></td>
        <td><input name="a2" type="text" size="5" id="a2"/></td>
	  </tr>
    </table>
    <input type="button" name="Submit" value="Mostrar todo" onClick="openpage('FA2000_CH.php','_self')"/>
    </table>
  </form>
<?php

echo '<table  style="background-color:#0000CC;" cellspacing="2" cellpadding="0">';
$proXlin=10;
$auxNumLin=-1;
$sq1 = mysqli_query($con ,"SELECT * FROM valeryus08 order by ncto");
echo mysqli_error($con);
while($dt_invent=mysqli_fetch_array($sq1)){
	$auxNumLin++;
	if($auxNumLin==-1 || $auxNumLin%$proXlin==0){
		if($auxNumLin==-1){
			echo "<tr>";
		}else{
			echo "</tr><tr>";
		}
	}

	echo "<td onclick=\"openWindow({action:'ventana.php'},{ncto:'".$dt_invent['ncto']."'})\"> <div class=\"Estilotabla\" style='background-color:".$dt_invent["ocupado"].";' align='center'> ".substr($dt_invent['ncto'],0,5)."</div></td>";
	
}

?>
</div>
</body>
</html>