<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model modules\forms\models\Dt133 */

$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Dt133s', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="dt133-view">

<?= $this->render('//common/_viewheader', ['title' => 'Incident Report Form DT133:']);?>

<table class="Table">
<tbody>
	<tr>
	<th>Contract / Project:</th>
	<td><?= $model->contract ?></td>
	<td class="notbb">&nbsp;</td>
	<th>IN Ref Number:</th>
	<td><?= $model->refno ?></td>
	</tr>
	<tr>
	<th>Details of person who had accident:</th>
	<td></td>
	<td class="notbb">&nbsp;</td>
	<th colspan="2">Equipment involved in the event (please specify):</th>
	</tr>
	<tr>
	<th>Name:</th>
	<td>
		<?php foreach($model->detailsname as $key => $name){ ?>
			<?= $name ?> <br/>
		<?php } ?>
	</td>
	<td class="notbb">&nbsp;</td>
	<td colspan="2" rowspan="">(Train / OTP / Road Vehicle / Tools / Infrastructure etc)</td>
	</tr>
	<tr>
	<th>Job Title:</th>
	<td><?= $model->detailstitle ?></td>
	<td class="notbb">&nbsp;</td>
	<td colspan="2" rowspan="8"><?= $model->equipment ?></td>
	</tr>
	<tr>
	<th>Mobile No:</th>
	<td><?= $model->detailsmobile ?></td>
	<td class="notbb">&nbsp;</td>
	</tr>
	<tr>
	<th>Business Address</th>
	<td>Ashmill Business Park</td>
	<td class="notbb">&nbsp;</td>
	</tr>
	<tr>
	<td colspan="2">Asford Road, Lenham - Maidstone</td>
	<td class="notbb">&nbsp;</td>

	</tr>
	<tr>
	<td colspan="2">Kent</td>
	<td class="notbb">&nbsp;</td>

	</tr>
	<tr>
	<th>Post Code: ME17 2GQ</th>
	<td>Tel No: 01622 854730</td>
	<td class="notbb">&nbsp;</td>

	</tr>

	<tr>
		<th>Employer</th>
		<td>Inline Track Welding Ltd</td>
		<td class="notbb">&nbsp;</td>


	</tr>
	<tr>
		<th style="text-align: left" height="125px">Signature:<img src="<?= $model->detailssign ?>" ></img></th>
		<td style="text-align: left">Date:<?= $model->detailssigndate ?></td>
		<td class="notbb">&nbsp;</td>
	</tr>
	<tr>
		<th colspan="2">Details of Incident:</th>
		<td class="notbb">&nbsp;</td>
		<th colspan="2">Details of any Witnesses:</th>
	</tr>

	<tr>
		<th>Date of Accident: <?= $model->eventdate ?></th>
		<td>Time of Accident: <?= $model->eventtime ?></td>
		<td class="notbb">&nbsp;</td>

		<td colspan="2" rowspan="6"><?= $model->witnesses ?></td>


	</tr>
	<tr>
		<th>Location of Accident</th>
		<td><?= $model->eventlocation ?></td>
		<td class="notbb">&nbsp;</td>
	</tr>
	<tr>
		<th>Did the accident occur on Network Rail <br/> Controlled Infrastructure</th>
		<td><?= $model->nrcontrolled == 1 ? 'Yes' : 'No' ?></td>
		<td class="notbb">&nbsp;</td>
	</tr>
	<tr>
		<th>ELR:<?= $model->elr ?></th>
		<td>Mileage:<?= $model->mileage ?></td>
		<td class="notbb">&nbsp;</td>
	</tr>
	<tr>
		<th colspan="2">About the Incident (what happened?):</th>
		<td class="notbb">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="2" rowspan="16"><?= $model->about ?></td>
		<td class="notbb">&nbsp;</td>

	</tr>
	<tr>
		<td class="notbb">&nbsp;</td>
		<th colspan="2">Immediate action taken to prevent reoccurrence?</th>
	</tr>

	<tr>
		<td class="notbb">&nbsp;</td>
		<td colspan="2" rowspan="6"></td>
	</tr>
	<tr><td class="notbb">&nbsp;</td></tr>
	<tr><td class="notbb">&nbsp;</td></tr>
	<tr><td class="notbb">&nbsp;</td></tr>
	<tr><td class="notbb">&nbsp;</td></tr>
	<tr><td class="notbb">&nbsp;</td></tr>
	<tr>
		<td class="notbb">&nbsp;</td>
		<th colspan="2">Confirmed by Director/HSEQ Manager:</th>
		<td><?= $model->hseqconfirmed == 1 ? 'Yes' : 'No'  ?></td>

	</tr>
	<tr>
		<td class="notbb">&nbsp;</td>
		<th>Name</th>
		<td><?= $model->confirmedname ?></td>
	</tr>
	<tr>
		<td class="notbb">&nbsp;</td>
		<th>Job Title</th>
		<td><?= $model->confirmedtitle ?></td>
	</tr>
	<tr>
		<td class="notbb">&nbsp;</td>
		<th>Signature:</th>
		<td height="125px"><img src="<?= $model->confirmedsign ?>"> </img></td>
	</tr>
	<tr>
		<td class="notbb">&nbsp;</td>
		<th colspan="2">Accidents Reportable under RIDDOR 95:</th>
	</tr>

	<tr>
		<td class="notbb">&nbsp;</td>
		<th>If a major Incident has the MIA been completed? </th><td><?= $model->riddor95 == 1 ? 'Yes' : 'No' ?></td>
	</tr>
	<tr>
		<td class="notbb">&nbsp;</td>
		<th>Has a F2508 been sent to the HMRI?   </th><td><?= $model->f2508 == 1 ? 'Yes' : 'No' ?></td>
	</tr>
