<?php include 'controller/pageCode.php' ?>
<!DOCTYPE html>
<html lang="en">
 <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
    <meta charset="utf-8">
    <title>Invoice</title>
    <?php include 'inc/meta_inc.php'; ?>
    <!-- base css -->
    <?php include 'inc/styles_inc.php'; ?>
    <link rel="stylesheet" media="screen, print" href="assets/css/markdown.css">
    <link rel="stylesheet" media="screen, print" href="assets/css/page-invoice.css">
</head>
    <body class="mod-bg-1 ">
        <!-- DOC: script to save and load page settings -->
        <?php include 'inc/theme_script_inc.php'; ?>
        <!-- BEGIN Page Wrapper -->
        <div class="page-wrapper" id="app">
            <div class="page-inner">
                <!-- BEGIN Left Aside -->
        <?php include 'inc/aside_inc.php'; ?>
<!-- END Left Aside -->
                <div class="page-content-wrapper">
                    <!-- BEGIN Page Header -->
        <?php include 'inc/header_inc.php'; ?>
<!-- END Page Header -->
                    <!-- BEGIN Page Content -->
                    <!-- the #js-page-content id is needed for some plugins to initialize -->
                    <main id="js-page-content" role="main" class="page-content">
                        <ol class="breadcrumb page-breadcrumb">
                            <li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
                        </ol>
                        <!-- <div class="subheader">
                            <h1 class="subheader-title">
                                <i class='subheader-icon fal fa-plus-circle'></i> Invoice
                                <small>
                                    Printable Invoice Page
                                </small>
                            </h1>
                        </div> -->
                        <?php if(isset($id)):?>
                        <div class="container">
                            <div data-size="A4">
                                <div class="row">
                                    <div class="col-sm-12">
                                        <div class="d-flex align-items-center mb-5">
                                            <h2 class="keep-print-font fw-500 mb-0 text-primary flex-1 position-relative">
                                                3f3 Training Academy
                                                <small class="text-muted mb-0 fs-xs">
                                                Kronum Kwapra Street,Kumasi, Ghana
                                                </small>
                                                
                                                <small class="text-muted mb-0 fs-xs">
                                                <b>Tel:</b> +233 (0) 559184881
                                                </small>
                                                <!-- barcode demo only -->
                                                <div  class="float-right">
                                                    <img src="assets/img/3f3logo.png" class="img img-responsive" alt="">
                                                </div>
                                            </h2>
                                        </div>
                                        <h3 class="fw-300 display-4 fw-500 color-primary-600 keep-print-font pt-4 l-h-n m-0">
                                            INVOICE
                                        </h3>
                                        <div class="text-dark fw-700 h1 mb-g keep-print-font">
                                            # <?php echo $id ?>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-4 d-flex">
                                        <div class="table-responsive">
                                            <table class="table table-clean table-sm align-self-end">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            Issue Date:
                                                        </td>
                                                        <td>
                                                            <?php echo date("Y/m/d") ?>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Currency:
                                                        </td>
                                                        <td>
                                                            Gh₵
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="col-sm-4 ml-sm-auto">
                                        <div class="table-responsive">
                                            <table class="table table-sm table-clean text-right">
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            <strong>Bill to:</strong>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <strong><?php //echo $payment_details[0]['student_company'] ?></strong>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        <?php echo $payment_details[0]['student_phone'] ?>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                        <?php echo $payment_details[0]['student_email'] ?>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Attn: <?php echo $payment_details[0]['student_name'] ?>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-4 ml-sm-auto">
                                        <table class="table table-clean">
                                            <tbody>
                                                <tr>
                                                    <td class="text-left">
                                                        <strong>Subtotal</strong>
                                                    </td>
                                                    <td class="text-right">₵<?php echo $payment_details[0]['amount'] ?></td>
                                                </tr>
                                                <tr class="table-scale-border-top border-left-0 border-right-0 border-bottom-0">
                                                    <td class="text-left keep-print-font">
                                                        <h4 class="m-0 fw-700 h2 keep-print-font color-primary-700">Total</h4>
                                                    </td>
                                                    <td class="text-right keep-print-font">
                                                        <h4 class="m-0 fw-700 h2 keep-print-font">₵<?php echo $payment_details[0]['amount'] ?></h4>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="text-left">
                                                        <strong>Paid</strong>
                                                    </td>
                                                    <td class="text-right">
                                                        <strong>$<?php echo $payment_details[0]['amount'] ?></strong>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="text-left keep-print-font">
                                                        <h4 class="m-0 fw-700 h2 keep-print-font color-primary-700">Amount Due</h4>
                                                    </td>
                                                    <td class="text-right keep-print-font">
                                                        <h4 class="m-0 fw-700 h2 keep-print-font text-danger">₵<?php echo floatval($payment_details[0]['amount'])-floatval($payment_details[0]['amount']) ?></h4>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <center><button id="print" class="btn btn-primary d-print-none">Print</button></center>
                        <?php endif ?>

                    </main>
                    <!-- END Page Content -->
                    <!-- this overlay is activated only when mobile menu is triggered -->
<div class="page-content-overlay" data-action="toggle" data-class="mobile-nav-on"></div>
<!-- BEGIN Page Footer -->
<?php include 'inc/footer_inc.php' ?>
<!-- END Page Footer -->
<!-- BEGIN Shortcuts -->
<!-- modal shortcut -->
<?php //include 'inc/header_menu.php'; ?>
 <!-- END Shortcuts -->
                </div>
            </div>
        </div>
        
<!-- END Quick Menu -->
<!-- BEGIN Page Settings -->
 <!-- END Page Settings -->
<?php include 'inc/script_inc.php' ?>
        <script src="assets/js/datagrid/datatables/datatables.bundle.js"></script>
        <script>
            $(document).ready(function()
            {
                // Event Lot
                var events = $("#app-eventlog");

                $('#print').click(function(){
                    window.print();
                })
                
            });
            
        </script>
<!-- Modal Large -->
    </body>

</html>
