<?php
use yii\helpers\Html;

?>
<div class="dt134-form">
    <?= $this->render('//common/_pdfheader.php', ['title' => 'Inline Track Welding Limited Daily Vehicle Record & Defect Report Form (DT134)']) ?>
    <table class="Table notbb norb nolb">
        <tr>
            <th class="DarkerBlueC">Driver</th>
            <td colspan="2"><?= $model->driver ?></td>
            <th class="DarkerBlueC">Vehicle Reg</th>
            <td colspan="2">
                <?= $model->vehiclel ? $model->vehiclel->reg : null ?><br />
                <?= $model->vehiclel ? $model->vehiclel->description : null ?><br />

            </td>
        </tr>
        <tr>
            <th class="DarkerBlueC">Start Mileage</th>
            <td colspan="2"><?= $model->startmileage ?></td>
            <th class="DarkerBlueC">Finish Mileage</th>
            <td colspan="2"><?= $model->finishmileage ?></td>

        </tr>
        <tr>
            <td>
                <p><strong>Damage Key</strong></p>
                <p>D = Dent</p>
                <p>S = Scratch</p>
                <p>Sc = Scuff</p>
                <p>C = Chip</p>
                <p>R = Rust</p>
                <p><?= HTML::IMG('images/fors.png') ?></p>
            </td>
            <td colspan="5" align="center">
                <?= HTML::IMG($model->image, ['alt' => 'no image', 'height' => '250px']) ?></td>
        </tr>
        <tr>
            <th colspan="2" class="DarkerBlueC">Description</th>
            <td class="DarkerBlueC">Answer</td>
            <th colspan="2" class="DarkerBlueC">Description</th>
            <td class="DarkerBlueC">Answer</td>
        </tr>
        <tr>
            <th colspan="2">Good Visability through all cab windows & mirrors</th>
            <td><?= $model->question1 ?></td>
            <th colspan="2">Exhaust secure with no excess noise or smoke</th>
            <td><?= $model->question9 ?></td>
        </tr>
        <tr>
            <th colspan="2">Driver controls, seat and safety belt adjusted correctly</th>
            <td><?= $model->question2 ?></td>
            <th colspan="2">Vehicle access , doors, steps and bodywork in good condition</th>
            <td><?= $model->question10 ?></td>
        </tr>
        <tr>
            <th colspan="2">Windscreen washers, wipers, demister and horn operating correctly</th>
            <td><?= $model->question3 ?></td>
            <th colspan="2">Locking fuel cap in place and not leaking</th>
            <td><?= $model->question11 ?></td>
        </tr>
        <tr>
            <th colspan="2">All instruments, gauges and other warning devices operating (includingABS/EBS in cab warning
                lights)</th>
            <td><?= $model->question4 ?></td>
            <th colspan="2">Engine oil, water, windscreen washer and fuel levels checked and no leaks</th>
            <td><?= $model->question12 ?></td>
        </tr>
        <tr>
            <th colspan="2">Cab clean and tidy</th>
            <td><?= $model->question5 ?></td>
            <th colspan="2">Steering and brakes operating correctly</th>
            <td><?= $model->question13 ?></td>
        </tr>
        <tr>
            <th colspan="2">Vehichle sitting square and not leaning</th>
            <td><?= $model->question6 ?></td>
            <th colspan="2">Load within limits and secured correctly</th>
            <td><?= $model->question14 ?></td>
        </tr>
        <tr>
            <th colspan="2">Number plates clearly visable</th>
            <td><?= $model->question7 ?></td>
            <th colspan="2">ABS/EBS warning lights off</th>
            <td><?= $model->question15 ?></td>
        </tr>
        <tr>

            <th colspan="2">All lights and reflectors fitted and working</th>
            <td><?= $model->question8 ?></td>
            <th colspan="2">All tyres are checked and meet requirements</th>
            <td><?= $model->question16 ?></td>
        </tr>
        <tr>

            <th colspan="2">FORS Badge Clean and readable</th>
            <td><?= $model->question17 ?></td>
            <th colspan="2">&nbsp;</th>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <th width="16.7%" class="DarkerBlueC">Tyre</th>
            <th width="16.7%" class="DarkerBlueC">Offside Front</th>
            <th width="16.7%" class="DarkerBlueC">Nearside Front</th>
            <th width="16.7%" class="DarkerBlueC">Offside Reat</th>
            <th width="16.7%" class="DarkerBlueC">Nearside Rear</th>
            <th width="16.7%" class="DarkerBlueC">Spare</th>
        </tr>
        <tr>
            <style>
            .fail {
                background-color: red;
                color: white;
            }

            .warning {
                background-color: orange;
                color: white;
            }
            </style>
            <th class="DarkerBlueC">Inside Depth</th>
            <td
                <?php if ($model->tyredepthin1 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthin1 >  1.6 && $model->tyredepthin1 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthin1 ?></td>
            <td
                <?php if ($model->tyredepthin2 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthin2 >  1.6 && $model->tyredepthin2 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthin2 ?></td>
            <td
                <?php if ($model->tyredepthin3 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthin3 >  1.6 && $model->tyredepthin3 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthin3 ?></td>
            <td
                <?php if ($model->tyredepthin4 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthin4 >  1.6 && $model->tyredepthin4 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthin4 ?></td>
            <td
                <?php if ($model->tyredepthin5 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthin5 >  1.6 && $model->tyredepthin5 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthin5 ?></td>

        </tr>
        <tr>
            <th class="DarkerBlueC">Outside Depth</th>
            <td
                <?php if ($model->tyredepthout1 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthout1 >  1.6 && $model->tyredepthout1 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthout1 ?></td>
            <td
                <?php if ($model->tyredepthout2 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthout2 >  1.6 && $model->tyredepthout2 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthout2 ?></td>
            <td
                <?php if ($model->tyredepthout3 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthout3 >  1.6 && $model->tyredepthout3 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthout3 ?></td>
            <td
                <?php if ($model->tyredepthout4 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthout4 >  1.6 && $model->tyredepthout4 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthout4 ?></td>
            <td
                <?php if ($model->tyredepthout5 <=  1.6) { echo 'class="fail"';} elseif ($model->tyredepthout5 >  1.6 && $model->tyredepthout5 <=  2.0) {echo 'class="warning"';}else{echo null;} ?>>
                <?= $model->tyredepthout5 ?></td>
        </tr>
        <?php /* ?>
        <tr>
            <th class="DarkerBlueC">Pressure</th>
            <td><?=$model->tyrepressure1 ?></td>
            <td><?=$model->tyrepressure2 ?></td>
            <td><?=$model->tyrepressure3 ?></td>
            <td><?=$model->tyrepressure4 ?></td>
            <td><?=$model->tyrepressure5 ?></td>
        </tr>
        <?php */ ?>
        <tr>
            <th class="DarkerBlue">Corrective Meassures</th>
            <td colspan="5" style="min-height: 200px">
                <?= $model->correctivemeasures ? $model->correctivemeasures : '&nbsp;' ?></td>
        </tr>
        <tr>
            <th class="DarkerBlue">Comments</th>
            <td colspan="5" style="min-height: 200px"> <?= $model->comments ? $model->comments : '&nbsp;' ?></td>
        </tr>
        <tr>
            <td colspan="6">PLEASE REMEMBER You are legally responsible for the vehicle you are driving and you must
                also adhere to company policy with regard to driving. Personal use is forbidden <br />in company
                vehicles. In the event of an accident: Call the On-Call manager<br /> DO NOT admit liability, take all
                3rd party details. Drivers may be held financially liable for damage to vehicles</td>
        </tr>

        <tr>
            <th colspan="3" class="DarkerBlue">Driver 1</th>
            <th colspan="3" class="DarkerBlue">Driver 2</th>
        </tr>
        <tr>
            <td colspan="3"><?= HTML::Img($model->signature1, ['alt' => 'notsigned', 'height'=> '50px']) ?></td>
            <td colspan="3"><?= HTML::Img($model->signature2, ['alt' => 'notsigned', 'height'=> '50px']) ?></td>

        </tr>
    </table>
</div>