<?php
include('../connection/conn.php');
include('../servair/session.php'); 
require ("../vendor/autoload.php");     
?>

<!DOCTYPE html>

<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>jQuery.Print</title>
<meta name="description" content="jQuery.print is a plugin for printing specific parts of a page">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/normalize.min.css">
    
<style type='text/css'>
.a {
background: black;
color: white;
}
.b {
color: #aaa;
}
</style>
      
</head>
<body>
        
        
<div id="content_holder" hidden>
<div id="ele1" class="a/">
<?php
$Bar = new Picqer\Barcode\BarcodeGeneratorHTML();
$code = $Bar->getBarcode($code, $Bar::TYPE_CODE_128);
echo "<div style='text-align:center; margin-top:-20px; margin:0% auto;'>";
echo "<p><img src='../../library/images/images/servair_lincoln.jpg'width='60%'></p>";

echo "<h1 style='font-size:12px; font-family:sans-serif;'>SERVAIR GHANA COMPANY LTD</h1>
<p style='font-size:10px; font-family:sans-serif;'>AIRPORT CITY 2
<br>P.O.Box KA 18108 KIA
<br>Accra - Ghana
<br>TEL: 0302730367 / 0577707889
<br>".date('l jS \of F Y h:i:s A')."</p>

<p>".$firstname." ".$middlename." ".$lastname."</p>
</div>


<table style=' width:98%; margin: 0% auto; font-size:11px; text-align:center; border-bottom:1px dashed black; '>
<tr style='border-bottom:1px dashed black;'>
<th style='border:none; width:10px; padding:10px;'>Qty</th>
<th style='border:none;'>Description</th>
<th style='border:none; '>Price</th>
<th style='border:none; '>Total</th>
</tr>
";
    

$categoryy = $_GET['Category'];
$query=mysqli_query($conn, "SELECT * FROM sales WHERE TransactionId = '$transactionid'"); 
while($spec=mysqli_fetch_assoc($query)){ 
echo "<tr>";
echo "<td style='padding:2px;'>".$spec['Quantity']." x</td>"; 
echo "<td>".$spec['DishName']."</td>";
echo "<td>".$spec['Price']."</td>";
echo "<td>".$spec['Total']."</td>";
echo "</tr>";


 }   
    
echo "</table>";
    
echo "<table style=' width:98%; margin: 3% auto; font-size:12px; text-align:center;'>";
echo "<tr>";
echo "<td style='width:10px;'><b>Subtotal</b></td>"; 
echo "<td style='text-align:right;'>".$total."</td>"; 
echo "</tr>";
    
echo "<tr>";
echo "<td style='width:10px; padding:10px 0px 0px;'>Tax</td>";  
echo "<td style='text-align:right;'>0.00</td>"; 
echo "</tr>";
    
echo "<tr>";
echo "<td style='width:10px;'><b>Total</b></td>";  
echo "<td style='text-align:right;'><b>GH¢</b> ".$total."</td>"; 
echo "</tr>";
echo "</table>";

echo "<table style=' width:98%; margin: 3% auto; font-size:12px; text-align:center;'>";
echo "<tr>";
echo "<td style='width:140px; text-align:left;'><b>Credit balance b/f</b></td>";  
echo "<td style='text-align:right;'>".$credit."</td>"; 
echo "</tr>";
    
echo "<tr>";
echo "<td style='width:10px; padding:0px 0px 0px; text-align:left;'>Total Items Bought</td>";  
echo "<td style='text-align:right;'>".$total."</td>"; 
echo "</tr>";
    
echo "<tr>";
echo "<td style='width:10px; text-align:left;'><b>Credit Remaining</b></td>";  
echo "<td style='text-align:right;'><b>GH¢</b> ".$remaining."</td>"; 
echo "</tr>";

echo "</table>";
    
echo "<div style='text-align:center; margin-top:20px; font-size:11px;'>";
echo "<span ><b>Vendor</b><br> ".$vendor."</span>";
echo "<h1 style='margin-left:25px; font-size:8px;'>".$Bar->getBarcode($transactionid, $Bar::TYPE_CODE_128)."</h1>"; 
echo "<span>".$transactionid."</span>";
    
    
echo "<p>For enquiries and concerns, please call <br>0302730367 / 0577707889<br>Thank you for your business</p>";
echo "</div>";
?>
</div>
<button class="print-link no-print">
Print this (jQuery('#ele1').print())
</button>         
</div>
    
    
<script src="../library/frameworks/plugins/jquery-ui-1.11.4.custom/jquery-1.11.2.min.js"></script>
        
<script src="../jQuery.print.js"></script>
<script>
$(".no-print").click(function(){
$('#ele1').print();
});
</script>
    
<?php
//header("Location:../../servair/search.php?transid=".$_GET['transid']."&BalanceChange=".$_GET['BalanceChange']."");
?>
    </body>
</html>
