<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\time\TimePicker;
use kartik\datetime\DateTimePicker;
use kartik\date\DatePicker;
use kartik\select2\Select2;
use kartik\typeahead\TypeaheadBasic;
use kartik\typeahead\Typeahead;
use yii\imagine\Image;
use yii\bootstrap4\Modal;
//data from other models
Use backend\models\Attributesvalues; //drop down options
use modules\custom\models\Accounts;  //client accounts
use modules\users\models\User;

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

//select2 user Query
$users = \frontend\models\User::EmployeesU();
$type = Attributesvalues::formArray('imgtype');
$wear = Attributesvalues::formArray('wear');
$milemeters = Attributesvalues::formArray('milemeters');
$yardschain = Attributesvalues::formArray('yardschain');
$dt125defecttype = Attributesvalues::formarray('dt125defecttype');
$preheattemp = Attributesvalues::formarray('preheattemp');
$dt125contype = Attributesvalues::formarray('dt125contype');
$dt125condiameter = Attributesvalues::formarray('dt125condiameter');
$yesno = Attributesvalues::formArray('yesno');
$dt125preheater = Attributesvalues::formArray('dt125preheater');
$dt125generator = Attributesvalues::formArray('dt125generator');
$dt125wfu = Attributesvalues::formArray('dt125wfu');
$passfail = Attributesvalues::formArray('passfail');

$model->stampno = Yii::$app->user->identity->stampno;

$time = new \DateTime('now');
$today = $time->format('d/m/Y');

	
$this->registerJsFile('/js/touch.js'); //load drawing canvas?
$this->registerJsFile('/js/touch_1.js'); //load drawing canvas?
$this->registerJsFile('/js/touch_2.js'); //load drawing canvas?

$this->registerJsFile('/js/update179.js');

?>

<?php $form = ActiveForm::begin([]); ?>
<table>
    <tr>
        <td colspan="2"><img src="/images/logo.jpg" alt="inline"></td>
        <td colspan="8" class="Title">Welders Work Return - Crossing Repair/Maintenance: TEF/3009/V3 June 2008</td>
    </tr>
