<?php

use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model modules\forms\models\Dtgsaf */

$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'DT194', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="dt194-view">
    <?= $this->render('//common/_viewheader', ['title' => 'Site Assessment Form (DT194)']);?>
    <table class="Table">
    <tr>
        <th class="DarkerBlue">Date </th>
        <th class="DarkerBlue">Time </th>
        <th class="DarkerBlue">Day </th>
        <th class="DarkerBlue">Location </th>
        <th class="DarkerBlue">Job Number </th>
    </tr>
    <tr>
        <td ><?= date('d/m/Y', strtotime($model->date))?></td>
        <td ><?= date('l', strtotime($model->date))?></td>
        <td ><?= $model->time?> </td>
        <td ><?= $model->location?></td>
        <td><?= $model->jobno ?></td>
    </tr>
    <tr>
        <th class="DarkerBlue">Assessor Name</td>
        <td class=""><?= $model->assessorname1?></td>
        <th class="DarkerBlue">Assessor Signature</td>
        <td colspan="2">
            <img height="75px" class="canvas" src="<?= $model->assessorsign1 ?>"></img>
        </td>
    </tr>
            <tr>
                <th class="DarkerBlue ">Observations</th>
                <th colspan="2" class="DarkerBlue ">Control Measure</th>
                <th colspan="2" class="DarkerBlue ">Timescale</th>
            </tr>
            <tr>
                <th class="text-center">Hazards & consequences</th>
                <th colspan="2" class="text-center">Immediate & longer-term actions</th>
                <th colspan="2" class="text-center">(immediate, 1 week, etc)</th>
            </tr>
        <tbody>
            <?php $x = 1; ?>
            <?php while($x < count($model->rowstatus)){ ?>
                <?php if($model->rowstatus[$x] == 'Active') { ?>
                    <tr>
                        <td><?= $model->rowobservation[$x] !== null ? $model->rowobservation[$x] : null  ?></td>
                        <td colspan="2"><?= $model->rowcontrolmeasure[$x] !== null ? $model->rowcontrolmeasure[$x] : null  ?></td>
                        <td colspan="2"><?= $model->rowtimescale[$x] !== null ? $model->rowtimescale[$x] : null  ?></td>
                    </tr>
                <?php } ?>
                <?php $x++ ?>
            <?php }?>
            <tr>
                <td colspan="5" class="DarkerBlue">
                    Structure report under the following headings:<br />
                    Introduction including overview of area inspected and activities taken place<br />
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <?= $model->introduction ?>
                </td>
            </tr>
            <tr>
                <td colspan="5" class="DarkerBlue">
                    Executive Summary
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <?= $model->executivesummary ?>
                </td>
            </tr>
            <tr>
                <td colspan="5" class="DarkerBlue">
                    Main findings of the inspection
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <?= $model->findings ?>
                </td>
            </tr>
            <tr>
                <td colspan="5" class="DarkerBlue">
                    Conclusion
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <?= $model->conclusions ?>
                </td>
            </tr>
            <tr>
                <td colspan="" class="DarkerBlue">
                    Assessor Name
                </td>
                <td colspan="">
                    <?= $model->assessorname2?>
                </td>
                <td colspan="" class="DarkerBlue">
                    Assessor Signature
                </td>
                <td colspan="2">
                    <img height="75px " class="canvas" src="<?= $model->assessorsign2 ?>"></img>
                </td>
            </tr>


        </tbody>
    </table>
</div>
<style>
.dt194-view td, .dt194-view th{
    padding: 10px;
}
</style>