<?php

namespace modules\forms\models;

use Yii;
use Yii\base\Model;
use modules\activities\models\Activities;
use modules\users\models\User;
use modules\custom\models\Accounts;
use frontend\models\Settings;


/**
 * This is the model class For table "dt126".
 *
 * @property integer $id
 * @property string $insdate
 * @property string $weldersname
 * @property string $weldersasstname
 * @property string $inlinejobcostno
 * @property string $area
 * @property string $worksitelocation
 * @property string $starttime
 * @property string $finishtime
 * @property string $client
 * @property string $processused
 * @property string $timetosite
 * @property string $timefromsite
 * @property string $location
 * @property string $gps
 * @property string $elr
 * @property string $trackid
 * @property string $mileage
 * @property string $pointsno
 * @property string $switch
 * @property string $facetrail
 * @property string $railsec
 * @property string $railgrade
 * @property string $damlength
 * @property string $frontstepno
 * @property string $frontangle
 * @property string $frontlength
 * @property string $behindangle
 * @property string $behindlength
 * @property string $repairangle
 * @property string $repairlength
 * @property string $VDIIToe
 * @property string $VDII1
 * @property string $VDII2
 * @property string $VDII3
 * @property string $VDII4
 * @property string $VDII5
 * @property string $VDII6
 * @property string $VDII7
 * @property string $VDII8
 * @property string $VDII9
 * @property string $VDII10
 * @property string $VDII11
 * @property string $VDII12
 * @property string $VDII13
 * @property string $VDII14
 * @property string $VDIIInsby
 * @property string $VDPREWIToe
 * @property string $VDPREWI1
 * @property string $VDPREWI2
 * @property string $VDPREWI3
 * @property string $VDPREWI4
 * @property string $VDPREWI5
 * @property string $VDPREWI6
 * @property string $VDPREWI7
 * @property string $VDPREWI8
 * @property string $VDPREWI9
 * @property string $VDPREWI10
 * @property string $VDPREWI11
 * @property string $VDPREWI12
 * @property string $VDPREWI13
 * @property string $VDPREWI14
 * @property string $VDPREWIInsby
 * @property string $VDPOSTWIToe
 * @property string $VDPOSTWI1
 * @property string $VDPOSTWI2
 * @property string $VDPOSTWI3
 * @property string $VDPOSTWI4
 * @property string $VDPOSTWI5
 * @property string $VDPOSTWI6
 * @property string $VDPOSTWI7
 * @property string $VDPOSTWI8
 * @property string $VDPOSTWI9
 * @property string $VDPOSTWI10
 * @property string $VDPOSTWI11
 * @property string $VDPOSTWI12
 * @property string $VDPOSTWI13
 * @property string $VDPOSTWI14
 * @property string $VDPOSTWIInsby
 * @property string $VDFUPIToe
 * @property string $VDFUPI1
 * @property string $VDFUPI2
 * @property string $VDFUPI3
 * @property string $VDFUPI4
 * @property string $VDFUPI5
 * @property string $VDFUPI6
 * @property string $VDFUPI7
 * @property string $VDFUPI8
 * @property string $VDFUPI9
 * @property string $VDFUPI10
 * @property string $VDFUPI11
 * @property string $VDFUPI12
 * @property string $VDFUPI13
 * @property string $VDFUPI14
 * @property string $VDFUPIInsby
 * @property string $SWIIToe
 * @property string $SWII1
 * @property string $SWII2
 * @property string $SWII3
 * @property string $SWII4
 * @property string $SWII5
 * @property string $SWII6
 * @property string $SWII7
 * @property string $SWII8
 * @property string $SWII9
 * @property string $SWII10
 * @property string $SWII11
 * @property string $SWII12
 * @property string $SWII13
 * @property string $SWII14
 * @property string $SWIIInsby
 * @property string $SWPREWIToe
 * @property string $SWPREWI1
 * @property string $SWPREWI2
 * @property string $SWPREWI3
 * @property string $SWPREWI4
 * @property string $SWPREWI5
 * @property string $SWPREWI6
 * @property string $SWPREWI7
 * @property string $SWPREWI8
 * @property string $SWPREWI9
 * @property string $SWPREWI10
 * @property string $SWPREWI11
 * @property string $SWPREWI12
 * @property string $SWPREWI13
 * @property string $SWPREWI14
 * @property string $SWPREWIInsby
 * @property string $SWPOSTWIToe
 * @property string $SWPOSTWI1
 * @property string $SWPOSTWI2
 * @property string $SWPOSTWI3
 * @property string $SWPOSTWI4
 * @property string $SWPOSTWI5
 * @property string $SWPOSTWI6
 * @property string $SWPOSTWI7
 * @property string $SWPOSTWI8
 * @property string $SWPOSTWI9
 * @property string $SWPOSTWI10
 * @property string $SWPOSTWI11
 * @property string $SWPOSTWI12
 * @property string $SWPOSTWI13
 * @property string $SWPOSTWI14
 * @property string $SWPOSTWIInsby
 * @property string $SWFUPIToe
 * @property string $SWFUPI1
 * @property string $SWFUPI2
 * @property string $SWFUPI3
 * @property string $SWFUPI4
 * @property string $SWFUPI5
 * @property string $SWFUPI6
 * @property string $SWFUPI7
 * @property string $SWFUPI8
 * @property string $SWFUPI9
 * @property string $SWFUPI10
 * @property string $SWFUPI11
 * @property string $SWFUPI12
 * @property string $SWFUPI13
 * @property string $SWFUPI14
 * @property string $SWFUPIInsby
 * @property string $Type1
 * @property string $Design1
 * @property string $Angle1
 * @property string $Component1
 * @property string $DefectNo1
 * @property string $RepairType1
 * @property string $Length1
 * @property string $Depth1
 * @property string $PreheatTemp1
 * @property string $conType1
 * @property string $conSize1
 * @property string $Type2
 * @property string $Design2
 * @property string $Angle2
 * @property string $Component2
 * @property string $DefectNo2
 * @property string $RepairType2
 * @property string $Length2
 * @property string $Depth2
 * @property string $PreheatTemp2
 * @property string $conType2
 * @property string $conSize2
 * @property string $Type3
 * @property string $Design3
 * @property string $Angle3
 * @property string $Component3
 * @property string $DefectNo3
 * @property string $RepairType3
 * @property string $Length3
 * @property string $Depth3
 * @property string $PreheatTemp3
 * @property string $conType3
 * @property string $conSize3
 * @property string $welderscomments
 * @property string $preheater
 * @property string $generator
 * @property string $wfu
 * @property string $insdateins1
 * @property string $inspectedby1
 * @property string $insresult1
 * @property string $inscomments1
 * @property string $insdbno1
 * @property string $insdateins2
 * @property string $inspectedby2
 * @property string $insresult2
 * @property string $inscomments2
 * @property string $insdbno2
 * @property string $insdateins3
 * @property string $inspectedby3
 * @property string $insresult3
 * @property string $inscomments3
 * @property string $insdbno3
 * @property string $postwelddim
 * @property string $checked053
 * @property string $fplchecks
 * @property string $name053
 * @property string $date053
 * @property string $namefpl
 * @property string $datefpl
 * @property string $clientrepname
 * @property string $comments
 * @property string $clientrepsignature
 */
