<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style type="text/css">
        @page {
            margin: 0px;
        }
        body {
            margin: 0px;
        }
        * {
            font-family: Verdana, Arial, sans-serif;
        }
        a {
            color: #fff;
            text-decoration: none;
        }
        table {
            font-size: x-small;
        }
        tfoot tr td {
            font-weight: bold;
            font-size: x-small;
        }
        .invoice table {
            margin: 15px;
        }
        .invoice table td{
            border: 1px solid #333;
            padding: 5px;
        }
        .invoice h3, .invoice h5 {
            margin-left: 15px;
        }
        .invoice{
            margin:15px;
        }
        .information {
            /*background-color: #FFF;
            color: #333;*/
            background-color: #EA5730;
            color: #FFF;
            font-size: 14px;
        }
        .information pre{
            margin-left: 0px;
        }
        .information .logo {
            margin: 5px;
        }
        .information table, .informations table{
            padding: 10px;
        }
        .informations{
            background-color: #EA5730;
            color: #FFF;
        }
    </style>

</head>
<body>
    <div class="information">
        <table width="100%">
            <tr>
                <td align="left" style="width: 50%;"><h3>{{ $com->name }}</h3></td>
                <td align="right" style="width: 50%;"><h3>Allo Sdn. Bhd</h3></td>
            </tr>
            <tr>
                <td align="left" style="width: 50%;">
<pre>
{{ $com->address }}
{{ $com->postcode }}, {{ $com->city }}, {{ $com->state }}
</pre>
                </td>
                <td align="right" style="width: 50%;">
                    <pre>
                        Cyberview Garden Villas, 
                        Persiaran Multimedia, Cyber 7,
                        63000 Cyberjaya, Malaysia
                    </pre>
                </td>
            </tr>
        </table>
    </div>

    <br/>

    <div class="invoice">
        <h3>Invoice Claim: {{ $month }} / {{ $year}}</h3>
        <h5>Issue Date: {{ date("d/m/Y H:i:s") }}</h5>
        <table width="100%" cellpadding="0" cellpadding="0">
            <thead>
                <tr>
                    <th>#</th>
                    <th>Contract</th>
                    <th>W/O</th>
                    <th>Activation</th>
                    <th>Name</th>
                    <th>Address</th>
                    <th>Package</th>
                    <th>Retail Price</th>
                    <th>Incentives (%)</th>
                    <th>Incentives (RM)</th>
                    <th>Total Claim</th>
                </tr>
            </thead>
            <tbody>
                <?php $i = 0; $total  = 0;?>
                @foreach($final as $key => $c) 
                    <?php $i++; ?> 
                    <tr>
                        <td>{{ $key+1 }}{{ $c['index'] }}</td>
                        <td>{{ $c['contract'] }}</td>
                        <td>{{ $c['wo'] }}</td>
                        <td>{{ $c['activated_dt'] }}</td>
                        <td>{{ $c['name'] }}</td>
                        <td>{{ $c['address'] }}</td>
                        <td>{{ $c['package'] }}</td>
                        <td>{{ $c['retail_price'] }}</td>
                        <td>{{ $c['incentives1']}}</td>
                        <td>{{ $c['incentives2']}}</td>
                        <td>{{ $c['total'] }}</td>
                    </tr>
                @endforeach
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="9"></td>
                    <td align="left">Additional Incentives</td>
                    <td align="left" class="gray">RM {{ $extra }}</td>
                </tr>
                <tr>
                    <td colspan="9"></td>
                    <td align="left">Incentives</td>
                    <td align="left" class="gray">RM {{ $basic_total }}</td>
                </tr>
                <tr>
                    <td colspan="9"></td>
                    <td align="left">Total</td>
                    <td align="left" class="gray">RM {{ $totals }}</td>
                </tr>
            </tfoot>
        </table>

        <table width="100%" cellpadding="0" cellpadding="0" style="margin-top: 80px">
            <tr>
                <th width="33%">Submitted By</th>
                <th width="33%">Verified By</th>
                <th width="33%">Approved By</th>
            </tr>
            <tr>
                <td height="50"></td>
                <td height="50"></td>
                <td height="50"></td>
            </tr>
            <tr>
                <td>Date:</td>
                <td>Date:</td>
                <td>Date:</td>
            </tr>
            <tr>
                <td>Designation:</td>
                <td>Designation:</td>
                <td>Designation:</td>
            </tr>
        </table>
    </div>

    <div class="informations" style="position: absolute; bottom: 0;">
        <table width="100%">
            <tr style="width: 100%;">
                <td align="left" style="width: 100%;">
                    &copy; Allo Sdn Bhd - All rights reserved.
                </td>
                <!-- <td align="right" style="width: 50%;">
                    Company Slogan
                </td> -->
            </tr>

        </table>
    </div>
</body>
</html>