<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>RNW Group - Electrical Service Sheet</title>

    <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>

    <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.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($job->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>Service Sheet</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">Engineer Service Sheet Electronic Copy</h4>
                This service sheet identified the status and work note for each engineer's job.
            </td>
        </tr>

        <tr class="information">
            <td colspan="2" style="padding-top:20px;padding-bottom:10px" align="left">
                <?php if($job->clientId == 84): ?>
                    <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); ?>

                    <br/>
                <?php else: ?>
                    <b><?php echo e($building->name); ?></b><br>
                    <?php echo e($building->address1); ?><br>
                    <?php echo e($building->address2); ?><br>
                    <?php echo e($building->town); ?><br>
                    <?php echo e($building->city); ?><br>
                    <?php echo e($building->postcode); ?><br>
                    <?php echo e($building->telephone); ?>

                    <br/>
                <?php endif; ?>
            </td>
            <td colspan="2" style="padding-top:20px;padding-bottom:10px" align="right">
                <?php if($job->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>
                <?php if($job->clientId == 84): ?>
                    0844 357 2233
                <?php else: ?>
                    0844 967 0099
                <?php endif; ?>
                <br/>
            </td>
        </tr>
    </table>

    <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="primary" align="center">
                    <td>Work Type</td>
                    <td>Logged By</td>
                    <td>Client</td>
                    <td>Building</td>
                    <td>Discipline</td>
                    <td>Contractor</td>
                    <td>Engineer</td>
                </tr>
                <tr>
                    <td><?php echo e($job['jobType']); ?></td>
                    <td><?php echo e($logUser); ?></td>
                    <td><?php echo e($client['name']); ?></td>
                    <td><?php echo e($building['name']); ?></td>
                    <td><?php echo e($job['discipline']); ?></td>
                    <td><?php echo e($serviceProvider['name']); ?></td>
                    <td><?php echo e($engineer['name']); ?></td>
                </tr>
            </table>
        </div>
        <div class="together" style="margin:20px 0 0 0;padding:0">
            <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                <tr class="primary" align="center">
                    <td>Sheet No</td>
                    <td>Contract No</td>
                    <td>Job Status</td>
                    <td>Response Time</td>
                    <td>Recall</td>
                    <td>Warranty</td>
                    <td>Compliance</td>
                </tr>
                <tr>
                    <td><?php echo e($job['id']); ?></td>
                    <td><?php echo e($job['clientReference']); ?></td>
                    <td><?php echo e($jobHistory['jobStatus']); ?></td>
                    <td><?php echo e($job['responseTime']?$job['responseTime']:''); ?></td>
                    <td><?php echo e($job['recall']); ?></td>
                    <td><?php echo e($job['warranty']); ?></td>
                    <td><?php echo e($job['compliance']); ?></td>
                </tr>
            </table>
        </div>
        <div class="together" style="margin:20px 0 0 0;padding:0">
            <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                <tr class="primary" align="center">
                    <td>Fault Report</td>
                </tr>
                <tr>
                    <td><?php echo e($job['faultReport']); ?></td>
                </tr>
            </table>
        </div>
        <div class="together" style="margin:20px 0 0 0;padding:0">
            <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                <tr class="primary" align="center">
                    <td>Work Note</td>
                </tr>
                <tr>
                    <td><?php echo e($jobHistory['note']); ?></td>
                </tr>
            </table>
        </div>
        <?php if($job['jobType']=='PPM'): ?>
            <div class="together" style="margin:20px 0 0 0;padding:0">
                <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                    <tr class="primary" align="center">
                        <td>Asset</td>
                        <td>Status</td>
                        <td>Condition</td>
                        <td>Operational</td>
                        <td>Compliant</td>
                        <td>Note</td>
                    </tr>
                    <?php foreach($assetHistory as $anAssetHistory): ?>
                        <tr>
                            <td><?php echo e($anAssetHistory['assetName']); ?></td>
                            <td><?php echo e($anAssetHistory['status']); ?></td>
                            <td><?php echo e($anAssetHistory['condition']); ?></td>
                            <td><?php echo e($anAssetHistory['isOperational']); ?></td>
                            <td><?php echo e($anAssetHistory['isCompliant']); ?></td>
                            <td><?php echo e($anAssetHistory['serviceNote']); ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            </div>
        <?php endif; ?>
        <?php if(sizeof($materials)>0): ?>
            <div class="together" style="margin:20px 0 0 0;padding:0">
                <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                    <tr class="primary" align="center">
                        <td>Material</td>
                        <td>Quantity</td>
                    </tr>
                    <?php foreach($materials as $material): ?>
                        <tr>
                            <td><?php echo e($material['name']); ?></td>
                            <td><?php echo e($material['quantity']); ?></td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            </div>
        <?php endif; ?>
        <div class="together" style="margin:20px 0 0 0;padding:0">
            <table cellpadding="0" cellspacing="0" style="margin:0;padding:0">
                <tr class="primary" align="center">
                    <td>Arrival Time</td>
                    <td>Departure Time</td>
                    <td>Print Name</td>
                    <td>Signature</td>
                </tr>
                <tr>
                    <td><?php echo e(date('d/m/Y H:i', strtotime($jobHistory['checkinTime']))); ?></td>
                    <td><?php echo e(date('d/m/Y H:i', strtotime($jobHistory['checkoutTime']))); ?></td>
                    <td><?php echo e($jobHistory['printName']); ?></td>
                    <td><img src="<?php echo e($serverUrl); ?><?php echo e($jobHistory['signature']); ?>" style="height: 60px;"/></td>
                </tr>
            </table>
        </div>
    </div>

    <br>
    <div class="together">
        <div align="center">
            RNW Group | Willow Park | Wash road | Basildon | SS15 4AZ<br>
            <?php if(!empty($job->clientId) && $job->clientId == 84): ?>
                T: 0844 357 2233 E: mothercare@rnwgroup.com W: www.rnwgroup.com
            <?php else: ?>
                T: 0844 967 0099 E: info@rnwgroup.com
            <?php endif; ?>
        </div>
    </div>
</div>
</body>
</html>