<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\date\DatePicker;
use modules\custom\models\Accounts;

$yesno = [0 => 'No', 1 => 'Yes'];
/* @var $this yii\web\View */
/* @var $model modules\forms\models\Dt205 */
/* @var $form yii\widgets\ActiveForm */
$this->registerJsFile('/js/touch_0.js');
$this->registerJsFile('/js/touch_1.js');
$this->registerJsFile('/js/touch_2.js');
$this->registerJsFile('/js/touch_3.js');
$this->registerJsFile('/js/touch_4.js');
$this->registerJsFile('/js/touch_5.js');
$this->registerJsFile('/js/touch_6.js');
//$this->registerJsFile('/js/touch_7.js');
$this->registerJsFile('/js/updatesignatures.js');
	
$model->loadModeldata();

?>
<script>
window.onload = function() {init0(); init1(); init2(); init3();init4();init5();init6();} //Drawing, canvas_1, canvas_2

	

function changeImage(id) {
	
	var dcanvas_0 = document.getElementById('canvas_1');
	var dcanvas_1 = document.getElementById('canvas_2');
	var image_R = document.getElementById('rightimg');
	var image_L = document.getElementById('leftimg');
	
	if (id == 'left' && dcanvas_0 && dcanvas_1) {
			var context_0 = dcanvas_0.getContext('2d');
				context_0.clearRect(0, 0, dcanvas_0.width, dcanvas_0.height);    
				context_0.drawImage(image_L, 0, 0);	
			var context_1 = dcanvas_1.getContext('2d');    
				context_1.clearRect(0, 0, dcanvas_1.width, dcanvas_1.height);    
				context_1.drawImage(image_L, 0, 0);	
		}
	if (id == 'right' && dcanvas_0 && dcanvas_1) {
			var context_0 = dcanvas_0.getContext('2d');    
				context_0.clearRect(0, 0, dcanvas_0.width, dcanvas_0.height);    
           		context_0.drawImage(image_R, 0, 0);	;	
			var context_1 = dcanvas_1.getContext('2d');    
				context_1.clearRect(0, 0, dcanvas_1.width, dcanvas_1.height);    
				context_1.drawImage(image_R, 0, 0);	
		}
	
}
</script>
<div class="d-none">
	
<img src='/images/3042-L1.png' id="leftimg" />
<img src='/images/3042-1.png' id="rightimg" />
</div>

