<!DOCTYPE html>
<?php
include_once(dirname(__FILE__) . '/../class/include.php');
include_once(dirname(__FILE__) . '/auth.php');
$id = '';
if (isset($_GET['id'])) {
$id = $_GET['id'];
} else {
echo '<h1>Invalid Request... :(</h1>';
exit();
}
$INVOICE = New Invoice($id);
?>
<html>
<head>
<meta charset="UTF-8">
<title>Print Invoice || Invoice Manager</title>
<link href="plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<table style="width: 100%;">
<tr>
<td>
<table class="table table-responsive">
<tr>
<td style="width: 70%">
<h2 class="text-left bold text-uppercase">Shiny Hotels (Pvt.) Ltd.</h2>
<b>Address: 337/13, Maragaha Hena, Punchi Pathana, Hikakduwa. </b><br/>
<b>Phone: +94 91 227 7702 | +94 77 764 4501</b> <br/>
<b>Email: [email protected]</b> <br/>
<b>Web: www.shiny.lk</b>
</td>
<td style="width: 30%">
<h3 class="text-left bold text-uppercase">Tax Invoice</h3>
<b>Vat Number: 102186141-7000</b><br/><br/>
<b>Invoice Number: #<?php echo sprintf("%06d", $INVOICE->id); ?></b><br/>
<b>Invocie Date: <?php echo $INVOICE->date; ?></b><br/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table class="table table-responsive">
<tr>
<td style="width: 50%;">
<table>
<tr>
<td><b>Customer Name</b>: <?php echo $INVOICE->customer; ?></td>
</tr>
<tr>
<td><b>Customer Address</b>: <?php echo $INVOICE->customer_address; ?></td>
</tr>
<tr>
<td><b>Customer Phone Number: <?php echo $INVOICE->customer_phone; ?></td>
</tr>
</table>
</td>
<td style="width: 50%;">
<table class="pull-right" style="width: 70%">
<tr>
<td><b>Function Date</b>: <?php echo $INVOICE->function_date; ?></td>
</tr>
<tr>
<td><b>Number of Pax</b>: <?php echo $INVOICE->number_of_pax; ?></td>
</tr>
<tr>
<td><b>Booked Date</b>: <?php echo $INVOICE->date; ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table class="table table-responsive table-bordered">
<tr>
<th style="width: 5%" class="text-center">#</th>
<th style="width: 75%">Description</th>
<th class="text-right" style="width: 20%">Amount</th>
</tr>
<?php
$II = new InvoiceItem(NULL);
$II->invoice = $INVOICE->id;
$total = 0;
foreach ($II->getAllByInvoice()as $key => $item) {
$total = $total + $item['amount'];
?>
<tr>
<td class="text-center"><b><?php echo sprintf("%02d", $key + 1); ?></b></td>
<td><?php echo $item['description']; ?></td>
<td class="text-right"><?php echo $item['amount']; ?></td>
</tr>
<?php
}
?>
<tr>
<th class="text-right" colspan="2">Net Sale</th>
<th class="text-right"><?php echo number_format($total, 2); ?></th>
</tr>
<tr>
<th class="text-right" colspan="2">Vat</th>
<?php
$vat = $total * (15 / 100);
?>
<th class="text-right"><?php echo number_format($vat, 2); ?></th>
</tr>
<tr>
<th class="text-right" colspan="2">Total</th>
<?php
$total = $total * (15 / 100) + $total;
?>
<th class="text-right"><?php echo number_format($total, 2); ?></th>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<br/>
<table class="table table-responsive table-bordered">
<tr>
<th style="width: 33.33%" class="text-center"><br/><br/><br/>Prepared By</th>
<th style="width: 33.33%" class="text-center"><br/><br/><br/>Authorized By</th>
<th style="width: 33.33%" class="text-center"><br/><br/><br/>Customer Signature</th>
</tr>
</table>
</td>
</tr>
</table>
<table style="width: 100%; border: 0; position: fixed; bottom: 0; width: 100%; border-top: 1px solid #809980">
<tr>
<td class="text-center">
Copyright © 2019 Shiny Hotels (Pvt.) Ltd. All Rights Reserved.
</td>
</tr>
</table>
<div class="text-center hidden-print">
<br/>
<br/>
<div class="btn btn-success"onclick="window.print();"><i class="glyphicon glyphicon-print"></i> : Print Invoice</div> |
<a class="btn btn-info" href="create-invoice.php"><i class="glyphicon glyphicon-plus"></i> : Create New</a> |
<a class="btn btn-warning" href="index.php"><i class="glyphicon glyphicon-dashboard"></i> : Dashboard</a>
<br/>
<br/>
</div>
<script type="text/javascript">
window.print();
</script>
</body>
</html>
|