</table>
<table class="Table">
    <tr>
        <td class="DarkerBlue" width="10%">Sheet</td>
        <td width="16.67%"><?= $form->field($model, 'sheet')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td width="10%" class="DarkerBlue">Area</td>
        <td width="16.67%"><?= $form->field($model, 'area')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td width="10%" class="DarkerBlue">Week No</td>
        <td width="16.67%"><?= $form->field($model, 'weekno')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td width="10%" class="DarkerBlue">Job Cost No.</td>
        <td width="16.67%"><?= $form->field($model, 'jobcostno')->textInput(['maxlength' => 100]) ->label(false)?></td>
    </tr>

    <tr>
        <td class="DarkerBlue">From</td>
        <td><?= $form->field($model, '_from')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td class="DarkerBlue">TME/TSM</td>
        <td><?= $form->field($model, 'tmetsm')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td class="DarkerBlue">Date</td>
        <td><?=DatePicker::widget(['model' => $model, 'attribute' => 'date', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);?>
        </td>
        <td class="DarkerBlue">Ellipse No.</td>
        <td><?= $form->field($model, 'ellipseno')->textInput(['maxlength' => 100]) ->label(false)?></td>
    </tr>

    <tr>
        <td class="DarkerBlue">Tel No</td>
        <td><?= $form->field($model, 'telno')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td class="DarkerBlue">
            <table>
                <tr>
                    <td rowspan="2">Welder Name<br><br>Stamp No</td>
                </tr>
            </table>
        </td>
        <td class="DarkerBlue">
            <table>
                <tr>
                    <td><?=$form->field($model, 'weldersname')->widget(Select2::class,
['data' => $users,
 'options' => [
 	'placeholder' => 'Select Operatives...', 
 	],
 'pluginOptions' => [
	'tags' => true,
 	'multiple' => true, 
  	'tokenSeparators' => ['; ', ''],
 	],
 	 ])    ->label(false)?></td>
                </tr>
                <tr>
                    <td><?= $form->field($model, 'stampno')->textInput(['maxlength' => 100]) ->label(false)?></td>
                </tr>
            </table>
        </td>


        <td class="DarkerBlue">Welders Signature</td>
        <td>
            <div id="canvas2">
                <canvas id="canvas_2" width="350" height="100"
                    style="border:1pt solid black;margin:auto;cursor:crosshair;clear:both;">
                </canvas>
            </div>
            <?= Html::button('Reset', [ 'class' => 'btn btn-primary', 'onclick' => 'ClearCanvas2();' ]); ?>
            <?= $form->field($model, 'wsignatureloc')->hiddenInput(['id' => 'wsignatureloc']) ->label(false)?>
        </td>
        <td class="DarkerBlue">Inline Job No.</td>
        <td><?= $form->field($model, 'inlineno')->textInput(['maxlength' => 100, 'id' => 'injobno']) ->label(false)?>
        </td>
    </tr>
    <tr>
        <td class="DarkerBlue">Start Time</td>
        <td><?= TimePicker::widget(['model' => $model, 'disabled' => true, 'attribute' => 'starttime', 'pluginOptions' => ['showMeridian' => false, 'defaultTime' => '00:00']]);?>
        </td>
        <td class="DarkerBlue">Travel Time </td>
        <td><?= TimePicker::widget(['model' => $model, 'disabled' => true, 'attribute' => 'starttraveltime', 'pluginOptions' => ['showMeridian' => false, 'defaultTime' => '00:00']]);?>
        </td>
        <td class="DarkerBlue">Finish Time</td>
        <td><?= TimePicker::widget(['model' => $model, 'disabled' => true, 'attribute' => 'finishtime', 'pluginOptions' => ['showMeridian' => false, 'defaultTime' => '00:00']]);?>
        </td>
        <td class="DarkerBlue">Travel Time</td>
        <td><?= TimePicker::widget(['model' => $model, 'disabled' => true, 'attribute' => 'finishtraveltime', 'pluginOptions' => ['showMeridian' => false, 'defaultTime' => '00:00']]);?>
        </td>
    </tr>
    <tr>
        <td class="DarkerBlue">Client</td>
        <td><?= $form->field($model, 'client')->dropDownList(Accounts::getActive(), ['prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td class="DarkerBlue">Site Rep Signature</td>
        <td>
            <div id="canvas1">
                <canvas id="canvas_1" width="350" height="100"
                    style="border:1pt solid black;margin:auto;cursor:crosshair;clear:both;"></canvas>
            </div>
            <?= Html::button('Reset', [ 'class' => 'btn btn-primary', 'onclick' => 'ClearCanvas1();' ]); ?>

        </td>
        <?= $form->field($model, 'signatureloc')->hiddenInput(['id' => 'signatureloc']) ->label(false)?>
        <td class="DarkerBlue">Site Rep Print</td>
        <td><?= $form->field($model, 'siterepprint')->textInput(['maxlength' => 100, 'id' => 'contact' ]) ->label(false)?>
        </td>
        <td class="DarkerBlue"> Site Rep Date</td>
        <td><?=DatePicker::widget(['model' => $model, 'attribute' => 'siterepdate', 'pluginOptions' => [
        'format' => 'dd/m/yyyy',
        'todayHighlight' => true]
        ]);?></td>
    </tr>
</table>
<table class="Table">
    <tr>
        <td class="DarkerBlueC" colspan="5">SITE DETAILS</td>
        <td class="DarkerBlueC" colspan="4">CROSSING DETAILS</td>
    </tr>
    <tr>
        <td class="DarkerBlueC">LOCATION</td>
        <td class="DarkerBlueC">ACCESS</td>
        <td class="DarkerBlueC">ELR</td>
        <td class="DarkerBlueC">TRACK ID</td>
        <td class="DarkerBlueC">MILEAGE</td>
        <td class="DarkerBlueC">POINTS No</td>
        <td class="DarkerBlueC">GRADE</td>
        <td class="DarkerBlueC">TYPE <span class="fa fa-plus btn-attributes float-right" data-value="type"></span></td>
        <td class="DarkerBlueC">DESIGN</td>
        <td class="DarkerBlueC">ANGLE</td>
    </tr>
    <tr>
        <td><?= $form->field($model, 'location')->textInput(['maxlength' => 100, 'id' => 'location' ]) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'access')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'elr')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'trackid')->textInput([]) ->label(false)?></td>
        <td>
            <table class="Table">
                <tr>
                    <td><?= $form->field($model, 'mileage')->textInput(['maxlength' => 100]) ->label(false)?></td>
                    <td><?= $form->field($model, 'mileageb')->dropdownList($milemeters, [ 'prompt' => 'Please Select...'])->label(false) ?>
                    </td>
                    <td><?= $form->field($model, 'mileagec')->textInput(['maxlength' => 100]) ->label(false)?></td>
                    <td><?= $form->field($model, 'mileaged')->dropdownList($yardschain, [ 'prompt' => 'Please Select...'])->label(false) ?>
                    </td>

                </tr>
            </table>
        </td>
        <td><?= $form->field($model, 'pointsno')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'grade')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'type')->dropdownList($type, ['id'=>'type', 'onchange' => 'imgtype()', 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'design')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'angle')->textInput(['maxlength' => 100]) ->label(false)?></td>
    </tr>
