<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>RNW Group - Application Reference <?php echo e($quotation->id); ?></title>

    <?php if(!empty($html)): ?>
        <style>
            /*Used separately form pdf*/
            body {
                background: #595959
            }

            .invoice-box {
                background: #fff;
                border: 1px solid #eee;
                box-shadow: 0 0 10px 6px rgba(0, 0, 0, .15);
            }
        </style>
    <?php endif; ?>

    <style>
        .together {
            page-break-inside: avoid !important;
            padding: 15px 0
        }

        .invoice-box {
            max-width: 800px;
            margin: auto;
            padding: 5px 25px;
            font-size: 12px;
            line-height: 18px;
            font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
            color: #666;
        }

        .invoice-box table {
            width: 100%;
            line-height: inherit;
            border-collapse: collapse;
        }

        .invoice-box table td {
            padding: 3px 10px;
            vertical-align: middle;
        }

        .invoice-box table tr.top table td {
            padding-bottom: 20px;
        }

        .invoice-box table tr.top table td.title {
            font-size: 45px;
            line-height: 45px;
        }

        .invoice-box table tr.information table td {
            padding-bottom: 40px;
        }

        .invoice-box table tr.heading td {
            background: #00b050;
            border-bottom: 1px solid #009145;
            color: #fff
        }

        .invoice-box table tr.primary td {
            background: #70a79a;
            border-bottom: 1px solid #629287;
            color: #fff;
        }

        .invoice-box table tr.details td {
            background: #f7f7f7;
            border-bottom: 1px solid #e6e6e6;
        }

        .invoice-box table tr.danger td {
            background: #c0392b;
            border-bottom: 1px solid #a53127;
            color: #fff
        }

        .invoice-box table tr.warning td {
            background: #FF7F50;
            border-bottom: 1px solid #FF6347;
            color: #fff
        }

        .invoice-box table tr.item td {
            border-bottom: 1px solid #eee;
        }

        .invoice-box table tr.item.last td {
            border-bottom: none;
        }

        .invoice-box table tr.total td:nth-child(2) {
            border-top: 2px solid #eee;
            font-weight: bold;
        }

        /*@media  only screen and (max-width: 600px) {*/
        /*.invoice-box table tr.top table td{*/
        /*width:100%;*/
        /*display:block;*/
        /*text-align:center;*/
        /*}*/

        /*.invoice-box table tr.information table td{*/
        /*width:100%;*/
        /*display:block;*/
        /*text-align:center;*/
        /*}*/
        /*}*/
        .images {
            padding: 10px 0;
            text-align: center;
        }

        .images .image {
            width: 130px;
            height: 130px;
            margin: 20px;
            display: inline-block;
            text-align: center;
            vertical-align: middle;
        }

        .images img {
            max-height: 130px;
            max-width: 130px;
            display: block;
            margin: auto;
            vertical-align: middle;
        }

        label {
            margin: 3px 0;
            font-size: 12px;
            display: block;
            font-weight: bold;
            text-transform: uppercase;
        }

        .review-form {
            margin-top: 20px
        }

        .review-form input,
        .review-form select {
            height: 48px;
        }

        .review-form input,
        .review-form textarea,
        .review-form select {
            width: 100%;
            padding: 15px;
            font-size: 14px;
            box-sizing: border-box;
            margin: 0;
            background: #f7f7f7;
            border: none;
            outline: none;
            display: block;
            -webkit-appearance: none;
        }

        .submit-form {
            background: #348eda;
            border: none;
            color: #fff;
            padding: 10px 20px;
            font-size: 14px;
            outline: none;
            cursor: pointer;
        }

        .first-input-row label {
            margin-top: 12px;
        }

        td b {
            page-break-inside: avoid !important;
            margin: 4px 0 4px 0;
        }

        * {
            overflow: visible !important;
        }

        .quotation-items table {
            table-layout: fixed;
            width: 100%;
        }

        html, body {
            overflow-x: hidden;
        }

        table, img, blockquote {
            page-break-inside: avoid;
        }
    </style>
</head>

