<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap4\Modal;
?>


<table class="Table  notbb">
    <tr>
        <td rowspan="2" width="85%">
            <?= $this->render('//common/_viewheader', ['title' => 'Aluminothermic Welding Installation Form']) ?>
        </td>
        <td class="DarkerBlue">Pad no</td>
        <td class="DarkerBlue">Work ID</td>
        <td class="DarkerBlue">Week No</td>
    </tr>
    <tr>
        <td><?= $model->padno ?></td>
        <td><?= $model->injobno ?></td>
        <td><?= $model->weekno ?></td>
    </tr>
</table>



<table class="Table notbb">
    <tr class="DarkerBlue">
        <td colspan="2">Installation Date</td>
        <td colspan="2">Welders Name</td>
        <td colspan="2">Welders Assistant Name</td>
        <td colspan="4">Welders Signature</td>
    </tr>
    <tr>
        <td colspan="2"><?= date('d/m/Y', strtotime(str_replace('/', '-', $model->installdate))); ?>
        </td>
        <td colspan="2"><?= $model->weldersname ?></td>
        <td colspan="2"><?= $model->weldersassistantname ?></td>
        <td colspan="4">
			<img height="40" width="auto" src="<?= $model->wsignatureloc ?>" />
        </td>
    </tr>
    <tr class="DarkerBlue">
        <td colspan="2">Area</td>
        <td colspan="2">TME/TSM</td>
        <td colspan="2">Worksite Location</td>
        <td colspan="4">Job Cost No.</td>
    </tr>
    <tr>
        <td colspan="2"><?= $model->area ?></td>
        <td colspan="2"><?= $model->tmetsm ?></td>
        <td colspan="2"><?= $model->worksitelocation ?></td>
        <td colspan="4"><?= $model->jobcostno ?></td>
    </tr>
    <tr class="DarkerBlue">
        <td colspan="2">Job Type</td>
        <td>Defect No. Removed</td>
        <td>Start Time</td>
        <td colspan="2">Start Travel Time</td>
        <td colspan="2">Finish Time</td>
        <td colspan="2">Finish Travel Time</td>
    </tr>
    <tr class="">
        <td colspan="2"><?= $model->jobtype ?></td>
        <td><?= $model->defectnoremoved ?></td>
        <td><?= $model->starttime ?></td>
        <td colspan="2"><?= $model->starttraveltime ?></td>
        <td colspan="2"><?= $model->finishtime ?></td>
        <td colspan="2"><?= $model->finishtraveltime ?></td>
    </tr>
    <tr>
        <td colspan="2" class="DarkerBlue">Client</td>
        <td ><?= $model->account ? $model->account->account_name : null ?></td>
        <td class="DarkerBlue">Site Rep Signature</td>
        <td colspan="2"><img height="40px" src="<?= $model->signatureloc ?>" /></td>
        <td colspan="2" class="DarkerBlue">Site Rep Print</td>
        <td colspan="2"><?= $model->siterepprint ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue" rowspan="12" style="text-rotate:90; width:10px;">
            <div class="rotate">Location</div>
        </td>
        <td class="DarkerBluec" >&nbsp;</td>
        <td class="DarkerBlueC" colspan="2">Weld 1</td>
        <td class="DarkerBlueC" colspan="2">Weld 2</td>
        <td class="DarkerBlueC" colspan="2">Weld 3</td>
        <td class="DarkerBlueC" colspan="2">Weld 4</td>
    </tr>
    <tr>
        <td class="DarkerBlue" >Install Date & Time</td>
        <td colspan="2">
            <?php if ($model->installdate1) { echo date('d/m/Y', strtotime(str_replace('/', '-', $model->installdate1)));} if ($model->installtime1) { echo ' '.date('H:i', strtotime($model->installtime1)); } ?>
        </td>
        <td colspan="2">
            <?php if ($model->installdate2) { echo date('d/m/Y', strtotime(str_replace('/', '-', $model->installdate2)));} if ($model->installtime2) { echo ' '.date('H:i', strtotime($model->installtime2)); } ?>
        </td>
        <td colspan="2">
            <?php if ($model->installdate3) { echo date('d/m/Y', strtotime(str_replace('/', '-', $model->installdate3)));} if ($model->installtime3) { echo ' '.date('H:i', strtotime($model->installtime3)); } ?>
        </td>
        <td colspan="2">
            <?php if ($model->installdate4) { echo date('d/m/Y', strtotime(str_replace('/', '-', $model->installdate4)));} if ($model->installtime4) { echo ' '.date('H:i', strtotime($model->installtime4)); } ?>
        </td>
    </tr>
    <tr>
        <td class="DarkerBlue">ELR</td>
        <td colspan="2"><?= $model->elr1 ?></td>
        <td colspan="2"><?= $model->elr2 ?></td>
        <td colspan="2"><?= $model->elr3 ?></td>
        <td colspan="2"><?= $model->elr4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Mileage</td>
        <td colspan="2" width=""><?= $model->mileage1." ".$model->meters1." ".$model->yards1." ". $model->chain1 ?></td>
        <td colspan="2"><?= $model->mileage2." ".$model->meters2." ".$model->yards2." ".$model->chain2 ?></td>
        <td colspan="2"><?= $model->mileage3." ".$model->meters3." ".$model->yards3." ".$model->chain3 ?></td>
        <td colspan="2"><?= $model->mileage4." ".$model->meters4." ".$model->yards4." ".$model->chain4 ?></td>
    </tr>

    <tr>
        <td class="DarkerBlue">Chord Point</td>
        <td colspan="2"><?= $model->chord1 ?></td>
        <td colspan="2"><?= $model->chord2 ?></td>
        <td colspan="2"><?= $model->chord3 ?></td>
        <td colspan="2"><?= $model->chord4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Track ID</td>
        <td colspan="2"><?= $model->trackid1 ?></td>
        <td colspan="2"><?= $model->trackid2 ?></td>
        <td colspan="2"><?= $model->trackid3 ?></td>
        <td colspan="2"><?= $model->trackid4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Back to Low Mileage Rail</td>
        <td class="LighterBlue" colspan="2"><?= $model->btol1 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->btol2 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->btol3 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->btol4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">GPS Cordinates West/East</td>
        <td colspan="2"><?= $model->gps1 ?></td>
        <td colspan="2"><?= $model->gps2 ?></td>
        <td colspan="2"><?= $model->gps3 ?></td>
        <td colspan="2"><?= $model->gps4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Linespeed</td>
        <td colspan="2"><?= $model->linespeed1 ?></td>
        <td colspan="2"><?= $model->linespeed2 ?></td>
        <td colspan="2"><?= $model->linespeed3 ?></td>
        <td colspan="2"><?= $model->linespeed4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Line Location Type</td>
        <td colspan="2"><?= $model->lineloctype1 ?></td>
        <td colspan="2"><?= $model->lineloctype2 ?></td>
        <td colspan="2"><?= $model->lineloctype3 ?></td>
        <td colspan="2"><?= $model->lineloctype4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Sleeper Type</td>
        <td colspan="2"><?= $model->sleepertype1 ?></td>
        <td colspan="2"><?= $model->sleepertype2 ?></td>
        <td colspan="2"><?= $model->sleepertype3 ?></td>
        <td colspan="2"><?= $model->sleepertype4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Consolidated</td>
        <td colspan="2"><?= $model->consolidated1 ?></td>
        <td colspan="2"><?= $model->consolidated2 ?></td>
        <td colspan="2"><?= $model->consolidated3 ?></td>
        <td colspan="2"><?= $model->consolidated4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue" rowspan="5" style="text-rotate:90;">
            <div class="rotate">Rail Details</div>
        </td>
        <td class="DarkerBlue">Rail</td>
        <td width="10%" class="LighterBlue">LH Rail</td>
        <td width="10%" class="LighterBlue">RH Rail</td>
        <td width="10%" class="LighterBlue">LH Rail</td>
        <td width="10%" class="LighterBlue">RH Rail</td>
        <td width="10%" class="LighterBlue">LH Rail</td>
        <td width="10%" class="LighterBlue">RH Rail</td>
        <td width="10%" class="LighterBlue">LH Rail</td>
        <td width="10%" class="LighterBlue">RH Rail</td>
    </tr>
    <tr>
        <td class="DarkerBlue">Manufacturer</td>
        <td><?= $model->manufacturer1 ?></td>
        <td><?= $model->manufacturer2 ?></td>
        <td><?= $model->manufacturer3 ?></td>
        <td><?= $model->manufacturer4 ?></td>
        <td><?= $model->manufacturer5 ?></td>
        <td><?= $model->manufacturer6 ?></td>
        <td><?= $model->manufacturer7 ?></td>
        <td><?= $model->manufacturer8 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Profile</td>
        <td><?= $model->profile1 ?></td>
        <td><?= $model->profile2 ?></td>
        <td><?= $model->profile3 ?></td>
        <td><?= $model->profile4 ?></td>
        <td><?= $model->profile5 ?></td>
        <td><?= $model->profile6 ?></td>
        <td><?= $model->profile7 ?></td>
        <td><?= $model->profile8 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Grade</td>
        <td><?= $model->grade1 ?></td>
        <td><?= $model->grade2 ?></td>
        <td><?= $model->grade3 ?></td>
        <td><?= $model->grade4 ?></td>
        <td><?= $model->grade5 ?></td>
        <td><?= $model->grade6 ?></td>
        <td><?= $model->grade7 ?></td>
        <td><?= $model->grade8 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Wear</td>
        <td><?= $model->wear1 ?></td>
        <td><?= $model->wear2 ?></td>
        <td><?= $model->wear3 ?></td>
        <td><?= $model->wear4 ?></td>
        <td><?= $model->wear5 ?></td>
        <td><?= $model->wear6 ?></td>
        <td><?= $model->wear7 ?></td>
        <td><?= $model->wear8 ?></td>
    </tr>

    <tr>
        <td class="DarkerBlue" rowspan="3" style="text-rotate:90;">
            <div class="rotate"> Rail Prep</div>
        </td>
        <td class="DarkerBlue">Rail Cutting Method</td>
        <td class="LighterBlue" colspan="2"><?= $model->cuttingmethod1 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->cuttingmethod2 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->cuttingmethod3 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->cuttingmethod4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Welding Gap (mm)</td>
        <td colspan="2"><?= $model->wgap1 ?></td>
        <td colspan="2"><?= $model->wgap2 ?></td>
        <td colspan="2"><?= $model->wgap3 ?></td>
        <td colspan="2"><?= $model->wgap4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Alignment Method</td>
        <td colspan="2"><?= $model->alignment1 ?></td>
        <td colspan="2"><?= $model->alignment2 ?></td>
        <td colspan="2"><?= $model->alignment3 ?></td>
        <td colspan="2"><?= $model->alignment4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue" rowspan="8" style="text-rotate:90; width:10px;">
            <div class="rotate">Welding</div>
        </td>
        <td class="DarkerBlue">Rail temperature</td>
        <td colspan="2"><?= $model->railtemp1 ?></td>
        <td colspan="2"><?= $model->railtemp2 ?></td>
        <td colspan="2"><?= $model->railtemp3 ?></td>
        <td colspan="2"><?= $model->railtemp4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Weld type </td>
        <td colspan="2"><?= $model->weldtype1 ?></td>
        <td colspan="2"><?= $model->weldtype2 ?></td>
        <td colspan="2"><?= $model->weldtype3 ?></td>
        <td colspan="2"><?= $model->weldtype4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Mould type</td>
        <td colspan="2"><?= $model->mould1 ?></td>
        <td colspan="2"><?= $model->mould2 ?></td>
        <td colspan="2"><?= $model->mould3 ?></td>
        <td colspan="2"><?= $model->mould4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Fuel gas </td>
        <td class="LighterBlue" colspan="2"><?= $model->fuelgas1 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->fuelgas2 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->fuelgas3 ?></td>
        <td class="LighterBlue" colspan="2"><?= $model->fuelgas4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Gas kit number</td>
        <td colspan="2"><?= $model->gkitno1 ?></td>
        <td colspan="2"><?= $model->gkitno2 ?></td>
        <td colspan="2"><?= $model->gkitno3 ?></td>
        <td colspan="2"><?= $model->gkitno4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Portion batch number</td>
        <td colspan="2"><?= $model->pbno1 ?></td>
        <td colspan="2"><?= $model->pbno2 ?></td>
        <td colspan="2"><?= $model->pbno3 ?></td>
        <td colspan="2"><?= $model->pbno4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Portion number</td>
        <td colspan="2"><?= $model->portionno1 ?></td>
        <td colspan="2"><?= $model->portionno2 ?></td>
        <td colspan="2"><?= $model->portionno3 ?></td>
        <td colspan="2"><?= $model->portionno4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Tapping time</td>
        <td colspan="2"><?= $model->tappingtime1 ?></td>
        <td colspan="2"><?= $model->tappingtime2 ?></td>
        <td colspan="2"><?= $model->tappingtime3 ?></td>
        <td colspan="2"><?= $model->tappingtime4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue" rowspan="3" style="text-rotate:90;">
            <div class="rotate">Tensor</div>
        </td>
        <td class="DarkerBlue">Kit number</td>
        <td colspan="2"><?= $model->kit1no1 ?></td>
        <td colspan="2"><?= $model->kit1no2 ?></td>
        <td colspan="2"><?= $model->kit1no3 ?></td>
        <td colspan="2"><?= $model->kit1no4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Pressure (in PSI) at end of preheat</td>
        <td colspan="2"><?= $model->preheat1 ?></td>
        <td colspan="2"><?= $model->preheat2 ?></td>
        <td colspan="2"><?= $model->preheat3 ?></td>
        <td colspan="2"><?= $model->preheat4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Pressure immediately after shearing</td>
        <td colspan="2"><?= $model->shearing1 ?></td>
        <td colspan="2"><?= $model->shearing2 ?></td>
        <td colspan="2"><?= $model->shearing3 ?></td>
        <td colspan="2"><?= $model->shearing4 ?></td>
    </tr>
    <tr class='DarkerBlue'>
        <td colspan="10" class='h3' align="center">Inspection by the Welder</td>
    </tr>
    <tr>
        <td class="DarkerBlue" rowspan="6" style="text-rotate:90;">
            <div class="rotate"> </div>
        </td>
        <td class='DarkerBlue'></td>
        <td colspan="2" class="LighterBlue">Weld1</td>
        <td colspan="2" class="LighterBlue">Weld2</td>
        <td colspan="2" class="LighterBlue">Weld3</td>
        <td colspan="2" class="LighterBlue">Weld4</td>
    </tr>
    <tr>
        <td class="DarkerBlue">Weld conforms to NR/L2/TRK/0032</td>
        <td colspan="2"><?= $model->conforms1 ?></td>
        <td colspan="2"><?= $model->conforms2 ?></td>
        <td colspan="2"><?= $model->conforms3 ?></td>
        <td colspan="2"><?= $model->conforms4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Weld stamp details</td>
        <td colspan="2"><?= $model->stamp1 ?></td>
        <td colspan="2"><?= $model->stamp2 ?></td>
        <td colspan="2"><?= $model->stamp3 ?></td>
        <td colspan="2"><?= $model->stamp4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Non-conformance report completed</td>

        <td colspan="2"><?= $model->nonconrepc1 ?></td>
        <td colspan="2"><?= $model->nonconrepc2 ?></td>
        <td colspan="2"><?= $model->nonconrepc3 ?></td>
        <td colspan="2"><?= $model->nonconrepc4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Weld clamped </td>
        <td colspan="2"><?= $model->clamped1 ?></td>
        <td colspan="2"><?= $model->clamped2 ?></td>
        <td colspan="2"><?= $model->clamped3 ?></td>
        <td colspan="2"><?= $model->clamped4 ?></td>

    </tr>

    <tr>
        <td class="DarkerBlue">Welders Comments <br> Reasons for Non-Conformance Report</td>
        <td colspan="2"><?= $model->nonconr1 ?></td>
        <td colspan="2"><?= $model->nonconr2 ?></td>
        <td colspan="2"><?= $model->nonconr3 ?></td>
        <td colspan="2"><?= $model->nonconr4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue" rowspan="9" style="text-rotate:90;">
            <div class="rotate">ELLIPSE</div>
        </td>
        <td class="DarkerBlue">Weld Std Job No:</td>
        <td colspan="2"><?= $model->wsjobno1 ?></td>
        <td colspan="2"><?= $model->wsjobno2 ?></td>
        <td colspan="2"><?= $model->wsjobno3 ?></td>
        <td colspan="2"><?= $model->wsjobno4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Weld W/O No: (Office Use Only)</td>
        <td colspan="2"><?= $model->weldwono1 ?></td>
        <td colspan="2"><?= $model->weldwono2 ?></td>
        <td colspan="2"><?= $model->weldwono3 ?></td>
        <td colspan="2"><?= $model->weldwono4 ?></td>

    </tr>
    <tr>
        <td class="DarkerBlue">Weld Inspection Std Job No:</td>
        <td colspan="2"><?= $model->wisstdjobno1 ?></td>
        <td colspan="2"><?= $model->wisstdjobno2 ?></td>
        <td colspan="2"><?= $model->wisstdjobno3 ?></td>
        <td colspan="2"><?= $model->wisstdjobno4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Inspection W/O No: (Office Use Only) </td>
        <td colspan="2"><?= $model->wisstdjobno1 ?></td>
        <td colspan="2"><?= $model->wisstdjobno2 ?></td>
        <td colspan="2"><?= $model->wisstdjobno3 ?></td>
        <td colspan="2"><?= $model->wisstdjobno4 ?></td>

    </tr>
    <tr>
        <td class="DarkerBlue">Protection Type</td>
        <td colspan="2"><?= $model->protectiont1 ?></td>
        <td colspan="2"><?= $model->protectiont2 ?></td>
        <td colspan="2"><?= $model->protectiont3 ?></td>
        <td colspan="2"><?= $model->protectiont4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Protection Method</td>
        <td colspan="2"><?= $model->protectionm1 ?></td>
        <td colspan="2"><?= $model->protectionm2 ?></td>
        <td colspan="2"><?= $model->protectionm3 ?></td>
        <td colspan="2"><?= $model->protectionm4 ?></td>

    </tr>
    <tr>
        <td class="DarkerBlue">Time on Tools(Hrs:Mins) </td>
        <td colspan="2"><?= $model->tools1 ?></td>
        <td colspan="2"><?= $model->tools2 ?></td>
        <td colspan="2"><?= $model->tools3 ?></td>
        <td colspan="2"><?= $model->tools4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue" rowspan="2"> Non-Productive Time (Hrs:Mins) </td>
        <td colspan="2">TVL - Travel</td>
        <td colspan="2">WEA - Weather</td>
        <td colspan="2">SET - Set-Up</td>
        <td colspan="2">EQP - Eqp/Materials</td>
    </tr>
    <tr>
        <td colspan="2"><?= $model->npt1 ?></td>
        <td colspan="2"><?= $model->npt2 ?></td>
        <td colspan="2"><?= $model->npt3 ?></td>
        <td colspan="2"><?= $model->npt4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlueC" colspan="10">Time on Tools + Non-productive time should equal Total Man Hrs </td>
    </tr>
    <tr>
        <td class="DarkerBlue norb notb" rowspan="6" style="text-rotate:90;">
            <div class="rotate"> </div>
        </td>
        <td colspan="9" class="DarkerBlueC">OFFICE USE ONLY</td>
    </tr>
    <tr>
        <td class="DarkerBlue">Input into Aluminothermic Database</td>
        <td class="LighterBlue" colspan="2">By</td>
        <td colspan="2" colspan="2"><?= $model->dbname ?></td>
        <td class="LighterBlue" colspan="2">Date</td>
        <td colspan="2"><?= $model->dbdate ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Database reference numbers</td>
        <td colspan="2"><?= $model->dbref1 ?></td>
        <td colspan="2"><?= $model->dbref2 ?></td>
        <td colspan="2"><?= $model->dbref3 ?></td>
        <td colspan="2"><?= $model->dbref4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Inspection planned for</td>
        <td colspan="2" class="LighterBlue">Name</td>
        <td colspan="2"><?= $model->insname ?></td>
        <td colspan="2" class="LighterBlue">Date</td>
        <td colspan="2"><?= $model->insdate ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">(B) Form Numbers (Where applicable)</td>
        <td colspan="2"><?= $model->formno1 ?></td>
        <td colspan="2"><?= $model->formno2 ?></td>
        <td colspan="2"><?= $model->formno3 ?></td>
        <td colspan="2"><?= $model->formno4 ?></td>
    </tr>
    <tr>
        <td class="DarkerBlue">Input into Ellipse</td>
        <td colspan="2" class="LighterBlue">By</td>
        <td colspan="2"><?= $model->ellipseby ?></td>
        <td colspan="2" class="LighterBlue">Date</td>
        <td colspan="2"><?= $model->ellipsedate ?></td>
    </tr>
</table>
	<div align="center">DT123/<?= $model->id ?></div>
</div>