<!DOCTYPE HTML>
<?php 
include('config.php');



	$sql = "SELECT * FROM posheader WHERE pos_autoid = '$autoid'";
	$dcon 	= $conn->query($sql) or die($sql);
	$rs 	= $dcon->fetch_array();
	
	$transno 		= $rs['pos_transno'];
	$transdate 		= dtostr($rs['pos_transdate']);
	$order_type 	= dtostr($rs['pos_order_type']);
	$table_no 		= dtostr($rs['pos_tableno']);

	$gtotal = $rs['pos_gtotal'];
	$outlet_autoid 	= $rs['outlet_autoid'];
?>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo $pagename?></title>
    <?php include('../../common/script_css.php');?>

</head>
<body class="print_body">


<style>
.tbprint{
	background-color:#333;padding-left:10px;padding:5px;top:0px;left:0px;
	border-bottom:1px gray solid;width:100%;
	min-width:400px;margin-bottom:10px;position:fixed;
	}
@media print  { .noprint  { display: none; } }
@media screen { .noscreen { display: none; } }
@media print {
tr.vendorListHeading {
body {-webkit-print-color-adjust: exact;}
}}

@media print {
    .vendorListHeading th {
    color: white !important;
}}


.print_body{
	background-color:#fff !important;
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px
}
</style>
<div class="noprint">
<div class="tbprint">
        <input type="button" value="Print" class="btn btn-primary mr-1" onclick="window.print()"/>
		<a href="index" class="btn btn-danger">Close</a>
</div>
<br>
<br>
<br>
</div>


<div class="px-1">
<table class="table" width="90%" border="1" bordercolor="#CCCCCC" style="font-size:12px">
<tr>
	<td style="width:30%">No Nota</td>
    <td><?php echo $transno?></td>
</tr>
<tr>
	<td>Waktu</td>
    <td><?php echo $transdate?></td>
</tr>
<tr>
	<td>Order</td>
    <td><?php echo $order_type?></td>
</tr>
<tr>
	<td>Meja No</td>
    <td><?php echo $table_no?></td>
</tr>
</table>

<table class="table" width="90%" border="1" bordercolor="#CCCCCC" style="font-size:12px">
<?php

	$gtotal = 0;
	$i = 0;
	$sql = "select * from posdetail a, mst_product b  WHERE a.pm_autoid = b.pm_autoid AND a.pos_autoid = '$autoid' ORDER BY a.posd_autoid desc";
	$dcon 	= $conn->query($sql) or die($sql);
	while($rs 	= $dcon->fetch_array()){
		$pm_name = $rs['pm_name'];
		$posd_qty = $rs['posd_qty'];
		$posd_price = $rs['posd_price'];
		$subtotal = $posd_price * $posd_qty;
		$_pm_autoid = $rs['pm_autoid'];

?> 
	<tr>
        <td style="width:60%"><?php echo $rs['pm_name']?></td>
    	<td class="tc" style="width:10%"><?php echo $posd_qty?></td>
        <td style="width:30%" class="tr"><?php echo number_format($subtotal)?></td>
	</tr>
<?php 
$i = $i + 1;

$gtotal = $gtotal + $subtotal;

} ?>
	<tr class="bold">
		<td>Subtotal</td>
		<td colspan="2" class="tr"><?php echo number_format($gtotal)?></td>
    </tr>
</table>
</div>
</body>

</html>