<?php
include('../../connection/conn.php');
include('../../servair/session.php'); 
require_once("header_print.php"); 

?>


<div id="content_holder" hidden>
<div id="ele1" class="a/">
<?php
echo "<div style='text-align:center; margin-top:-400px; 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>";
    
$transactionid = $_GET['transid'];  
$query=mysqli_query($conn, "SELECT * FROM card_loading_transactions WHERE TransactionId = '$transactionid'"); 
while($spec=mysqli_fetch_assoc($query)){
$firstname = $spec['FirstName'];
$middlename = $spec['MiddleName'];
$lastname = $spec['LastName'];
$creditbefore = $spec['CreditBefore'];
$creditafter = $spec['CreditAfter'];
}
    
echo "<p>".$firstname." ".$middlename." ".$lastname."</p>";

echo "</div>";


echo "<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; text-align:left;'>Description</th>
<th style='border:none; '>Amount</th>
</tr>
";
    


$query=mysqli_query($conn, "SELECT * FROM card_loading_transactions WHERE TransactionId = '$transactionid'"); 
while($spec=mysqli_fetch_assoc($query)){ 
echo "<tr>";
echo "<td style='padding:2px; text-align:left;'>Card Loading Transaction</td>"; 

echo "<td>".$spec['AmountLoaded']."</td>";

echo "</tr>";

$amountloaded = $spec['AmountLoaded'];
 }   
    
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;'>".$amountloaded."</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> ".$amountloaded."</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;'>".$creditbefore."</td>"; 
echo "</tr>";
    
echo "<tr>";
echo "<td style='width:10px; padding:0px 0px 0px; text-align:left;'>Amount loaded</td>";  
echo "<td style='text-align:right;'>".$amountloaded."</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> ".$creditafter."</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>
    
 <?php
require_once("footer_print.php");    
?>
<script>
$('#ele1').print();
window.location = "../../servair/card_loading.php";
</script>
    