<div class="dt203-form">

    <?php $form = ActiveForm::begin(); ?>
    <table class="table" width="100%">
    	<tbody>
    		
    	<tr>
    		<td>
    			
    		
	<table class="table-responsive table-borderless">
		<tr>
			<th class="DarkerBlue">Switch Direction</th>
			<td colspan="3"><?= $form->field($model, 'direction')->dropdownlist(['left' => 'Left', 'right' => 'Right'], ['prompt' => 'Please Select...', 'onChange' => "changeImage($(this).val());", 'id' => 'direction'])->label(false) ?></td>
			
		</tr>
		<tr>
			<th class="DarkerBlue">Client</th>
			<td colspan="3"><?= $form->field($model, 'client')->dropdownlist(Accounts::getActive(), ['prompt' => 'Please Select...'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Location</th>
			<td colspan="3"><?= $form->field($model, 'location')->textInput()->label(false) ?></td>
			<td>&nbsp;</td>
			<th class="DarkerBlue">ELR</th>
    		<td><?= $form->field($model, 'elr')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" rowspan="2">Line</th>
			<td  colspan="3" rowspan="2"><?= $form->field($model, 'line')->textInput()->label(false) ?></td>
			<td>&nbsp;</td>
			<th class="DarkerBlue">Inspection</th>
			<th class="DarkerBlue"  colspan="2">YES/NO</th>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<th class="DarkerBlue">Visual</th>
			<td colspan="2"><?= $form->field($model, 'inspectionvisual')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<td colspan="5">&nbsp;</td>
			<th class="DarkerBlue">U/T</th>
			<td colspan="2"><?= $form->field($model, 'inspectionut')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue"  colspan="3">Start Mileage</th>
			<th class="DarkerBlue" rowspan="1">Plain line</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue">E.M.A</th>
			<td colspan="2"><?= $form->field($model, 'inspectionema')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr> 
		<tr>
			<td><div style="width:80%; display: inline-block;"><?= $form->field($model, 'startmileagem')->textInput()->label(false) ?></div><div style="width:20%; display: inline-block; padding-left:5px;"> M</div></td>
			<td><div style="width:80%; display: inline-block;"><?= $form->field($model, 'startmileagey')->textInput()->label(false) ?></div><div style="width:20%; display: inline-block; padding-left:5px;"> Y</div></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'plainline')->textInput()->label(false) ?></td>
			
		</tr>	
		<tr>
			<th class="DarkerBlue" colspan="3">Finish Mileage</th>
			
			<th class="DarkerBlue" rowspan="1">S &amp; C</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue" colspan="2">4' Gauge at Toe</th>
			
		</tr>	
		<tr>
			<td><div style="width:80%; display: inline-block;"><?= $form->field($model, 'finishmileagem')->textInput()->label(false) ?></div><div style="width:20%; display: inline-block; padding-left:5px;"> M</div></td>
			<td><div style="width:80%; display: inline-block;"><?= $form->field($model, 'finishmileaged')->textInput()->label(false) ?></div><div style="width:20%; display: inline-block; padding-left:5px;"> Y</div></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'sc')->textInput()->label(false) ?></td>
			<td>&nbsp;</td>
			<th class="DarkerBlue">Before mm</th>
			<td><?= $form->field($model, 'gaugeattoebefore')->textInput()->label(false) ?></td>
		</tr>	
		<tr>
			<td colspan="5">&nbsp;</td>
			<th class="DarkerBlue">After mm</th>
			<td colspan=""><?= $form->field($model, 'gaugeattoeafter')->textInput()->label(false) ?></td>
		</tr>	
		
		<tr>
			<th class="DarkerBlue" colspan="2">Sidewear Reading</th>
			<th class="DarkerBlue" colspan="2">Rail Section</th>
			<th class="DarkerBlue" colspan="3">TGP Tested</th>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="1">L/H</th>
			<td><?= $form->field($model, 'sidewearreadinglh')->textInput()->label(false) ?></td>
			<th class="DarkerBlue" colspan="1">L/H</th>
			<td><?= $form->field($model, 'railsectionlh')->textInput()->label(false) ?></td>
			<th class="DarkerBlue" colspan="1">Pass</th>
			<td colspan="2"><?= $form->field($model, 'tgp8tested')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="1">R/H</th>
			<td><?= $form->field($model, 'sidewearreadingrh')->textInput()->label(false) ?></td>
			<th class="DarkerBlue" colspan="1">R/H</th>
			<td><?= $form->field($model, 'railsectionrh')->textInput()->label(false) ?></td>
			
			<th class="DarkerBlue" colspan="1">Fail</th>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="2">Rail Depth</th>
			<th class="DarkerBlue" colspan="2">Rail Steel</th>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="1">L/H</th>
			<td><?= $form->field($model, 'raildepthlh')->textInput()->label(false) ?></td>
			<th class="DarkerBlue" colspan="1">L/H</th>
			<td><?= $form->field($model, 'railsteellh')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="1">R/H</th>
			<td><?= $form->field($model, 'raildepthrh')->textInput()->label(false) ?></td>
			<th class="DarkerBlue" colspan="1">R/H</th>
			<td><?= $form->field($model, 'railsteelrh')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Site Access</th>
			<td><?= $form->field($model, 'siteaaccess')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Prepatory Work Required</th>
			<td><?= $form->field($model, 'prepwork')->textArea()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Special Requirements</th>
			<td><?= $form->field($model, 'specialreqs')->textArea()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Protection Details</th>
			<td><?= $form->field($model, 'protectiondets')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Possession Time Required.</th>
			<td><?= $form->field($model, 'possessiontimerequired')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Grinding Specification.</th>
			<td><?= $form->field($model, 'grindingspec')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Number of Gangs</th>
			<td><?= $form->field($model, 'numberofgangs')->textInput(['type' => 'number'])->label(false) ?></td>
			<th class="DarkerBlue">S&amp;T Required</th>
			<td><?= $form->field($model, 'strequired')->dropdownList($yesno, ['Prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr class="nolb norb">
			<td colspan="6"></td>
		</tr>
		<tr class="">
			<th class="DarkerBlue" colspan="2">Grinding Supervisory Manager</th>			
		</tr>
		<tr class="">
			<th class="DarkerBlue">Name</th>			
			<td><?= $form->field($model, 'grindingsupervisorname')->textInput()->label(false) ?></td>			
		</tr>
		<tr class="nolb norb">
			<td colspan="6"></td>
		</tr>
		<tr class="">
			<th class="DarkerBlue">Signature</th>			
			<td colspan="3">
				<canvas id="canvas_0" class="canvas"> </canvas>
				<?= HTML::button('RESET', ['onClick' => 'ClearCanvasX(0)', 'class' => 'btn btn-primary']); ?>
				<?= $form->field($model, 'grindingsupervisorsign')->hiddenInput(['id' => 'signature0'])->label(false) ?></td>			
		
			
			<th class="DarkerBlue">Date</th>			
			<td colspan="3"><?= $form->field($model, 'grindingsupervisorsigndate')->widget(DatePicker::class, [
				'options' => ['placeholder' => 'Enter Date ...'], 
				'pluginOptions' => ['autoclose' => true,
				'format' => 'dd/mm/yyyy']
				])->label(false) ; ?></td>			
		</tr>
	</table>
			</td>
   		<td>
   			
   	
    <table class="table table-borderless">
    	<tr>
    		<th class="DarkerBlue" rowspan="2">Point No</th>
    			
    		<td colspan=""><?= $form->field($model, 'pointsno')->textInput(['id' => '',])->label(false) ?></td>
    		<th class="DarkerBlue">Facing</th>
    		<td><?= $form->field($model, 'pointsnofacing')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?>
    			<?= $form->field($model, 'image0')->hiddenInput(['id' => 'signature1', 'class' => null])->label(false) ?>
    		</td>
    		<td rowspan="28">
    			<?= HTML::button('reset', ['onClick' => 'ClearCanvasD(1)', 'class' => 'btn btn-primary']); ?>
    			<br />
    			<canvas id="canvas_1" height="660px" width="240px"></canvas>
    		</td>
    	</tr>
    	<tr>
    		<td rowspan="1">&nbsp;</td>
    		<th class="DarkerBlue">Trailing</th>
    		<td><?= $form->field($model, 'pointsnotrailing')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
    	
    		<td>&nbsp;</td>	
    	</tr>
    	<tr>
    		<th class="DarkerBlue" colspan="4">Components to Be Ground</th>
    	</tr>
    	<tr>
    		<th class="DarkerBlue" colspan="4" height="30px">L/H SwitchBlade</th>
    	</tr>
    		<td colspan="4"><?= $form->field($model, 'lhswitchblade0')->textarea(['rows' => 3])->label(false) ?></td>
    	<tr>
    	</tr>
    	<tr>
    		<th colspan="4" class="DarkerBlue" height="30px">L/H Stock Rail</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'lhstockrail0')->textarea(['rows' => 3])->label(false) ?></td>
    		
    	</tr>
    	<tr>
    		<th colspan="4" class="DarkerBlue" height="30px">L/H Through Rail</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'lhthroughrail0')->textarea(['rows' => 3])->label(false) ?></td>
    	</tr>
    	<tr>
    		<th colspan="4" class="DarkerBlue" height="30px">L/H Belly Rail</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'lhbellyrail0')->textarea(['rows' => 3])->label(false) ?></td>
    	</tr>
    	<tr>
    		<th colspan="4" class="DarkerBlue" height="30px">R/H SwitchBlade</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'rhswitchblade0')->textarea(['rows' => 3])->label(false) ?></td>
    	</tr>
    	<tr>
    		<th colspan="4" class="DarkerBlue" height="30px">R/H Stock Rail</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'rhstockrail0')->textarea(['rows' => 3])->label(false) ?></td>
    	</tr>
    	<tr>
    		<th colspan="4" class="DarkerBlue" height="30px">R/H Through Rail</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'rhthroughrail0')->textarea(['rows' => 3])->label(false) ?></td>
    	</tr>
    	<tr>
    		<th colspan="4" class="DarkerBlue" height="30px">R/H Belly Rail</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'rhbellyrail0')->textarea(['rows' => 3])->label(false) ?></td>
    	</tr>
    	<tr>
    		<th class="DarkerBlue" colspan="4" height="30px">Comments</th>
    	</tr>
    	<tr>
    		<td colspan="4"><?= $form->field($model, 'comments0')->textArea(['rows' => 4])->label(false) ?></td>
    	</tr>
    		
    </table>

 		</td>
    </tr>
    <tr>
 	<td>
 		
 	<table class="table-responsive table-borderless">
		<tr>
			<th class="DarkerBlue">Work Completed</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue">SO53 Compliant</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue">DPI Tested</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue">MPI Tested</th>
		</tr>
		<tr>
			<td><?= $form->field($model, 'workcompleted0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'so53compliant0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'dpitested0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'mpitested0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<th class="DarkerBlue">Switch Lubricated</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue">Switch Operational</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue">UT Tested</th>
			<td>&nbsp;</td>
			<th class="DarkerBlue">TGP8 Tested</th>
		</tr>
		<tr>
			<td><?= $form->field($model, 'switchlubricated0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'switchoperational0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'uttested0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
			<td><?= $form->field($model, 'tgp8tested0')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="7">&nbsp;</td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="7">General Conditions of p-way components (i.e bolts-chair-fastenings)</th>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="7">Comments</th>	
		</tr>
		<tr>
			<td colspan="7"><?= $form->field($model, 'pwaycomments0')->textArea()->label(false) ?></td>
		</tr>
		<tr>
			<td colspan="7">&nbsp;</td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="2">Grinding Supervisory Manager</th>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="">Name</th>
			<td><?= $form->field($model, 'gsmname')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="">Sign</th>
			<td>
			<canvas class="canvas" id="canvas_3"></canvas>
			<?= HTML::Button('Reset', ['onclick' => 'ClearCanvasX(3)' , 'class' => 'btn btn-primary']) ?>
			<?= $form->field($model, 'gsmsign')->hiddenInput(['id' => 'signature3'])->label(false) ?></td>
			<td>&nbsp;</td>
			<th class="DarkerBlue" colspan="">Date</th>
			<td><?= $form->field($model, 'gsmdate')->widget(DatePicker::class, ['options' => ['placeholder' => 'Enter Date ...'], 'pluginOptions' => ['autoclose' => true,
        'convertFormat' => true,
        'format' => 'dd/mm/yyyy']])->label(false) ; ?></td>
			
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td class="nolb norb"></td>
		</tr>
		<tr>
			<th colspan="8" class="DarkerBlue">Comments</th>
		</tr>
		<tr>
			<td colspan="8"><?= $form->field($model, 'gsmcomments')->textArea()->label(false) ?></td>
		</tr>
		<tr>
			<td colspan="8">
				
			</td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="2">FPL Inspection Completed</th>
			<td><?= $form->field($model, 'fplinscompleted')->dropdownlist($yesno, ['prompt'=>'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="">Name</th>
			<td><?= $form->field($model, 'fplname')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="">Sign</th>
			<td colspan="2">
			<?= $form->field($model, 'fplsign')->hiddenInput(['id' => 'signature4'])->label(false) ?>
			<canvas class="canvas" id="canvas_4"></canvas>
			<?= HTML::Button('Reset', ['onclick' => 'ClearCanvasX(4)' , 'class' => 'btn btn-primary']) ?></td>
			<th class="DarkerBlue" colspan="">Date</th>
			<td><?= $form->field($model, 'fpldate')->widget(DatePicker::class, ['options' => ['placeholder' => 'Enter Date ...'], 'pluginOptions' => ['autoclose' => true,
        'convertFormat' => true,
        'format' => 'dd/mm/yyyy']])->label(false) ; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="8"></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="2">053 Inspection Completed</th>
			<td><?= $form->field($model, 'ins053completed')->dropdownlist($yesno, ['prompt'=>'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="">Name</th>
			<td><?= $form->field($model, 'ins053name')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="">Sign</th>
			<td>
			
			<canvas class="canvas" id="canvas_5"></canvas>
			<?= HTML::Button('Reset', ['onclick' => 'ClearCanvasX(5)' , 'class' => 'btn btn-primary']) ?>
			<?= $form->field($model, 'ins053sign')->hiddenInput(['id' => 'signature5'])->label(false) ?></td>
			<td>&nbsp;</td>
			<th class="DarkerBlue" colspan="">Date</th>
			<td><?= $form->field($model, 'ins053date')->widget(DatePicker::class, ['options' => ['placeholder' => 'Enter Date ...'], 'pluginOptions' => ['autoclose' => true,
        'convertFormat' => true,
        'format' => 'dd/mm/yyyy']])->label(false) ; ?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="8"></td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="2">&nbsp;</th>
			<td>
				
			</td>
		</tr>
		<tr>
			<th class="DarkerBlue" colspan="">Sign</th>
			<td>
			<canvas class="canvas" id="canvas_6"></canvas>
			<?= HTML::Button('Reset', ['onclick' => 'ClearCanvasX(6)' , 'class' => 'btn btn-primary']) ?>
			<?= $form->field($model, 'signature')->hiddenInput(['id' => 'signature6'])->label(false) ?></td>
			<td>&nbsp;</td>
			<th class="DarkerBlue" colspan="">Date</th>
			<td><?= $form->field($model, 'signaturedate')->widget(DatePicker::class, ['options' => ['placeholder' => 'Enter Date ...'], 'pluginOptions' => ['autoclose' => true,
        'convertFormat' => true,
        'format' => 'dd/mm/yyyy']])->label(false) ; ?></td>
			<td>&nbsp;</td>
		</tr>
	
	</table>
	</td>
	<td>
		
	<table class="table table-borderless">
		<tr>
			<th class="DarkerBlue" colspan="4">Components Ground</th>
			<td rowspan="14">
    			<canvas id="canvas_2" height="660px" width="240px"></canvas>
    			<?= $form->field($model, 'image1')->hiddenInput(['id' => 'signature2'])->label(false) ?>
    			
    			<?= HTML::button('Reset', ['onClick' => 'ClearCanvasD(2)', 'class' => 'btn btn-primary']); ?>
    		</td>
		</tr>
		<tr>
			<th class="DarkerBlue" rowspan="">L/H Switchblade</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'lhswitchblade1')->textarea(['rows' => 3])->label(false) ?></td>
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cglhsbbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cglhsbafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cglhsbmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cglhsblength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue" >L/H Stock Rail</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'lhstockrail1')->textarea(['rows' => 3])->label(false) ?></td>
	
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cglhsrbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cglhsrafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cglhsrmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cglhsrlength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">L/H Through Rail</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'lhthroughrail1')->textarea(['rows' => 3])->label(false) ?></td>
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cglhtrbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cglhtrafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cglhtrmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cglhtrlength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">L/H Belly Rail</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'lhbellyrail1')->textarea(['rows' => 3])->label(false) ?></td>
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cglhbrbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cglhbrafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cglhbrmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cglhbrlength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">R/H Switchblade</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'rhswitchblade1')->textarea(['rows' => 3])->label(false) ?></td>
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cgrhsbbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cgrhsbafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cgrhsbmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cgrhsblength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">R/H Stock Rail</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'rhstockrail1')->textarea(['rows' => 3])->label(false) ?></td>
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cgrhsrbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cgrhsrafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cgrhsrmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cgrhsrlength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">R/H Through Rail</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'rhthroughrail1')->textarea(['rows' => 3])->label(false) ?></td>
			
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cgrhtrbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cgrhtrafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cgrhtrmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cgrhtrlength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">R/H Belly Rail</th>
			<th class="DarkerBlue" colspan="2">Depth</th>
			<th class="DarkerBlue" rowspan="2">MPI<br />Clear</th>
		</tr>
		<tr>
			<td colspan="1" rowspan="3"><?= $form->field($model, 'rhbellyrail1')->textarea(['rows' => 3])->label(false) ?></td>
			<th class="DarkerBlue">Before</th>
			<td><?= $form->field($model, 'cgrhbrbefore')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">After</th>
			<td><?= $form->field($model, 'cgrhbrafter')->textInput()->label(false) ?></td>
			<td><?= $form->field($model, 'cgrhbrmpi')->dropdownlist($yesno, ['prompt' => 'Please Select'])->label(false) ?></td>
		</tr>
		<tr>
			<th class="DarkerBlue">Length</th>
			<td><?= $form->field($model, 'cgrhbrlength')->textInput()->label(false) ?></td>
		</tr>
		<tr>
			<td colspan="4"></td>
		</tr>
		<tr>
			<th colspan="4" class="DarkerBlue">Comments</th>
		</tr>
		<tr>
			<td colspan="4"><?= $form->field($model, 'cgcomments')->textArea()->label(false) ?></td>
		</tr>
		
	</table>    
	</td>
	</tr>
	</tbody>
	</table>
	
    	
	<div class="form-group">
    	<?= HTML::button('images', ['class' => 'btn btn-primary',  'onClick' => 'saveImages();']); ?>
        <?= Html::submitButton('Save', ['class' => 'btn btn-primary', 'onClick' => 'saveImages();']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
<script>
	function saveImages() {
		$("#signature0").val(document.getElementById("canvas_0").toDataURL());
		$("#signature1").val(document.getElementById("canvas_1").toDataURL());
		$("#signature2").val(document.getElementById("canvas_2").toDataURL());
		$("#signature3").val(document.getElementById("canvas_3").toDataURL());
		$("#signature4").val(document.getElementById("canvas_4").toDataURL());
		$("#signature5").val(document.getElementById("canvas_5").toDataURL());
		$("#signature6").val(document.getElementById("canvas_6").toDataURL());
	}

</script>