class Dt126 extends Model {

    public $id;
    public $insdate;
    public $weldersname;
    public $weldersasstname;
    public $inlinejobcostno;
    public $area;
    public $worksitelocation;
    public $starttime;
    public $finishtime;
    public $client;
    public $processused;
    public $timetosite;
    public $timefromsite;
    public $location;
    public $gps;
    public $elr;
    public $trackid;
    public $mileage;
    public $pointsno;
    public $switch;
    public $facetrail;
    public $railsec;
    public $railgrade;
    public $damlength;
    public $frontstepno;
    public $frontangle;
    public $frontlength;
    public $behindangle;
    public $behindlength;
    public $repairangle;
    public $repairlength;
    public $vdiitoe;
    public $vdii1;
    public $vdii2;
    public $vdii3;
    public $vdii4;
    public $vdii5;
    public $vdii6;
    public $vdii7;
    public $vdii8;
    public $vdii9;
    public $vdii10;
    public $vdii11;
    public $vdii12;
    public $vdii13;
    public $vdii14;
    public $vdiiinsby;
    public $vdprewitoe;
    public $vdprewi1;
    public $vdprewi2;
    public $vdprewi3;
    public $vdprewi4;
    public $vdprewi5;
    public $vdprewi6;
    public $vdprewi7;
    public $vdprewi8;
    public $vdprewi9;
    public $vdprewi10;
    public $vdprewi11;
    public $vdprewi12;
    public $vdprewi13;
    public $vdprewi14;
    public $vdprewiinsby;
    public $vdpostwitoe;
    public $vdpostwi1;
    public $vdpostwi2;
    public $vdpostwi3;
    public $vdpostwi4;
    public $vdpostwi5;
    public $vdpostwi6;
    public $vdpostwi7;
    public $vdpostwi8;
    public $vdpostwi9;
    public $vdpostwi10;
    public $vdpostwi11;
    public $vdpostwi12;
    public $vdpostwi13;
    public $vdpostwi14;
    public $vdpostwiinsby;
    public $vdfupitoe;
    public $vdfupi1;
    public $vdfupi2;
    public $vdfupi3;
    public $vdfupi4;
    public $vdfupi5;
    public $vdfupi6;
    public $vdfupi7;
    public $vdfupi8;
    public $vdfupi9;
    public $vdfupi10;
    public $vdfupi11;
    public $vdfupi12;
    public $vdfupi13;
    public $vdfupi14;
    public $vdfupiinsby;
    public $swiitoe;
    public $swii1;
    public $swii2;
    public $swii3;
    public $swii4;
    public $swii5;
    public $swii6;
    public $swii7;
    public $swii8;
    public $swii9;
    public $swii10;
    public $swii11;
    public $swii12;
    public $swii13;
    public $swii14;
    public $swiiinsby;
    public $swprewitoe;
    public $swprewi1;
    public $swprewi2;
    public $swprewi3;
    public $swprewi4;
    public $swprewi5;
    public $swprewi6;
    public $swprewi7;
    public $swprewi8;
    public $swprewi9;
    public $swprewi10;
    public $swprewi11;
    public $swprewi12;
    public $swprewi13;
    public $swprewi14;
    public $swprewiinsby;
    public $swpostwitoe;
    public $swpostwi1;
    public $swpostwi2;
    public $swpostwi3;
    public $swpostwi4;
    public $swpostwi5;
    public $swpostwi6;
    public $swpostwi7;
    public $swpostwi8;
    public $swpostwi9;
    public $swpostwi10;
    public $swpostwi11;
    public $swpostwi12;
    public $swpostwi13;
    public $swpostwi14;
    public $swpostwiinsby;
    public $swfupitoe;
    public $swfupi1;
    public $swfupi2;
    public $swfupi3;
    public $swfupi4;
    public $swfupi5;
    public $swfupi6;
    public $swfupi7;
    public $swfupi8;
    public $swfupi9;
    public $swfupi10;
    public $swfupi11;
    public $swfupi12;
    public $swfupi13;
    public $swfupi14;
    public $swfupiinsby;
    public $type1;
    public $design1;
    public $angle1;
    public $component1;
    public $defectno1;
    public $repairtype1;
    public $length1;
    public $depth1;
    public $preheattemp1;
    public $contype1;
    public $consize1;
    public $type2;
    public $design2;
    public $angle2;
    public $component2;
    public $defectno2;
    public $repairtype2;
    public $length2;
    public $depth2;
    public $preheattemp2;
    public $contype2;
    public $consize2;
    public $type3;
    public $design3;
    public $angle3;
    public $component3;
    public $defectno3;
    public $repairtype3;
    public $length3;
    public $depth3;
    public $preheattemp3;
    public $contype3;
    public $consize3;
    public $welderscomments;
    public $preheater;
    public $generator;
    public $wfu;
    public $insdateins1;
    public $inspectedby1;
    public $insresult1;
    public $inscomments1;
    public $insdbno1;
    public $insdateins2;
    public $inspectedby2;
    public $insresult2;
    public $inscomments2;
    public $insdbno2;
    public $insdateins3;
    public $inspectedby3;
    public $insresult3;
    public $inscomments3;
    public $insdbno3;
    public $postwelddim;
    public $checked053;
    public $fplchecks;
    public $name053;
    public $date053;
    public $namefpl;
    public $datefpl;
    public $clientrepname;
    public $comments;
    public $clientrepsignature;
    public $created_at;
    public $created_by;
    public $updated_at;
    public $updated_by;
    public $deleted_at;
    public $deleted_by;
    public $created_by2;
    public $updated_by2;
    public $padno;
    public $jobno;
 