</table>
<table class="Table">
    <tr>
        <td class="DarkerBlueC" colspan="6">WELDING REQUIREMENT</td>
        <td class="DarkerBlueC" colspan="6">WELDING DETAILS</td>
    </tr>
    <tr>
        <td class="DarkerBlueC" rowspan="2">REPAIR No.</td>
        <td class="DarkerBlueC" rowspan="2">COMPONENT</td>
        <td class="DarkerBlueC" rowspan="2">DEFECT TYPE <span class="fa fa-plus btn-attributes float-right" data-value="dt125defecttype"></span></td>
        <td class="DarkerBlueC" rowspan="2">LENGTH</td>
        <td class="DarkerBlueC" rowspan="2">WIDTH</td>
        <td class="DarkerBlueC" rowspan="2">DEPTH</td>
        <td class="DarkerBlueC" rowspan="2">DEFECT NO.</td>
        <td class="DarkerBlueC" colspan="2">EXCAVATION</td>
        <td class="DarkerBlueC" rowspan="2">PREHEAT TEMP <span class="fa fa-plus btn-attributes float-right" data-value="preheattemp"></span></td>
        <td class="DarkerBlueC" colspan="2">CONSUMABLE</td>
    </tr>
    <tr>
        <td class="DarkerBlueC">LENGTH</td>
        <td class="DarkerBlueC">DEPTH</td>
        <td class="DarkerBlueC">TYPE <span class="fa fa-plus btn-attributes float-right" data-value="dt125contype"></span></td>
        <td class="DarkerBlueC">DIAMETER <span class="fa fa-plus btn-attributes float-right" data-value="dt125condiameter"></span></td>
    </tr>
    <tr>
        <td class="DarkerBlueC">1</td>
        <td><?= $form->field($model, 'component1')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'defecttype1')->dropDownList($dt125defecttype, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'length1')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'width1')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'depth1')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'defectno1')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'exclength1')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'excdepth1')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'preheattemp1')->dropDownList($preheattemp, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'consumetype1')->dropDownList($dt125contype, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'consumedia1')->dropDownList($dt125condiameter, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
    </tr>
    <tr>
        <td class="DarkerBlueC">2</td>
        <td><?= $form->field($model, 'component2')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'defecttype2')->dropDownList($dt125defecttype, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'length2')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'width2')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'depth2')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'defectno2')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'exclength2')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'excdepth2')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'preheattemp2')->dropDownList($preheattemp, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'consumetype2')->dropDownList($dt125contype, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'consumedia2')->dropDownList($dt125condiameter, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
    </tr>
    <tr>
        <td class="DarkerBlueC">3</td>
        <td><?= $form->field($model, 'component3')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'defecttype3')->dropDownList($dt125defecttype, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'length3')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'width3')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'depth3')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'defectno3')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'exclength3')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'excdepth3')->widget(Typeahead::class, ['options' => ['placeholder' => 'Filter as you type ...'],'pluginOptions' => ['highlight' => true],'dataset' => [['local' => $wear, 'limit' => 10 ]]]) ->label(false);?>
        </td>
        <td><?= $form->field($model, 'preheattemp3')->dropDownList($preheattemp, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'consumetype3')->dropDownList($dt125contype, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'consumedia3')->dropDownList($dt125condiameter, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
    </tr>
</table>
<table class="Table">
    <tr>
        <td class="DarkerBlue" colspan="5">WELDER COMMENTS</td>
        <td class="DarkerBlueC" colspan="3">EQUIPMENT SERIAL Nos</td>
    </tr>
    <tr>
        <td colspan="5"><?= $form->field($model, 'dt125comments')->textarea([]) ->label(false)?></td>
        <td>
            <table class="Table">
                <tr>
                    <td class="LighterBlueC">Weld Completed? <span class="fa fa-plus btn-attributes float-right" data-value="yesno"></span></td>
                    <td class="DarkerBlueC">PRE-HEATER<span class="fa fa-plus btn-attributes float-right" data-value="dt125preheater"></span></td>
                    <td class="DarkerBlueC">GENERATOR <span class="fa fa-plus btn-attributes float-right" data-value="dt125generator"></span></td>
                    <td class="DarkerBlueC">WFU <span class="fa fa-plus btn-attributes float-right" data-value="dt125wfu"></span></td>
                </tr>
                <tr>
                
                    <td><?= $form->field($model, 'weldcompleted')->dropDownList($yesno, [ 'prompt' => 'Please Select...']) ->label(false)?>
                    </td>
                    <td><?= $form->field($model, 'preheater')->dropDownList($dt125preheater, [ 'prompt' => 'Please Select...']) ->label(false)?>
                    </td>
                    <td><?= $form->field($model, 'generator')->dropDownList($dt125generator, [ 'prompt' => 'Please Select...']) ->label(false)?>
                    </td>
                    <td><?= $form->field($model, 'wfu')->dropDownList($dt125wfu, [ 'prompt' => 'Please Select...']) ->label(false)?>
                    </td>
                </tr>
            </table>
        </td>

    </tr>
</table>
<table class="Table">
    <tr>
        <td>Indicate location and extent of repairs</td>
        <td>

            <div hidden="yes">
                <img width="960px" height="125px" src="/images/dt125.jpg" id="image1" alt="dt125">
            </div>
            <div hidden="yes">
                <img width="960px" height="125px" src="/images/dt125.jpg" id="image" alt="dt125">
            </div>
            <div id="drawing">
                <canvas id="canvas" height="125px" width="960px"></canvas>
            </div>
            <?= Html::button('Reset', [ 'class' => 'btn btn-primary', 'onclick' => 'ClearCanvas();' ]); ?>
            <?= $form->field($model, 'drawingloc')->hiddenInput(['id' => 'drawingloc']) ->label(false)?>
        </td>

    </tr>
</table>
<table class="Table">
    <tr>
        <td class="DarkerBlueC" colspan="8">INSPECTION</td>
    </tr>
    <tr>
        <td class="DarkerBlueC">REPAIR</td>
        <td class="DarkerBlueC">DATE INSPECTED</td>
        <td class="DarkerBlueC">INSPECTED BY</td>
        <td class="DarkerBlueC">RESULT <span class="fa fa-plus btn-attributes float-right" data-value="passfail"></span></td>
        <td class="DarkerBlueC">COMMENTS</td>
        <td class="DarkerBlueC">DATABASE No</td>
    </tr>
    <tr>
        <td class="DarkerBlueC">1</td>
        <td><?= $form->field($model, 'dateinspected1')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'inspectedby1')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'result1')->dropDownList($passfail, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'comments1')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'databaseno1')->textInput(['maxlength' => 100]) ->label(false)?></td>

    </tr>
    <tr>
        <td class="DarkerBlueC">2</td>
        <td><?= $form->field($model, 'dateinspected2')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'inspectedby2')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'result2')->dropDownList($passfail, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'comments2')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'databaseno2')->textInput(['maxlength' => 100]) ->label(false)?></td>
    </tr>
    <tr>
        <td class="DarkerBlueC">3</td>
        <td><?= $form->field($model, 'dateinspected3')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'inspectedby3')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'result3')->dropDownList($passfail, [ 'prompt' => 'Please Select...']) ->label(false)?>
        </td>
        <td><?= $form->field($model, 'comments3')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td><?= $form->field($model, 'databaseno3')->textInput(['maxlength' => 100]) ->label(false)?></td>

    </tr>
