<?
require_once('../conf/connection.php');

$ano=date("Y");

date_default_timezone_set("America/Buenos aires" ) ; 
$hora = date('h:i a',time() - 3600*date('I')); 

//buscamos registro de fechas. 
$comprobar="select * from add_fecha ";
 $r_ide=mysql_query($comprobar,$conn) or die("Error en el query: ".mysql_error());
 $nr_ide=mysql_num_rows($r_ide);
 

if($nr_ide==""){?> <script>window.location.href = "fecha.php"; </script><? }else{ 
$fecha=mysql_result($r_ide,0,"fecha");
?>


<!DOCTYPE html>
<html dir="ltr" lang="en-US"><head><!-- Created by Artisteer v4.3.0.60745 -->
    <meta charset="utf-8">
    <META HTTP-EQUIV="REFRESH" CONTENT="3">
    <title>MENU PRINCIPAL</title>
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">

    <!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <link rel="stylesheet" href="../style.css" media="screen">
    <!--[if lte IE 7]><link rel="stylesheet" href="style.ie7.css" media="screen" /><![endif]-->
    <link rel="stylesheet" href="../style.responsive.css" media="all">

    <script src="../jquery.js"></script>
    <script src="../script.js"></script>
    <script src="../script.responsive.js"></script>



<style>.art-content .art-postcontent-0 .layout-item-0 { margin-bottom: 10px;  }
.art-content .art-postcontent-0 .layout-item-1 { border-right-style:solid;border-right-width:1px;border-right-color:#C4C6BD; padding-right: 10px;padding-left: 10px;  }
.ie7 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
.ie6 .art-post .art-layout-cell {border:none !important; padding:0 !important; }

</style>

<script>
function mesas(){ window.location.href='mesas.php?fecha=<? echo $fecha ?>&hora=<? echo $hora ?>';  }

function stock(){
	
			miPopup = window.open("stock/index.php?fecha=<? echo $fecha ?>","cant_","width=900,height=500,top=80,left=200,status=no, scrollbars=no, toolbars=no, menubar=no,resizable=yes,directories=no");
			miPopup.focus();
}

function cierre(){
	
			miPopup = window.open("cierre/index.php?fecha=<? echo $fecha ?>","cant_","width=900,height=500,top=80,left=200,status=no, scrollbars=no, toolbars=no, menubar=no,resizable=yes,directories=no");
			miPopup.focus();
}

function pagos(){ window.location.href='caja/index.php?fecha=<? echo $fecha ?>';  }
function admin(){ window.location.href='admin/admin/principal.php?fecha=<? echo $fecha ?>';  }

function edit(){ window.location.href='edit.php?fecha=<? echo $fecha ?>';  }
</script>
<style>
.img_logo {
	
	position:absolute;
	top:250px;
	right:0px;
	left:100px;
	
}


</style>
</head>
<body>

<div id="art-main">
    <div class="art-sheet clearfix">
<nav class="art-nav">
    <ul class="art-hmenu">
        <li><a><font size="+1" color="#FF0000">Fecha: <? echo $fecha ?></font></a></li>
        <li><a><font size="+1" color="#FF0000">Hrs: <? echo $hora ?></font></a></li>
        <li><a href="fecha.php" class="active">Cambiar fecha</a></li>
     
      
    </ul> 
    </nav>
<div class="art-layout-wrapper">
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                      <div class="art-layout-cell art-content"><article class="art-post art-article">
                                
                                                
                                <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout-wrapper layout-item-0">
<div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-1" style="width: 100%" >
     
        <h3>MENU PRINCIPAL</h3>
        <p><strong>Presione algunos de los botones para iniciar la acción...</strong> </p>
        <div class="image-caption-wrapper" style="width: 100%">
          <table width="404" border="0">
            <tr>
              <td><input type="button" class="art-button" value="TOMA DE PEDIDO" style="height:45px; width:93px;" onClick="mesas()">
                <input type="button" class="art-button" value="EDITAR PEDIDO" style="height:45px; width:93px;"onClick="edit()"></td>
            </tr>
            <tr>
              <td><?
        $buscar='select * from platos where stock_plato >0 and estado_plato=1 and idgrupos=2';
		   $r=mysql_query($buscar,$conn) or die("Error en el query: ".mysql_error());
		   $n=mysql_num_rows($r);
		    //si hay registros los procesamos
			if($n>0)
			{
			?>
                <table  width="383" border="0">
                  <tr bgcolor="#69BFE0" >
                    <td colspan="3" align="center" bgcolor="#FFFFFF">Stock de Menu</td>
                  </tr>
                  <tr bgcolor="#69BFE0" >
                    <td colspan="3" align="center" bgcolor="#FFFFFF"><hr></td>
                  </tr>
                  <tr bgcolor="#69BFE0" >
                    <td width="186" bgcolor="#FFFFFF">Productos</td>
                    <td width="97" bgcolor="#FFFFFF">Cantidad</td>
                    <td width="44" bgcolor="#FFFFFF">Precio</td>
                  </tr>
                  <tr bgcolor="#69BFE0" >
                    <td colspan="3" bgcolor="#FFFFFF"><hr></td>
                  </tr>
                  <?
				while($row=mysql_fetch_assoc($r))
				{ //Procesamos cada registro como una fila de tabla
					?>
                  <tr>
                    <?
					//$row["nomCampo"] estos nomCampo son los campos devueltos por el
					//query en la variable $r que procesa mysql_fetch_assoc
					?>
                    <td><? $plato=$row["idplatos"];
					 $query="SELECT * FROM platos WHERE idplatos='$plato'";
 					 $rs_query=mysql_query($query);$nombre=mysql_result($rs_query,0,"descrip_plato");
                     echo $nombre;
					 
					  ?></td>
                    <td align="right"><? echo $row["stock_plato"] ?></td>
                    <td align="right"><? echo $row["precio_plato"] ?></td>
                  </tr>
                  <? }?>
                  <tr>
                    <td colspan="3"><hr></td>
                  </tr>
                </table>
                <? } 
			else
			{
				echo "No hubieron coincidencias!";
     
			} ?>
                <br>
                <br>
                <?
        $buscar='select * from platos where stock_plato >0 and estado_plato=1 and idplatos BETWEEN 189 AND 190 ';
		   $r=mysql_query($buscar,$conn) or die("Error en el query: ".mysql_error());
		   $n=mysql_num_rows($r);
		    //si hay registros los procesamos
			if($n>0)
			{
			?>
                <table  width="383" border="0">
                  <tr bgcolor="#69BFE0" >
                    <td colspan="3" align="center" bgcolor="#FFFFFF">Agregados</td>
                  </tr>
                  <tr bgcolor="#69BFE0" >
                    <td colspan="3" align="center" bgcolor="#FFFFFF"><hr></td>
                  </tr>
                  <tr bgcolor="#69BFE0" >
                    <td width="186" bgcolor="#FFFFFF">Productos</td>
                    <td width="97" bgcolor="#FFFFFF">Cantidad</td>
                    <td width="44" bgcolor="#FFFFFF">Precio</td>
                  </tr>
                  <tr bgcolor="#69BFE0" >
                    <td colspan="3" bgcolor="#FFFFFF"><hr></td>
                  </tr>
                  <?
				while($row=mysql_fetch_assoc($r))
				{ //Procesamos cada registro como una fila de tabla
					?>
                  <tr>
                    <?
					//$row["nomCampo"] estos nomCampo son los campos devueltos por el
					//query en la variable $r que procesa mysql_fetch_assoc
					?>
                    <td><? $plato=$row["idplatos"];
					 $query="SELECT * FROM platos WHERE idplatos='$plato'";
 					 $rs_query=mysql_query($query);$nombre=mysql_result($rs_query,0,"descrip_plato");
                     echo $nombre;
					 
					  ?></td>
                    <td align="right"><? echo $row["stock_plato"] ?></td>
                    <td align="right"><? echo $row["precio_plato"] ?></td>
                  </tr>
                  <? }?>
                  <tr>
                    <td colspan="3"><hr></td>
                  </tr>
                </table>
                <? } 
			else
			{
				echo "No hubieron coincidencias!";
     
			} ?></td>
            </tr>
          </table>
        </div>
    </div>
    </div>
</div>
</div>
</div>


</article></div>
                    </div>
                </div>
            </div><footer class="art-footer">
<p><br></p>
<p>Copyright © <? echo $ano; ?>. All Rights Reserved.</p>
</footer>

    </div>
    <p class="art-page-footer">
        <span id="art-footnote-links"><a href="http://www.virtualsurchile.cl" target="_blank">Informatica Francisco Arias E.I.R.L.</a></span>
        
    </p>
    <p align="center"><img src="../images/logo.png" alt="" width="149" height="133" ></p>
</div>


</body></html>
<? } ?>