    public $actid;
    public $relatedid;
    public $drawingloc;
    public $signatureloc;
    public $weekno;
    public $tracktrolley;
    public $mileageb;
    public $mileagec;
    public $mileaged;
    public $advinssign1;
    public $advinssign2;
    public $advinssign3;
    public $advinssign4;
    public $snag1;
    public $snag2;
    public $snag3;
    public $snag4;
    public $snag1id;
    public $snag2id;
    public $snag3id;
    public $snag4id;
    public $deleted;

    public $dates = ['created_at', 'updated_at', 'deleted_at'];
	public $uniqueidentifiers = ['actid'];
    public $securefields = [];

    


    public $printlayout = 'Portrait';
    public $form = 'DT126';
    public $formType = 'Arc';
    public $formname = 'Electric Welding Switch Repair & Timesheet Form (DT126)';
    

    
    public $createpath = '/forms/dt126/create';
    public $formLayout = '/dt126/_form.php';
    public $viewLayout = '@modules/forms/views/dt126/_view.php';/**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['inlinejobcostno', 'area', 'worksitelocation', 'client', 'processused', 'location', 'gps', 'elr', 'trackid', 'mileage', 'mileageb', 'mileagec', 'mileaged', 'pointsno', 'switch', 'facetrail', 'railsec', 'railgrade', 'damlength', 'frontstepno', 'frontangle', 'frontlength', 'behindangle', 'behindlength', 'repairangle', 'repairlength', 'vdiitoe', 'vdii1', 'vdii2', 'vdii3', 'vdii4', 'vdii5', 'vdii6', 'vdii7', 'vdii8', 'vdii9', 'vdii10', 'vdii11', 'vdii12', 'vdii13', 'vdii14', 'vdiiinsby', 'vdprewitoe', 'vdprewi1', 'vdprewi2', 'vdprewi3', 'vdprewi4', 'vdprewi5', 'vdprewi6', 'vdprewi7', 'vdprewi8', 'vdprewi9', 'vdprewi10', 'vdprewi11', 'vdprewi12', 'vdprewi13', 'vdprewi14', 'vdprewiinsby', 'vdpostwitoe', 'vdpostwi1', 'vdpostwi2', 'vdpostwi3', 'vdpostwi4', 'vdpostwi5', 'vdpostwi6', 'vdpostwi7', 'vdpostwi8', 'vdpostwi9', 'vdpostwi10', 'vdpostwi11', 'vdpostwi12', 'vdpostwi13', 'vdpostwi14', 'vdpostwiinsby', 'vdfupitoe', 'vdfupi1', 'vdfupi2', 'vdfupi3', 'vdfupi4', 'vdfupi5', 'vdfupi6', 'vdfupi7', 'vdfupi8', 'vdfupi9', 'vdfupi10', 'vdfupi11', 'vdfupi12', 'vdfupi13', 'vdfupi14', 'vdfupiinsby', 'swiitoe', 'swii1', 'swii2', 'swii3', 'swii4', 'swii5', 'swii6', 'swii7', 'swii8', 'swii9', 'swii10', 'swii11', 'swii12', 'swii13', 'swii14', 'swiiinsby', 'swprewitoe', 'swprewi1', 'swprewi2', 'swprewi3', 'swprewi4', 'swprewi5', 'swprewi6', 'swprewi7', 'swprewi8', 'swprewi9', 'swprewi10', 'swprewi11', 'swprewi12', 'swprewi13', 'swprewi14', 'swprewiinsby', 'swpostwitoe', 'swpostwi1', 'swpostwi2', 'swpostwi3', 'swpostwi4', 'swpostwi5', 'swpostwi6', 'swpostwi7', 'swpostwi8', 'swpostwi9', 'swpostwi10', 'swpostwi11', 'swpostwi12', 'swpostwi13', 'swpostwi14', 'swpostwiinsby', 'swfupitoe', 'swfupi1', 'swfupi2', 'swfupi3', 'swfupi4', 'swfupi5', 'swfupi6', 'swfupi7', 'swfupi8', 'swfupi9', 'swfupi10', 'swfupi11', 'swfupi12', 'swfupi13', 'swfupi14', 'swfupiinsby', 'type1', 'design1', 'angle1', 'component1', 'defectno1', 'repairtype1', 'length1', 'depth1', 'preheattemp1', 'contype1', 'consize1', 'type2', 'design2', 'angle2', 'component2', 'defectno2', 'repairtype2', 'length2', 'depth2', 'preheattemp2', 'contype2', 'consize2', 'type3', 'design3', 'angle3', 'component3', 'defectno3', 'repairtype3', 'length3', 'depth3', 'preheattemp3', 'contype3', 'consize3', 'preheater', 'generator', 'wfu', 'insdateins1', 'inspectedby1', 'insresult1', 'insdbno1', 'insdateins2', 'inspectedby2', 'insresult2', 'insdbno2', 'insdateins3', 'inspectedby3', 'insresult3', 'insdbno3', 'postwelddim', 'checked053', 'fplchecks', 'name053', 'namefpl', 'clientrepname',  'clientrepsignature', 'padno', 'weekno'], 'string', 'max' => 100],
            [['welderscomments', 'inscomments1', 'inscomments2', 'inscomments3', 'comments',],'string'],
			[['weldersasstname', 'insdate', 'starttime', 'finishtime', 'timetosite', 'timefromsite', 'date053', 'datefpl','drawingloc','signatureloc', 'weldersname'], 'safe'],
			//defaults
			[['deleted'], 'boolean'],
			[['created_at', 'updated_at', 'deleted_at'], 'safe'],
			[['created_by', 'updated_by','id'],'safe'],
			//redundant
			[['created_by2', 'updated_by2'], 'integer'],

   
    ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'insdate' => 'Installation Date',
            'weldersname' => 'Welders Name',
            'weldersasstname' => 'Welders Assistant Name',
            'inlinejobcostno' => 'Inline Job No',
            'area' => 'Area',
            'worksitelocation' => 'Worksitelocation',
            'starttime' => 'Starttime',
            'finishtime' => 'Finishtime',
            'client' => 'Client',
            'processused' => 'Processused',
            'timetosite' => 'Timetosite',
            'timefromsite' => 'Timefromsite',
            'location' => 'Location',
            'gps' => 'Gps',
            'elr' => 'Elr',
            'trackid' => 'Trackid',
            'mileage' => 'Mileage',
            'pointsno' => 'Pointsno',
            'switch' => 'Switch',
            'facetrail' => 'Facetrail',
            'railsec' => 'Railsec',
            'railgrade' => 'Railgrade',
            'damlength' => 'Damlength',
            'frontstepno' => 'Frontstepno',
            'frontangle' => 'Frontangle',
            'frontlength' => 'Frontlength',
            'behindangle' => 'Behindangle',
            'behindlength' => 'Behindlength',
            'repairangle' => 'Repairangle',
            'repairlength' => 'Repairlength',
            'VDIIToe' => 'Vdiitoe',
            'VDII1' => 'Vdii1',
            'VDII2' => 'Vdii2',
            'VDII3' => 'Vdii3',
            'VDII4' => 'Vdii4',
            'VDII5' => 'Vdii5',
            'VDII6' => 'Vdii6',
            'VDII7' => 'Vdii7',
            'VDII8' => 'Vdii8',
            'VDII9' => 'Vdii9',
            'VDII10' => 'Vdii10',
            'VDII11' => 'Vdii11',
            'VDII12' => 'Vdii12',
            'VDII13' => 'Vdii13',
            'VDII14' => 'Vdii14',
            'VDIIInsby' => 'Vdiiinsby',
            'VDPREWIToe' => 'Vdprewitoe',
            'VDPREWI1' => 'Vdprewi1',
            'VDPREWI2' => 'Vdprewi2',
            'VDPREWI3' => 'Vdprewi3',
            'VDPREWI4' => 'Vdprewi4',
            'VDPREWI5' => 'Vdprewi5',
            'VDPREWI6' => 'Vdprewi6',
            'VDPREWI7' => 'Vdprewi7',
            'VDPREWI8' => 'Vdprewi8',
            'VDPREWI9' => 'Vdprewi9',
            'VDPREWI10' => 'Vdprewi10',
            'VDPREWI11' => 'Vdprewi11',
            'VDPREWI12' => 'Vdprewi12',
            'VDPREWI13' => 'Vdprewi13',
            'VDPREWI14' => 'Vdprewi14',
            'VDPREWIInsby' => 'Vdprewiinsby',
            'VDPOSTWIToe' => 'Vdpostwitoe',
            'VDPOSTWI1' => 'Vdpostwi1',
            'VDPOSTWI2' => 'Vdpostwi2',
            'VDPOSTWI3' => 'Vdpostwi3',
            'VDPOSTWI4' => 'Vdpostwi4',
            'VDPOSTWI5' => 'Vdpostwi5',
            'VDPOSTWI6' => 'Vdpostwi6',
            'VDPOSTWI7' => 'Vdpostwi7',
            'VDPOSTWI8' => 'Vdpostwi8',
            'VDPOSTWI9' => 'Vdpostwi9',
            'VDPOSTWI10' => 'Vdpostwi10',
            'VDPOSTWI11' => 'Vdpostwi11',
            'VDPOSTWI12' => 'Vdpostwi12',
            'VDPOSTWI13' => 'Vdpostwi13',
            'VDPOSTWI14' => 'Vdpostwi14',
            'VDPOSTWIInsby' => 'Vdpostwiinsby',
            'VDFUPIToe' => 'Vdfupitoe',
            'VDFUPI1' => 'Vdfupi1',
            'VDFUPI2' => 'Vdfupi2',
            'VDFUPI3' => 'Vdfupi3',
            'VDFUPI4' => 'Vdfupi4',
            'VDFUPI5' => 'Vdfupi5',
            'VDFUPI6' => 'Vdfupi6',
            'VDFUPI7' => 'Vdfupi7',
            'VDFUPI8' => 'Vdfupi8',
            'VDFUPI9' => 'Vdfupi9',
            'VDFUPI10' => 'Vdfupi10',
            'VDFUPI11' => 'Vdfupi11',
            'VDFUPI12' => 'Vdfupi12',
            'VDFUPI13' => 'Vdfupi13',
            'VDFUPI14' => 'Vdfupi14',
            'VDFUPIInsby' => 'Vdfupiinsby',
            'SWIIToe' => 'Swiitoe',
            'SWII1' => 'Swii1',
            'SWII2' => 'Swii2',
            'SWII3' => 'Swii3',
            'SWII4' => 'Swii4',
            'SWII5' => 'Swii5',
            'SWII6' => 'Swii6',
            'SWII7' => 'Swii7',
            'SWII8' => 'Swii8',
            'SWII9' => 'Swii9',
            'SWII10' => 'Swii10',
            'SWII11' => 'Swii11',
            'SWII12' => 'Swii12',
            'SWII13' => 'Swii13',
            'SWII14' => 'Swii14',
            'SWIIInsby' => 'Swiiinsby',
            'SWPREWIToe' => 'Swprewitoe',
            'SWPREWI1' => 'Swprewi1',
            'SWPREWI2' => 'Swprewi2',
            'SWPREWI3' => 'Swprewi3',
            'SWPREWI4' => 'Swprewi4',
            'SWPREWI5' => 'Swprewi5',
            'SWPREWI6' => 'Swprewi6',
            'SWPREWI7' => 'Swprewi7',
            'SWPREWI8' => 'Swprewi8',
            'SWPREWI9' => 'Swprewi9',
            'SWPREWI10' => 'Swprewi10',
            'SWPREWI11' => 'Swprewi11',
            'SWPREWI12' => 'Swprewi12',
            'SWPREWI13' => 'Swprewi13',
            'SWPREWI14' => 'Swprewi14',
            'SWPREWIInsby' => 'Swprewiinsby',
            'SWPOSTWIToe' => 'Swpostwitoe',
            'SWPOSTWI1' => 'Swpostwi1',
            'SWPOSTWI2' => 'Swpostwi2',
            'SWPOSTWI3' => 'Swpostwi3',
            'SWPOSTWI4' => 'Swpostwi4',
            'SWPOSTWI5' => 'Swpostwi5',
            'SWPOSTWI6' => 'Swpostwi6',
            'SWPOSTWI7' => 'Swpostwi7',
            'SWPOSTWI8' => 'Swpostwi8',
            'SWPOSTWI9' => 'Swpostwi9',
            'SWPOSTWI10' => 'Swpostwi10',
            'SWPOSTWI11' => 'Swpostwi11',
            'SWPOSTWI12' => 'Swpostwi12',
            'SWPOSTWI13' => 'Swpostwi13',
            'SWPOSTWI14' => 'Swpostwi14',
            'SWPOSTWIInsby' => 'Swpostwiinsby',
            'SWFUPIToe' => 'Swfupitoe',
            'SWFUPI1' => 'Swfupi1',
            'SWFUPI2' => 'Swfupi2',
            'SWFUPI3' => 'Swfupi3',
            'SWFUPI4' => 'Swfupi4',
            'SWFUPI5' => 'Swfupi5',
            'SWFUPI6' => 'Swfupi6',
            'SWFUPI7' => 'Swfupi7',
            'SWFUPI8' => 'Swfupi8',
            'SWFUPI9' => 'Swfupi9',
            'SWFUPI10' => 'Swfupi10',
            'SWFUPI11' => 'Swfupi11',
            'SWFUPI12' => 'Swfupi12',
            'SWFUPI13' => 'Swfupi13',
            'SWFUPI14' => 'Swfupi14',
            'SWFUPIInsby' => 'Swfupiinsby',
            'Type1' => 'Type1',
            'Design1' => 'Design1',
            'Angle1' => 'Angle1',
            'Component1' => 'Component1',
            'DefectNo1' => 'Defect No1',
            'RepairType1' => 'Repair Type1',
            'Length1' => 'Length1',
            'Depth1' => 'Depth1',
            'PreheatTemp1' => 'Preheat Temp1',
            'conType1' => 'Con Type1',
            'conSize1' => 'Con Size1',
            'Type2' => 'Type2',
            'Design2' => 'Design2',
            'Angle2' => 'Angle2',
            'Component2' => 'Component2',
            'DefectNo2' => 'Defect No2',
            'RepairType2' => 'Repair Type2',
            'Length2' => 'Length2',
            'Depth2' => 'Depth2',
            'PreheatTemp2' => 'Preheat Temp2',
            'conType2' => 'Con Type2',
            'conSize2' => 'Con Size2',
            'Type3' => 'Type3',
            'Design3' => 'Design3',
            'Angle3' => 'Angle3',
            'Component3' => 'Component3',
            'DefectNo3' => 'Defect No3',
            'RepairType3' => 'Repair Type3',
            'Length3' => 'Length3',
            'Depth3' => 'Depth3',
            'PreheatTemp3' => 'Preheat Temp3',
            'conType3' => 'Con Type3',
            'conSize3' => 'Con Size3',
            'welderscomments' => 'Welderscomments',
            'preheater' => 'Preheater',
            'generator' => 'Generator',
            'wfu' => 'Wfu',
            'insdateins1' => 'Insdateins1',
            'inspectedby1' => 'Inspectedby1',
            'insresult1' => 'Insresult1',
            'inscomments1' => 'Inscomments1',
            'insdbno1' => 'Insdbno1',
            'insdateins2' => 'Insdateins2',
            'inspectedby2' => 'Inspectedby2',
            'insresult2' => 'Insresult2',
            'inscomments2' => 'Inscomments2',
            'insdbno2' => 'Insdbno2',
            'insdateins3' => 'Insdateins3',
            'inspectedby3' => 'Inspectedby3',
            'insresult3' => 'Insresult3',
            'inscomments3' => 'Inscomments3',
            'insdbno3' => 'Insdbno3',
            'postwelddim' => 'Postwelddim',
            'checked053' => 'Checked053',
            'fplchecks' => 'Fplchecks',
            'name053' => 'Name053',
            'date053' => 'Date053',
            'namefpl' => 'Namefpl',
            'datefpl' => 'Datefpl',
            'clientrepname' => 'Clientrepname',
            'comments' => 'Comments',
            'clientrepsignature' => 'Clientrepsignature',
            'drawingloc' => 'Drawing Location',
            'signatureloc' => 'Signature Location',
        ];
    }
    
    public function getAccount() {
        return Accounts::findOne(['id' => $this->client]);
    }
    public function getActivity() {
		return Activities::findOne(['id' => $this->actid]);
	}
	public function getUser() {
        return User::findOne(['id' => $this->created_by]);
    }
	Public function getLogo() {
		return ArrayHelper::map(settings::find()->where("id = '1'")->all(), 'logo', 'logo');
	}
	public function beforeValidate(){      
        if (Yii::$app->name !== 'app-console' ) {
            $this->padno = $this->padno == null ? User::Padno() : $this->padno;
        }
        return parent::beforeValidate();
    }

    public function setData()
    {
        if(Yii::$app->controller->action->id == 'create' && $actid = (Yii::$app->request->get('actid', null)) !== null ){
           $act = Activities::find()->select(['jobno', 'relatedid', 'location', 'sdate', 'elr', 'weekno', 'company'])->where(['id' => $actid])->asArray()->one();
           $this->inlinejobcostno = $act['jobno'];
           //$this->jcnno = $act['jobno'];
           $this->client = $act['relatedid'];
           $this->worksitelocation = $act['location'];
         //  $this->elr = $act['elr'];
           $this->weekno = $act['weekno'];
        //   $this->date = date('d/m/Y H:i', strtotime($act['sdate']));
           $this->insdate = date('d/m/Y H:i', strtotime($act['sdate']));
        }
    }

public static function adminFormButtons($buttons, $model){
      $_this = new self();
        $buttons[$_this->formType]['items'][] = [
            'label' => $_this->formname,
            'url' => [$_this->createpath, 'actid' => $model->id],
            'linkOptions' =>  ['target'=>'_blank'],
        ];
        return $buttons;
    }
}