</table>
<table class="Table">
    <tr>
        <td class="WhiteCenter" colspan="5">OFFICE USE ONLY</td>
        <td rowspan="3" class="DarkerBlueC">THIS RECORD TO BE COMPLETED ON SITE AT THE TIME OF WELDING</td>
    </tr>

    <tr>
        <td class="DarkerBlueC">Input into Arc Welding Database</td>
        <td class="DarkerBlue">By</td>
        <td><?= $form->field($model, 'arcby')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td class="DarkerBlue">Date</td>
        <td><?= $form->field($model, 'arcdate')->textInput(['maxlength' => 100]) ->label(false)?></td>

    </tr>
    <tr>
        <td class="DarkerBlueC">Database References No.s</td>
        <td><?= $form->field($model, 'databasenos')->textInput(['maxlength' => 100]) ->label(false)?></td>
    </tr>
    <tr>
        <td class="DarkerBlueC">Inspection Planned for</td>
        <td class="DarkerBlue">Name</td>
        <td><?= $form->field($model, 'insname')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td class="DarkerBlue">Date</td>
        <td><?= $form->field($model, 'insdate')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td class="DarkerBlueC" rowspan="3">AS A MINIMUM, ONE COPY EACH TO BE GIVEN TO SITE SUPERVISOR AND WELDING
            MANAGER</td>

    </tr>
    <tr>
        <td class="DarkerBlueC">(B) Form No.s (where applicable) </td>
        <td colspan="4"><?= $form->field($model, 'formnos')->textInput(['maxlength' => 100]) ->label(false)?></td>

    </tr>
    <tr>
        <td class="DarkerBlueC">Input into Ellipse</td>
        <td class="DarkerBlue">By</td>
        <td><?= $form->field($model, 'ellipseby')->textInput(['maxlength' => 100]) ->label(false)?></td>
        <td class="DarkerBlue">Date</td>
        <td><?= $form->field($model, 'ellipsedate')->textInput(['maxlength' => 100]) ->label(false)?></td>

    </tr>
</table>

<div align="center">DT125</div>

<div class="form-group">
    <?= Html::submitButton('Save', ['class' => 'btn btn-primary', 'onclick' => 'saveImage9()']) ?>
</div>
<?php ActiveForm::end(); ?>

<?php Modal::begin(['id' => 'modal', 'size' => 'modal-lg' ]);
    echo "<div id='modalContent'></div>";
    Modal::end();
    ?>

<script type="text/javascript">
function saveImage9() {
    $("#drawingloc").val(document.getElementById('canvas').toDataURL());
    $("#signatureloc").val(document.getElementById('canvas_1').toDataURL());
    $("#wsignatureloc").val(document.getElementById('canvas_2').toDataURL());
}
$(function() {
    init();
    init1();
    init2();
}) //Drawing, canvas_1, canvas_2
</script>