<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\TimePicker;
use yii\imagine\Image;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model modules\forms\models\Dt128 */
/* @var $form yii\widgets\ActiveForm */
//$form = ActiveForm::begin() 

?>

<div class="dt128-view">
    <table class="Table">
        <tr>
            <td colspan="10" rowspan="2"  class="p-0" style="padding:none">
                <?= $this->render('//common/_viewheader', ['title' => 'Non-Conformance Form (DT128)']) ?>
            </td>
            <td colspan="2" class="DarkerBlue">Pad no</td>
        </tr>
        <tr>
            <td colspan="2"><?= $model->padno ?></td>
        </tr>
        <tr>
            <td colspan="2" class='DarkerBlue'>Client</td>
            <td colspan="2"><?= $model->account ? $model->account->account_name : null  ?></td>
            <td colspan="2" class='DarkerBlue'>Inline Job No</td>
            <td colspan="2"><?= $model->injobno ?></td>
        </tr>
        <tr>
            <td colspan="2" class="DarkerBlue">Date</td>
            <td colspan="2"><?= date('d/m/Y H:i', strtotime(str_replace('/', '-',$model->date)))  ?></td>
            <td colspan="2" class="DarkerBlue">Location</td>
            <td colspan="2"><?= $model->location ?></td>
            <td colspan="2" class="DarkerBlue">JCN</td>
            <td colspan="2"><?= $model->jcn ?></td>
        </tr>

        <tr>
            <td colspan="2" class="DarkerBlue">Mileage</td>
            <td colspan="2">
                <?= $model->mileage ." ". $model->mileageb." ".$model->mileagec." ".$model->mileaged ?>
            </td>
            <td colspan="2" class="DarkerBlue">Road</td>
            <td colspan="2"><?= $model->road ?></td>
            <td colspan="2" class="DarkerBlue">Rail</td>
            <td colspan="2" ><?= $model->rail ?></td>
        </tr>

        <tr>
            <td colspan="2" class="DarkerBlue">Welders Name</td>
            <td colspan="2"><?= $model->weldersname ?></td>
            <td colspan="2" class="DarkerBlue">Welders Signature</td>
            <td colspan="2">
                <img height="50px" width="auto" src="<?= $model->wsignatureloc ?>" />
            </td>
        </tr>
        <tr>
            <td colspan="2" class="DarkerBlue">Stamp No</td>
            <td colspan="2"><?= $model->stampno ?></td>
            <td colspan="2" class="DarkerBlue">Print Name</td>
            <td colspan="2"><?= $model->printname ?></td>
        </tr>
        <tr>
            <td colspan="12" style="height:50px" >
                Detail in the following section the reason for the NCR - i.e. the weld does not conform to
                NR/L2/TRK/0032 or NR/L2/TRK/2102 or NR/L2/TRK/0132 due to proximity to another weld, proximity to a bolthole, process
                abnormalities, defects found on inspection before welding or track conditions.
            </td>
        </tr>
        <tr>
            <td colspan="12" class="Title" >NCR DESCRIPTION (full description of non-conformance)</td>
        </tr>
        <tr>
            <td colspan="12"  style="height:150px" ><?= $model->ncrdescription ?></td>
        </tr>
        <tr>
            <td colspan="12" class="Title" >RAIL OR TRACK CONDITIONS UNSUITABLE FOR WELDING</td>
        </tr>
        <tr>
            <td colspan="12" style="height:50px" class="textbox"  >
                As the Client representative, I have been made aware of the Rail / Track conditions where welding is to
                take place that does not conform to NR/L2/TRK/0032 or NR/L2/TRK/2102 or NR/L2/TRK/0132.

                Removal of weld(s) cast may be required.

                I have authorised the welding work knowing that required standards may not be met and I will ensure that
                the weld(s) are clamped.
            </td>
        </tr>
        <tr>
            <td colspan="3" class="DarkerBlue">Client repesentative</td>
            <td colspan="3"><?= $model->ncrclientrep ?></td>
            <td colspan="3" class="DarkerBlue" >Signature</td>
            <td colspan="3"><img height="50px" width="auto" src="<?= $model->signatureloc ?>" /></td>
        </tr>
        <tr>
            <td colspan="12" class="Title">INSPECTION DEFECTS & PROCESS ABNORMALITIES</td>
        </tr>
        <tr>
            <td colspan="12" style="height:50px" >
                As the Client representative, I have been informed by the welder that a weld cast is defective and
                requires minimum actions as detailed in NR/L2/TRK/001/B01 to be applied prior to re-opening the line to
                normal traffic.
            </td>
        </tr>
        <tr>
            <td colspan="3" class="DarkerBlue">Minimum action code applied</td>
            <td colspan="3"><?= $model->actioncode ?></td>
        </tr>
        <tr>
            <td colspan="3" class="DarkerBlue">20mph ESR required</td>
            <td colspan="3"><?= $model->esrrequired ?></td>
        </tr>
        <tr style="Height:20px">
            <td colspan="12" class="DarkerBlue">&nbsp; </td>
        </tr>

        <tr>
            <td colspan="3" class="DarkerBlue">Client repesentative</td>
            <td colspan="3"><?= $model->defclientrep ?></td>
            <td colspan="3" class="DarkerBlue">Signature</td>
            <td colspan="3"><img height="50px" width="auto" src="<?= $model->signature3loc ?>" /></td>
        </tr>
    </table>
    <div align="center">DT128 / <?= $model->id ?> / <?= $model->weldersname ?> </div>
</div>
<style>
.dt128-view td, .dt128-view th{
    padding: 10px 10px;
}
.dt128-view .header{
    border: unset;
}
</style>