</tbody>
</table>

<table class="Table">
<tbody>

	<tr>
		<th class="DarkerBlue" colspan="5">Investigators / HSEQ Manager Findings (attach Sketches, Photographs, Witness Statements as required).</th>
	</tr>
	<tr>
		<td colspan="5" height="125px"><?= $model->findings ?></td>
	</tr>
	<tr>
		<th class="DarkerBlue" colspan="5">Conclusions</th>
	</tr>
	<tr>
		<td colspan="5" height="125px"><?= $model->conclusions ?></td>
	</tr>
	<tr>
		<th class="DarkerBlue" colspan="5">Immediate Causes</th>
	</tr>
	<tr>
		<td colspan="5" height="125px"><?= $model->immediatecause ?></td>
	</tr>
	<tr>
		<th class="DarkerBlue" colspan="5">Underlying Causes</th>
	</tr>
	<tr>
		<td colspan="5" height="125px"><?= $model->underlyingcause ?>
            </td>
	</tr>
	<tr>
		<th class="DarkerBlue" colspan="5">Remedial Actions</th>
	</tr>
	<tr>
		<td colspan="5" height="125px"><?= $model->remedialactions ?>
            </td>
	</tr>
	<tr>
		<th class="DarkerBlue" colspan="5">Recommendations</th>
	</tr>
	<tr>
		<td colspan="5" height="125px"><?= $model->recommedations ?></td>
	</tr>
	<tr>
		<th class="DarkerBlue">Signed:</th>
		<td colspan="2" height="75px"><img src="<?= $model->lmsigned ?>" ></td>
		<th class="DarkerBlue">Signed:</th>
		<td><img src="<?= $model->hseqsign ?>" ?></td>
	</tr>
	<tr>
		<th class="DarkerBlue">Print Name:</th>
		<td colspan="2"><?= $model->lmname ?><br />(Line Manager/Supervisor)</td>
		<th class="DarkerBlue">Print Name:</th>
		<td><?= $model->hseqprint ?> <br />HSEQ Manager</td>
	</tr>
	<tr>
		<th class="DarkerBlue">Date:</th>
		<td colspan="2"><?= $model->lmdate ?></td>
		<th class="DarkerBlue">Date:</th>
		<td><?= $model->hseqdate ?></td>
	</tr>







</tbody>


</table>
</div>
<?php if (!str_contains(Yii::$app->controller->action->id, 'pdf')){ ?>
	<div class="box ">
		<?= Html::a('Update', ['/forms/dt133/update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
		<?= Html::a('Witness Form', ['/forms/dt132/create', 'masterid' => $model->id, 'actid' => $model->actid, 'location' => $model->eventlocation, 'refno' => $model->refno,'contract' => $model->contract, ], ['class' => 'btn btn-primary', 'target'=>'_blank', ]); ?>
		<?= Html::a('PDF', ['/forms/dt133/pdf', 'id' => $model->id, ], ['class' => 'btn btn-primary', 'target'=>'_blank', ]); ?>
	</div>
<?php } ?>
