<?php
//Exportar datos de php a Excel
header("Content-Type: application/vnd.ms-excel" );
header("Expires: 0" );
header("Cache-Control: must-revalidate, post-check=0, pre-check=0" );
header("content-disposition: attachment;filename=Reportes.xls" );
?>
<HTML LANG="es">
<TITLE>::. Exportacion de Datos .::</TITLE>
</head>
<body>
<?php
require_once('../../../../../conf/connection.php');
$familia=$_GET["AcboFamilias"];

if($familia==0){
	$sql = "SELECT * FROM platos ";
    $result=mysql_query($sql);
}else{
$sql = "SELECT * FROM platos WHERE idgrupos='$familia'";
$result=mysql_query($sql);
}
?>
<tr>
  <td>INFORME DE INVENTARIO | REST-POST</td></tr>
<TABLE BORDER=1 align="center" CELLPADDING=1 CELLSPACING=1>
<TR>
<TD>CODIGO</TD>
<TD>PLATOS</TD>
<TD>STOCK</TD>
<TD>PRECIO DE VENTA</TD>

</TR>
<?php
while($row = mysql_fetch_array($result)) {
printf("<tr>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>", $row["idgrupos"], $row["descrip_plato"],$row["stock_plato"],$row["precio_plato"]);
}
mysql_free_result($result);
mysql_close(); //Cierras la Conexión
?>
</table>
</body>
</html>