<body style='height:50px;overflow:hidden;margin:0;padding:0;'>
<div class="invoice-box">
    <table cellpadding="0" cellspacing="0">
        <tr class="top">
            <td colspan="4">
                <table>
                    <tr>
                        <td class="title">
                            <?php if($quotation->clientId == 84): ?>
                                <img src="<?php echo e(!empty($html) ? url('assets/images/rnw-logo.png') : public_path('assets/images/rnw-logo.png')); ?>"
                                     style="width:100%; max-width:200px;">
                            <?php else: ?>
                                <img src="<?php echo e(!empty($html) ? url('assets/images/logo.png') : public_path('/assets/images/logo.png')); ?>"
                                     style="width:100%; max-width:200px;">
                            <?php endif; ?>
                        </td>

                        <td align="right">
                            <h2>Application</h2>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <tr class="pre-heading">
            <td colspan="4" align="center" style="padding: 20px 5px;border-top: 2px solid;border-bottom: 1px dashed">
                <h4 style="margin: 0 0 10px 0;font-size:22px">Thank you for submitting your Application</h4>
                This is now with our FM team who will check and verify your claims. You will receive a Certificate
                within 10 working days
                identifying the status and value approved for each job within the application.<br>
                You will be required to upload your single line consolidated invoice to the certificate once received.
            </td>
        </tr>

        <tr class="information">
            <td colspan="2" style="padding-top:20px;padding-bottom:10px" align="left">
                <b><?php echo e($serviceProvider->name); ?></b><br>
                <?php echo e($serviceProvider->address1); ?><br>
                <?php echo e($serviceProvider->address2); ?><br>
                <?php echo e($serviceProvider->town); ?><br>
                <?php echo e($serviceProvider->city); ?><br>
                <?php echo e($serviceProvider->postcode); ?><br>
                <?php echo e($serviceProvider->telephone); ?>

            </td>
            <td colspan="2" style="padding-top:20px;padding-bottom:10px" align="right">
                <?php if($quotation->clientId == 84): ?>
                    <b>RNW Facilities Management</b><br>
                <?php else: ?>
                    <b>RNW Holdings Limited</b><br>
                <?php endif; ?>
                Willow Park<br>
                Wash Road<br>
                Basildon<br>
                Essex<br>
                SS15 4AZ<br>
                0844 357 2233
            </td>
        </tr>

        <tr class="heading" align="center">
            <td>Application Number</td>
            <td>Application Date</td>
            <td>Submitted by</td>
            <td>Total Application Value</td>
        </tr>

        <tr class="details" align="center">
            <td><?php echo e($quotation->id); ?></td>
            <td><?php echo e(date('d/m/Y H:i', strtotime($quotation->created_at))); ?></td>
            <td><?php echo e($quotation->creator); ?></td>
            <td><?php echo e(number_format($quotation->oldTotal, 2)); ?></td>
        </tr>

    </table>
    <?php if(!empty($quotation->items) && count($quotation->items)): ?>
        <div class="quotation-items">
            <div class="together" style="margin:20px 0 0 0;padding:0">
                <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                    <tr class="heading" align="center">
                        <td>Job Ref</td>
                        <td>SLA</td>
                        <td>Brand</td>
                        <td>Building</td>
                        <td>Job Type</td>
                        <td>Discipline</td>
                        <td>Date Logged</td>
                        <td>Date Completed</td>
                        <td>Total</td>
                    </tr>
                </table>
            </div>
            <?php foreach($quotation->items as $item): ?>
                <div class="together" style="margin:0;padding:0">
                    <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                        <tr class="details" align="left">
                            <td><?php echo e(!empty($item->job) ? $item->job->id : 'N/A'); ?></td>
                            <td><?php echo e(!empty($item->serviceProviderJob) ? date('d/m/Y H:i', strtotime($item->serviceProviderJob->expectStartTime)) : 'N/A'); ?></td>
                            <td><?php echo e(!empty($item->client) ? $item->client->name : 'N/A'); ?></td>
                            <td><?php echo e(!empty($item->building) ? $item->building->name : 'N/A'); ?></td>
                            <td><?php echo e(!empty($item->job) ? strtoupper($item->job->jobType) : 'N/A'); ?></td>
                            <td><?php echo e(!empty($item->job) ? $item->job->discipline : 'N/A'); ?></td>
                            <td><?php echo e(!empty($item->serviceProviderJob) ? date('d/m/Y H:i', strtotime($item->serviceProviderJob->created_at)) : 'N/A'); ?></td>
                            <td><?php echo e(!empty($item->lastVisit) ? date('d/m/Y H:i', strtotime($item->lastVisit->checkoutTime)) : 'N/A'); ?></td>
                            <td>&pound; <?php echo e(number_format($item->itemTotalPrice, 2)); ?></td>
                        </tr>
                        <?php /*<?php if($item->job->kpiCharge): ?>*/ ?>
                            <?php /*<?php foreach($item->job->kpiCharge as $aKpiCharge): ?>*/ ?>
                            <?php /*<tr class="warning" align="left">*/ ?>
                                <?php /*<td colspan="1">*/ ?>
                                    <?php /*KPI:*/ ?>
                                <?php /*</td>*/ ?>
                                <?php /*<td colspan="7">*/ ?>
                                    <?php /*<?php echo e($aKpiCharge->itemDescription); ?>*/ ?>
                                <?php /*</td>*/ ?>
                                <?php /*<td colspan="1">*/ ?>
                                    <?php /*&pound; <?php echo e($aKpiCharge->itemTotalPrice); ?>*/ ?>
                                <?php /*</td>*/ ?>
                            <?php /*</tr>*/ ?>
                            <?php /*<?php endforeach; ?>*/ ?>
                        <?php /*<?php endif; ?>*/ ?>
                    </table>
                </div>
            <?php endforeach; ?>
        </div>
    <?php endif; ?>
    <h4 align="right" style="margin:10px 0 0 0;padding:0">Total Value: <?php echo e(number_format($quotation->oldTotal, 2)); ?></h4>
    <br>
    <div class="together">
        <div align="center">
            RNW Group | Willow Park | Wash road | Basildon | SS15 4AZ<br>
            <?php if(!empty($quotation->clientId) && $quotation->clientId == 84): ?>
                T: 0844 357 2233 E: mothercare@rnwgroup.com W: www.rnwgroup.com
            <?php else: ?>
                T: 0843 1234 567 E: help@rnwgroup.com
            <?php endif; ?>
        </div>
    </div>
</div>
</body>
</html>