<style type="text/css" media="print">
@page{
   margin: 2px;
}

*{
@font-size:14px;
font-family:"Arial";

}

th{
	border-bottom:solid gray 1px;
}

</style>
<?php
$id = $_GET['id'];
include_once("config.php");

$sql_detalle = mysql_query("select * from detalle_comanda where comanda='$id'") or die (mysql_error());

$sql = mysql_query("select * from comandas where id_comanda='$id'") or die (mysql_error());

?>

<center>
	


<span style="font-size:30px">C O M A N D A</span><br>
<?php echo $_GET["str"]?>
</center>
<br>
<br>
COMANDA #:00<?php echo $_GET["id"]?><br>
Fecha : <?php echo  mysql_result($sql,0,"fecha")?>" - "
<?php echo  mysql_result($sql,0,"hora")?><br>

<br>

<?php echo  mysql_result($sql,0,"mesa")?><br>
CAMARERO: <?php echo  mysql_result($sql,0,"camarero")?><br>
</div>
<br><br>

<table class="">
	
		
		
		             
		<th>ITEM | CANTIDAD | PRECIO | TOTAL</th>
		<th></th>
		

<tbody>
<?php while($r=mysql_fetch_array($sql_detalle)){
$total+=$r["total_precio"];
	?>
			<tr>
			
                
				<td><?php echo $r["descripcion"]?> 
				<br><?php echo decimal($r["cantidad"])." X ".decimal($r["precio"])." = ".decimal($r["total_precio"])?>
				<br>...........................
				</td>   
			</tr>
         <?php }?>
	</tbody>
</table>

<br>
<br>
<div style="float: right; width: 200px;">


<span style="float: left">TOTAL: </span> <span style="float: right;"><?php echo @decimal($total)?></span><br>

</div>

<br><br><br>
<br><br><br>
<div style="float:left">
<center>


</center>
</div>

<script>

	window.print()

	
	setTimeout(function(){
		window.location.href='mesas.php';
	},2000)
</script>