HOME


Mini Shell 1.0
DIR: /home/islapiiu/sites/shiny/admin/
Upload File :
Current File : /home/islapiiu/sites/shiny/admin/view-invoice.php
<?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);
?>
<!DOCTYPE html>
<html> 
    <head>
        <meta charset="UTF-8">
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <title>View Invoice || Invoice Manager</title>
        <link rel="icon" href="favicon.ico" type="image/x-icon">
        <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
        <link href="plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="plugins/node-waves/waves.css" rel="stylesheet" />
        <link href="plugins/animate-css/animate.css" rel="stylesheet" />
        <link href="css/style.css" rel="stylesheet">
        <link href="css/themes/all-themes.css" rel="stylesheet" />
        <link href="plugins/sweetalert/sweetalert.css" rel="stylesheet" />

    </head>

    <body class="theme-red">
        <?php
        include './navigation-and-header.php';
        ?>
        <section class="content">
            <div class="container-fluid"> 
                <?php
                if (isset($_GET['message'])) {
                    $MESSAGE = New Message($_GET['message']);
                    ?>
                    <div class="alert alert-<?php echo $MESSAGE->status; ?>" role = "alert">
                        <?php echo $MESSAGE->description; ?>
                    </div>
                    <?php
                }
                ?>
                <div class="row clearfix">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <form  method="post" action="post-and-get/invoice.php" enctype="multipart/form-data">
                            <div class="card">
                                <div class="header">
                                    <h2>
                                        View Invoice #<?php echo sprintf("%06d", $INVOICE->id); ?>
                                    </h2>
                                </div>
                                <div class="body row">
                                    <div class="col-sm-12 col-md-12" > 
                                        <table style="width: 100%; border-top: 0px;" > 
                                            <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> 
                                        </table>
                                        <div class="text-center hidden-print">
                                            <br/>
                                            <br/>
                                            <a class="btn btn-success" target="_blank" href="print-invoice.php?id=<?php echo $INVOICE->id; ?>"><i class="glyphicon glyphicon-print"></i> : Print This Invoice</a>
                                            <br/>
                                            <br/>
                                        </div>
                                    </div> 
                                </div>
                            </div>

                        </form> 
                    </div>
                </div>
            </div>
        </section>
        <!-- Jquery Core Js -->
        <script src="plugins/jquery/jquery.min.js"></script>
        <script src="plugins/bootstrap/js/bootstrap.js"></script>
        <script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>
        <script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
        <script src="plugins/node-waves/waves.js"></script>
        <script src="plugins/sweetalert/sweetalert.min.js"></script> 
        <script src="js/admin.js"></script>
        <script src="js/demo.js"></script>
        <script src="js/invoice.js" type="text/javascript"></script>
    </body>
</html>