<?php

namespace modules\forms\models;
use Yii;
use modules\users\models\User;
use modules\activities\models\Activities;
use modules\custom\models\Accounts;
/**
 * This is the model class For table "dt123".
 *
 * @property integer $id
 * @property string $installdate
 * @property string $weldersname
 * @property string $weldersassistantname
 * @property string $welderssignature
 * @property string $area
 * @property string $tmetsm
 * @property string $worksitelocation
 * @property string $jobcostno
 * @property string $jobtype
 * @property string $defectnoremoved
 * @property string $starttime
 * @property string $starttraveltime
 * @property string $finishtime
 * @property string $finishtraveltime
 * @property string $elr1
 * @property string $elr2
 * @property string $elr3
 * @property string $elr4
 * @property string $mileage1
 * @property string $mileage2
 * @property string $mileage3
 * @property string $mileage4
 * @property string $chord1
 * @property string $chord2
 * @property string $chord3
 * @property string $chord4
 * @property string $trackid1
 * @property string $trackid2
 * @property string $trackid3
 * @property string $trackid4
 * @property string $btol1
 * @property string $btol2
 * @property string $btol3
 * @property string $btol4
 * @property string $gps1
 * @property string $gps2
 * @property string $gps3
 * @property string $gps4
 * @property string $linespeed1
 * @property string $linespeed2
 * @property string $linespeed3
 * @property string $linespeed4
 * @property string $lineloctype1
 * @property string $lineloctype2
 * @property string $lineloctype3
 * @property string $lineloctype4
 * @property string $sleepertype1
 * @property string $sleepertype2
 * @property string $sleepertype3
 * @property string $sleepertype4
 * @property string $consolidated1
 * @property string $consolidated2
 * @property string $consolidated3
 * @property string $consolidated4
 * @property string $rail1
 * @property string $rail2
 * @property string $rail3
 * @property string $rail4
 * @property string $Manufacturer1
 * @property string $Manufacturer2
 * @property string $Manufacturer3
 * @property string $Manufacturer4
 * @property string $profile1
 * @property string $profile2
 * @property string $profile3
 * @property string $profile4
 * @property string $grade1
 * @property string $grade2
 * @property string $grade3
 * @property string $grade4
 * @property string $wear1
 * @property string $wear2
 * @property string $wear3
 * @property string $wear4
 * @property string $cuttingmethod1
 * @property string $cuttingmethod2
 * @property string $cuttingmethod3
 * @property string $cuttingmethod4
 * @property string $wgap1
 * @property string $wgap2
 * @property string $wgap3
 * @property string $wgap4
 * @property string $alignment1
 * @property string $alignment2
 * @property string $alignment3
 * @property string $alignment4
 * @property string $railtemp1
 * @property string $railtemp2
 * @property string $railtemp3
 * @property string $railtemp4
 * @property string $weldtype1
 * @property string $weldtype2
 * @property string $weldtype3
 * @property string $weldtype4
 * @property string $mould1
 * @property string $mould2
 * @property string $mould3
 * @property string $mould4
 * @property string $fuelgas1
 * @property string $fuelgas2
 * @property string $fuelgas3
 * @property string $fuelgas4
 * @property string $gkitno1
 * @property string $gkitno2
 * @property string $gkitno3
 * @property string $gkitno4
 * @property string $pbno1
 * @property string $pbno2
 * @property string $pbno3
 * @property string $pbno4
 * @property string $portionno1
 * @property string $portionno2
 * @property string $portionno3
 * @property string $portionno4
 * @property string $kit1no1
 * @property string $kit1no2
 * @property string $kit1no3
 * @property string $kit1no4
 * @property string $preheat1
 * @property string $preheat2
 * @property string $preheat3
 * @property string $preheat4
 * @property string $shearing1
 * @property string $shearing2
 * @property string $shearing3
 * @property string $shearing4
 * @property string $tappingtime1
 * @property string $tappingtime2
 * @property string $tappingtime3
 * @property string $tappingtime4
 * @property string $kitno1
 * @property string $kitno2
 * @property string $kitno3
 * @property string $kitno4
 * @property string $conforms1
 * @property string $conforms2
 * @property string $conforms3
 * @property string $conforms4
 * @property string $stamp1
 * @property string $stamp2
 * @property string $stamp3
 * @property string $stamp4
 * @property string $nonconrepc1
 * @property string $nonconrepc2
 * @property string $nonconrepc3
 * @property string $nonconrepc4
 * @property string $clamped1
 * @property string $clamped2
 * @property string $clamped3
 * @property string $clamped4
 * @property string $nonconr1
 * @property string $nonconr2
 * @property string $nonconr3
 * @property string $nonconr4
 * @property string $wsjobno1
 * @property string $wsjobno2
 * @property string $wsjobno3
 * @property string $wsjobno4
 * @property string $weldwono1
 * @property string $weldwono2
 * @property string $weldwono3
 * @property string $weldwono4
 * @property string $wisstdjobno1
 * @property string $wisstdjobno2
 * @property string $wisstdjobno3
 * @property string $wisstdjobno4
 * @property string $inspectionwono1
 * @property string $inspectionwono2
 * @property string $inspectionwono3
 * @property string $inspectionwono4
 * @property string $protectiont1
 * @property string $protectiont2
 * @property string $protectiont3
 * @property string $protectiont4
 * @property string $protectionm1
 * @property string $protectionm2
 * @property string $protectionm3
 * @property string $protectionm4
 * @property string $tools1
 * @property string $tools2
 * @property string $tools3
 * @property string $tools4
 * @property string $npt1
 * @property string $npt2
 * @property string $npt3
 * @property string $npt4
 * @property string $dbref1
 * @property string $dbref2
 * @property string $dbref3
 * @property string $dbref4
 * @property string $insname
 * @property string $insdate
 * @property string $formno1
 * @property string $formno2
 * @property string $formno3
 * @property string $formno4
 * @property string $ellipseby
 * @property string $ellipsedate
 * @property string $client
 * @property string $siterepsignature
 * @property string $siterepprint
 * @property string $dbname
 * @property string $dbdate
 */
class Dt123 extends  \yii\base\Model {

    public $id;
    public $injobno;
    public $weekno;
    public $noofwelds;
    public $goodwelds;
    public $badwelds;
    public $weldscompleted;
    public $installdate;
    public $installdate1;
    public $installtime1;
    public $installdate2;
    public $installtime2;
    public $installdate3;
    public $installtime3;
    public $installdate4;
    public $installtime4;
    public $weldersname5;
    public $installdate6;
    public $installtime6;
    public $installtime5;
    public $installdate7;
    public $installtime7;
    public $installdate8;
    public $installtime8;
    public $meters1;
    public $meters2;
    public $meters3;
    public $meters4;
    public $chain1;
    public $chain2;
    public $chain3;
    public $chain4;
    public $yards1;
    public $yards2;
    public $yards3;
    public $yards4;
    public $gps1;
    public $gps2;
    public $gps3;
    public $gps4;
    public $snag1;
    public $snag2;
    public $snag3;
    public $snag4;
    public $snag1id;
    public $snag2id;
    public $snag3id;
    public $snag4id;
    public $grade5;
    public $grade6;
    public $grade7;
    public $grade8;
    public $wear5;
    public $wear6;
    public $wear7;
    public $wear8;
    public $profile5;
    public $profile6;
    public $profile7;
    public $profile8;
    public $manufacturer1;
    public $manufacturer2;
    public $manufacturer3;
    public $manufacturer4;
    public $manufacturer5;
    public $manufacturer6;
    public $manufacturer7;
    public $manufacturer8;
    public $weldersname;
    public $weldersassistantname;
    public $welderssignature;
    public $area;
    public $tmetsm;
    public $worksitelocation;
    public $jobcostno;
    public $jobtype;
    public $defectnoremoved;
    public $starttime;
    public $starttraveltime;
    public $finishtime;
    public $finishtraveltime;
    public $elr1;
    public $elr2;
    public $elr3;
    public $elr4;
    public $mileage1;
    public $mileage2;
    public $mileage3;
    public $mileage4;
    public $chord1;
    public $chord2;
    public $chord3;
    public $chord4;
    public $trackid1;
    public $trackid2;
    public $trackid3;
    public $trackid4;
    public $btol1;
    public $btol2;
    public $btol3;
    public $btol4;
    public $linespeed1;
    public $linespeed2;
    public $linespeed3;
    public $linespeed4;
    public $lineloctype1;
    public $lineloctype2;
    public $lineloctype3;
    public $lineloctype4;
    public $sleepertype1;
    public $sleepertype2;
    public $sleepertype3;
    public $sleepertype4;
    public $consolidated1;
    public $consolidated2;
    public $consolidated3;
    public $consolidated4;
    public $rail1;
    public $rail2;
    public $rail3;
    public $rail4;
    public $profile1;
    public $profile2;
    public $profile3;
    public $profile4;
    public $grade1;
    public $grade2;
    public $grade3;
    public $grade4;
    public $wear1;
    public $wear2;
    public $wear3;
    public $wear4;
    public $cuttingmethod1;
    public $cuttingmethod2;
    public $cuttingmethod3;
    public $cuttingmethod4;
    public $wgap1;
    public $wgap2;
    public $wgap3;
    public $wgap4;
    public $alignment1;
    public $alignment2;
    public $alignment3;
    public $alignment4;
    public $railtemp1;
    public $railtemp2;
    public $railtemp3;
    public $railtemp4;
    public $weldtype1;
    public $weldtype2;
    public $weldtype3;
    public $weldtype4;
    public $mould1;
    public $mould2;
    public $mould3;
    public $mould4;
    public $fuelgas1;
    public $fuelgas2;
    public $fuelgas3;
    public $fuelgas4;
    public $gkitno1;
    public $gkitno2;
    public $gkitno3;
    public $gkitno4;
    public $pbno1;
    public $pbno2;
    public $pbno3;
    public $pbno4;
    public $portionno1;
    public $portionno2;
    public $portionno3;
    public $portionno4;
    public $kit1no1;
    public $kit1no2;
    public $kit1no3;
    public $kit1no4;
    public $preheat1;
    public $preheat2;
    public $preheat3;
    public $preheat4;
    public $shearing1;
    public $shearing2;
    public $shearing3;
    public $shearing4;
    public $tappingtime1;
    public $tappingtime2;
    public $tappingtime3;
    public $tappingtime4;
    public $kitno1;
    public $kitno2;
    public $kitno3;
    public $kitno4;
    public $conforms1;
    public $conforms2;
    public $conforms3;
    public $conforms4;
    public $stamp1;
    public $stamp2;
    public $stamp3;
    public $stamp4;
    public $nonconrepc1;
    public $nonconrepc2;
    public $nonconrepc3;
    public $nonconrepc4;
    public $clamped1;
    public $clamped2;
    public $clamped3;
    public $clamped4;
    public $nonconr1;
    public $nonconr2;
    public $nonconr3;
    public $nonconr4;
    public $wsjobno1;
    public $wsjobno2;
    public $wsjobno3;
    public $wsjobno4;
    public $weldwono1;
    public $weldwono2;
    public $weldwono3;
    public $weldwono4;
    public $wisstdjobno1;
    public $wisstdjobno2;
    public $wisstdjobno3;
    public $wisstdjobno4;
    public $inspectionwono1;
    public $inspectionwono2;
    public $inspectionwono3;
    public $inspectionwono4;
    public $protectiont1;
    public $protectiont2;
    public $protectiont3;
    public $protectiont4;
    public $protectionm1;
    public $protectionm2;
    public $protectionm3;
    public $protectionm4;
    public $tools1;
    public $tools2;
    public $tools3;
    public $tools4;
    public $npt1;
    public $npt2;
    public $npt3;
    public $npt4;
    public $dbref1;
    public $dbref2;
    public $dbref3;
    public $dbref4;
    public $insname;
    public $insdate;
    public $formno1;
    public $formno2;
    public $formno3;
    public $formno4;
    public $ellipseby;
    public $ellipsedate;
    public $client;
    public $siterepsignature;
    public $siterepprint;
    public $dbname;
    public $dbdate;
    public $createdby;
    public $createdon;
    public $wsignatureloc;
    public $signatureloc;

    public $updated_by;
    public $updated_by2;
    public $deleted_by;
    public $created_by;
    public $created_by2;
    public $created_at;
    public $deleted_at;
    public $updated_at;

    public $relatedid;
    public $actid;
    public $padno;
    public $deleted;
    public $welderssignaturelocation;
    public $clientsignaturelocation;
    public $tracktrolley;

    public $form = 'Dt123';
    public $formname = 'Aluminothermic Welding Installation Form (DT123)';
    
    public $formLayout = '/dt123/_form.php';
    public $viewLayout = '@modules/forms/views/dt123/_view.php';
    public $formType = 'Thermic';
    public $createpath = '/forms/dt123/create';
    
    public $dates = ['created_at', 'updated_at', 'deleted_at'];
	public $uniqueidentifiers = ['actid'];
    public $securefields = [];
    public $printlayout = 'Portrait';


    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['weldersassistantname', 'installdate','installdate1','installdate2','installdate3','installdate4','installdate5','installdate6','installdate7','installdate8', 'installtime1','installtime2','installtime3','installtime4','installtime5','installtime6','installtime7','installtime8', 'ellipsedate', 'dbdate', 'wsignatureloc' , 'signatureloc','weldersname','actid'], 'safe'],
            [['welderssignature', 'area', 'tmetsm', 'worksitelocation', 'jobcostno', 'jobtype',  'starttime', 'starttraveltime', 'finishtime', 'finishtraveltime', 'elr1', 'elr2', 'elr3', 'elr4', 'mileage1', 'mileage2', 'mileage3', 'mileage4','meters1','meters2','meters3','meters4','yards1','yards2','yards3','yards4','chain1','chain2','chain3','chain4', 'chord1', 'chord2', 'chord3', 'chord4', 'trackid1', 'trackid2', 'trackid3', 'trackid4', 'btol1', 'btol2', 'btol3', 'btol4', 'gps1', 'gps2', 'gps3', 'gps4', 'linespeed1', 'linespeed2', 'linespeed3', 'linespeed4', 'lineloctype1', 'lineloctype2', 'lineloctype3', 'lineloctype4', 'sleepertype1', 'sleepertype2', 'sleepertype3', 'sleepertype4', 'consolidated1', 'consolidated2', 'consolidated3', 'consolidated4', 'rail1', 'rail2', 'rail3', 'rail4', 'manufacturer1', 'manufacturer2', 'manufacturer3', 'manufacturer4', 'manufacturer5', 'manufacturer6', 'manufacturer7', 'manufacturer8', 'profile1', 'profile2', 'profile3', 'profile4', 'profile5', 'profile6', 'profile7', 'profile8', 'grade1', 'grade2', 'grade3', 'grade4', 'grade5', 'grade6', 'grade7', 'grade8', 'wear1', 'wear2', 'wear3', 'wear4', 'wear5', 'wear6', 'wear7', 'wear8', 'cuttingmethod1', 'cuttingmethod2', 'cuttingmethod3', 'cuttingmethod4', 'wgap1', 'wgap2', 'wgap3', 'wgap4', 'alignment1', 'alignment2', 'alignment3', 'alignment4', 'railtemp1', 'railtemp2', 'railtemp3', 'railtemp4', 'weldtype1', 'weldtype2', 'weldtype3', 'weldtype4', 'mould1', 'mould2', 'mould3', 'mould4', 'fuelgas1', 'fuelgas2', 'fuelgas3', 'fuelgas4', 'gkitno1', 'gkitno2', 'gkitno3', 'gkitno4', 'pbno1', 'pbno2', 'pbno3', 'pbno4', 'portionno1', 'portionno2', 'portionno3', 'portionno4', 'kit1no1', 'kit1no2', 'kit1no3', 'kit1no4', 'preheat1', 'preheat2', 'preheat3', 'preheat4', 'shearing1', 'shearing2', 'shearing3', 'shearing4', 'tappingtime1', 'tappingtime2', 'tappingtime3', 'tappingtime4', 'kitno1', 'kitno2', 'kitno3', 'kitno4', 'conforms1', 'conforms2', 'conforms3', 'conforms4', 'stamp1', 'stamp2', 'stamp3', 'stamp4', 'nonconrepc1', 'nonconrepc2', 'nonconrepc3', 'nonconrepc4', 'clamped1', 'clamped2', 'clamped3', 'clamped4', 'wsjobno1', 'wsjobno2', 'wsjobno3', 'wsjobno4', 'weldwono1', 'weldwono2', 'weldwono3', 'weldwono4', 'wisstdjobno1', 'wisstdjobno2', 'wisstdjobno3', 'wisstdjobno4', 'inspectionwono1', 'inspectionwono2', 'inspectionwono3', 'inspectionwono4', 'protectiont1', 'protectiont2', 'protectiont3', 'protectiont4', 'protectionm1', 'protectionm2', 'protectionm3', 'protectionm4', 'tools1', 'tools2', 'tools3', 'tools4', 'npt1', 'npt2', 'npt3', 'npt4', 'dbref1', 'dbref2', 'dbref3', 'dbref4', 'insname', 'insdate', 'formno1', 'formno2', 'formno3', 'formno4', 'ellipseby', 'client', 'siterepsignature', 'siterepprint', 'dbname',  'weekno', 'padno', 'snag1', 'snag2', 'snag3','snag4', 
                'snag1id', 'snag2id', 'snag3id', 'snag4id', 'tracktrolley', 'weldersname5', 'createdby', 'createdon'], 'string', 'max' => 45],
            [['defectnoremoved',], 'string', 'max' => 100],
            [['welderssignaturelocation','clientsignaturelocation'], 'string'],
            [['injobno','goodwelds', 'badwelds', 'noofwelds', 'weldscompleted',], 'integer'],
            [['nonconr1', 'nonconr2', 'nonconr3', 'nonconr4'], 'string', 'max' => 1000],
			//Defaults
			[['deleted'], 'boolean'],
			[['created_at', 'updated_at', 'deleted_at'], 'safe'],
			[['created_by', 'updated_by','id'],'safe'],
			//Redundant
            [['created_by2', 'updated_by2'], 'integer'],
            [['actid', 'relatedid', 'deleted_by', ], 'default', 'value' => null],

        ];
    }

    /**
     * @inheritdoc
     */
    /*
    public function attributes() {
        return [
            'id' => 'id',
            'injobno' => 'injobno',
            'weekno' => 'weekno',
            'installdate' => 'installdate',
            'weldersname' => 'weldersname',
            'weldersassistantname' => "weldersassistantname",
            'welderssignature' => "welderssignature",
            'area' => 'area',
            'tmetsm' => 'tmetsm',
            'worksitelocation' => 'worksitelocation',
            'jobcostno' => 'jobcostno',
            'jobtype' => 'jobtype',
            'defectnoremoved' => 'defectnoremoved',
            'starttime' => 'starttime',
            'starttraveltime' => 'starttraveltime',
            'finishtime' => 'finishtime',
            'finishtraveltime' => 'finishtraveltime',
            'snag1' => 'snag1',
            'snag2' => 'snag2',
            'snag3' => 'snag3',
            'snag4' => 'snag4',
            'snag1id' => 'snag1id',
            'snag2id' => 'snag2id',
            'snag3id' => 'snag3id',
            'snag4id' => 'snag4id',
            'elr1' => 'elr1',
            'elr2' => 'elr2',
            'elr3' => 'elr3',
            'elr4' => 'elr4',
            'mileage1' => 'mileage1',
            'mileage2' => 'mileage2',
            'mileage3' => 'mileage3',
            'mileage4' => 'mileage4',
            'chord1' => 'chord1',
            'chord2' => 'chord2',
            'chord3' => 'chord3',
            'chord4' => 'chord4',
            'trackid1' => 'trackid1',
            'trackid2' => 'trackid2',
            'trackid3' => 'trackid3',
            'trackid4' => 'trackid4',
            'btol1' => 'btol1',
            'btol2' => 'btol2',
            'btol3' => 'btol3',
            'btol4' => 'btol4',
            'gps1' => 'gps1',
            'gps2' => 'gps2',
            'gps3' => 'gps3',
            'gps4' => 'gps4',
            'linespeed1' => 'linespeed1',
            'linespeed2' => 'linespeed2',
            'linespeed3' => 'linespeed3',
            'linespeed4' => 'linespeed4',
            'lineloctype1' => 'lineloctype1',
            'lineloctype2' => 'lineloctype2',
            'lineloctype3' => 'lineloctype3',
            'lineloctype4' => 'lineloctype4',
            'sleepertype1' => 'sleepertype1',
            'sleepertype2' => 'sleepertype2',
            'sleepertype3' => 'sleepertype3',
            'sleepertype4' => 'sleepertype4',
            'consolidated1' => 'consolidated1',
            'consolidated2' => 'consolidated2',
            'consolidated3' => 'consolidated3',
            'consolidated4' => 'consolidated4',
            'rail1' => 'rail1',
            'rail2' => 'rail2',
            'rail3' => 'rail3',
            'rail4' => 'rail4',
            'manufacturer1' => 'manufacturer1',
            'manufacturer2' => 'manufacturer2',
            'manufacturer3' => 'manufacturer3',
            'manufacturer4' => 'manufacturer4',
            'profile1' => 'profile1',
            'profile2' => 'profile2',
            'profile3' => 'profile3',
            'profile4' => 'profile4',
            'grade1' => 'grade1',
            'grade2' => 'grade2',
            'grade3' => 'grade3',
            'grade4' => 'grade4',
            'wear1' => 'wear1',
            'wear2' => 'wear2',
            'wear3' => 'wear3',
            'wear4' => 'wear4',
            'cuttingmethod1' => 'cuttingmethod1',
            'cuttingmethod2' => 'cuttingmethod2',
            'cuttingmethod3' => 'cuttingmethod3',
            'cuttingmethod4' => 'cuttingmethod4',
            'wgap1' => 'wgap1',
            'wgap2' => 'wgap2',
            'wgap3' => 'wgap3',
            'wgap4' => 'wgap4',
            'alignment1' => 'alignment1',
            'alignment2' => 'alignment2',
            'alignment3' => 'alignment3',
            'alignment4' => 'alignment4',
            'railtemp1' => 'railtemp1',
            'railtemp2' => 'railtemp2',
            'railtemp3' => 'railtemp3',
            'railtemp4' => 'railtemp4',
            'weldtype1' => 'weldtype1',
            'weldtype2' => 'weldtype2',
            'weldtype3' => 'weldtype3',
            'weldtype4' => 'weldtype4',
            'mould1' => 'mould1',
            'mould2' => 'mould2',
            'mould3' => 'mould3',
            'mould4' => 'mould4',
            'fuelgas1' => 'fuelgas1',
            'fuelgas2' => 'fuelgas2',
            'fuelgas3' => 'fuelgas3',
            'fuelgas4' => 'fuelgas4',
            'gkitno1' => 'gkitno1',
            'gkitno2' => 'gkitno2',
            'gkitno3' => 'gkitno3',
            'gkitno4' => 'gkitno4',
            'pbno1' => 'pbno1',
            'pbno2' => 'pbno2',
            'pbno3' => 'pbno3',
            'pbno4' => 'pbno4',
            'portionno1' => 'portionno1',
            'portionno2' => 'portionno2',
            'portionno3' => 'portionno3',
            'portionno4' => 'portionno4',
            'kit1no1' => 'kit1no1',
            'kit1no2' => 'kit1no2',
            'kit1no3' => 'kit1no3',
            'kit1no4' => 'kit1no4',
            'preheat1' => 'preheat1',
            'preheat2' => 'preheat2',
            'preheat3' => 'preheat3',
            'preheat4' => 'preheat4',
            'shearing1' => 'shearing1',
            'shearing2' => 'shearing2',
            'shearing3' => 'shearing3',
            'shearing4' => 'shearing4',
            'tappingtime1' => 'tappingtime1',
            'tappingtime2' => 'tappingtime2',
            'tappingtime3' => 'tappingtime3',
            'tappingtime4' => 'tappingtime4',
            'kitno1' => 'kitno1',
            'kitno2' => 'kitno2',
            'kitno3' => 'kitno3',
            'kitno4' => 'kitno4',
            'conforms1' => 'conforms1',
            'conforms2' => 'conforms2',
            'conforms3' => 'conforms3',
            'conforms4' => 'conforms4',
            'stamp1' => 'stamp1',
            'stamp2' => 'stamp2',
            'stamp3' => 'stamp3',
            'stamp4' => 'stamp4',
            'nonconrepc1' => 'nonconrepc1',
            'nonconrepc2' => 'nonconrepc2',
            'nonconrepc3' => 'nonconrepc3',
            'nonconrepc4' => 'nonconrepc4',
            'clamped1' => 'clamped1',
            'clamped2' => 'clamped2',
            'clamped3' => 'clamped3',
            'clamped4' => 'clamped4',
            'nonconr1' => 'nonconr1',
            'nonconr2' => 'nonconr2',
            'nonconr3' => 'nonconr3',
            'nonconr4' => 'nonconr4',
            'wsjobno1' => 'wsjobno1',
            'wsjobno2' => 'wsjobno2',
            'wsjobno3' => 'wsjobno3',
            'wsjobno4' => 'wsjobno4',
            'weldwono1' => 'weldwono1',
            'weldwono2' => 'weldwono2',
            'weldwono3' => 'weldwono3',
            'weldwono4' => 'weldwono4',
            'wisstdjobno1' => 'wisstdjobno1',
            'wisstdjobno2' => 'wisstdjobno2',
            'wisstdjobno3' => 'wisstdjobno3',
            'wisstdjobno4' => 'wisstdjobno4',
            'inspectionwono1' => 'inspectionwono1',
            'inspectionwono2' => 'inspectionwono2',
            'inspectionwono3' => 'inspectionwono3',
            'inspectionwono4' => 'inspectionwono4',
            'protectiont1' => 'protectiont1',
            'protectiont2' => 'protectiont2',
            'protectiont3' => 'protectiont3',
            'protectiont4' => 'protectiont4',
            'protectionm1' => 'protectionm1',
            'protectionm2' => 'protectionm2',
            'protectionm3' => 'protectionm3',
            'protectionm4' => 'protectionm4',
            'tools1' => 'tools1',
            'tools2' => 'tools2',
            'tools3' => 'tools3',
            'tools4' => 'tools4',
            'npt1' => 'npt1',
            'npt2' => 'npt2',
            'npt3' => 'npt3',
            'npt4' => 'npt4',
            'dbref1' => 'dbref1',
            'dbref2' => 'dbref2',
            'dbref3' => 'dbref3',
            'dbref4' => 'dbref4',
            'insname' => 'insname',
            'insdate' => 'insdate',
            'formno1' => 'formno1',
            'formno2' => 'formno2',
            'formno3' => 'formno3',
            'formno4' => 'formno4',
            'ellipseby' => 'ellipseby',
            'ellipsedate' => 'ellipsedate',
            'client' => 'client',
            'siterepsignature' => 'siterepsignature',
            'siterepprint' => 'siterepprint',
            'dbname' => 'dbname',
            'dbdate' => 'dbdate',
            'createdby' => 'createdby',
            'createdon' => 'createdon',
            'wsignatureloc' => 'wsignatureloc',
            'welderssignaturelocation' => 'welderssignaturelocation',
            'signatureloc' => 'clientsignaturelocation',
            'tracktrolley' => 'tracktrolley',

        ];
    }
*/
    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'injobno' => 'Job No',
            'weekno' => 'Week No',
            'installdate' => 'Installation Date',
            'weldersname' => 'Welders Name',
            'weldersassistantname' => "Welder's Assistant Name",
            'welderssignature' => "Welder's Signature",
            'area' => 'Area',
            'tmetsm' => 'TME/TSM',
            'worksitelocation' => 'Worksite Location',
            'jobcostno' => 'Job Cost No.',
            'jobtype' => 'Job Type',
            'defectnoremoved' => 'Defect No. Removed',
            'starttime' => 'Start Time',
            'starttraveltime' => 'Start Travel Time',
            'finishtime' => 'Finish Time',
            'finishtraveltime' => 'Finish Travel Time',
            'elr1' => 'Elr1',
            'elr2' => 'Elr2',
            'elr3' => 'Elr3',
            'elr4' => 'Elr4',
            'mileage1' => 'Mileage1',
            'mileage2' => 'Mileage2',
            'mileage3' => 'Mileage3',
            'mileage4' => 'Mileage4',
            'chord1' => 'Chord1',
            'chord2' => 'Chord2',
            'chord3' => 'Chord3',
            'chord4' => 'Chord4',
            'trackid1' => 'Trackid1',
            'trackid2' => 'Trackid2',
            'trackid3' => 'Trackid3',
            'trackid4' => 'Trackid4',
            'btol1' => 'Btol1',
            'btol2' => 'Btol2',
            'btol3' => 'Btol3',
            'btol4' => 'Btol4',
            'gps1' => 'Gps1',
            'gps2' => 'Gps2',
            'gps3' => 'Gps3',
            'gps4' => 'Gps4',
            'linespeed1' => 'Linespeed1',
            'linespeed2' => 'Linespeed2',
            'linespeed3' => 'Linespeed3',
            'linespeed4' => 'Linespeed4',
            'lineloctype1' => 'Lineloctype1',
            'lineloctype2' => 'Lineloctype2',
            'lineloctype3' => 'Lineloctype3',
            'lineloctype4' => 'Lineloctype4',
            'sleepertype1' => 'Sleepertype1',
            'sleepertype2' => 'Sleepertype2',
            'sleepertype3' => 'Sleepertype3',
            'sleepertype4' => 'Sleepertype4',
            'consolidated1' => 'Consolidated1',
            'consolidated2' => 'Consolidated2',
            'consolidated3' => 'Consolidated3',
            'consolidated4' => 'Consolidated4',
            'rail1' => 'Rail1',
            'rail2' => 'Rail2',
            'rail3' => 'Rail3',
            'rail4' => 'Rail4',
            'manufacturer1' => 'Manufacturer1',
            'manufacturer2' => 'Manufacturer2',
            'manufacturer3' => 'Manufacturer3',
            'manufacturer4' => 'Manufacturer4',
            'profile1' => 'Profile1',
            'profile2' => 'Profile2',
            'profile3' => 'Profile3',
            'profile4' => 'Profile4',
            'grade1' => 'Grade1',
            'grade2' => 'Grade2',
            'grade3' => 'Grade3',
            'grade4' => 'Grade4',
            'wear1' => 'Wear1',
            'wear2' => 'Wear2',
            'wear3' => 'Wear3',
            'wear4' => 'Wear4',
            'cuttingmethod1' => 'Cuttingmethod1',
            'cuttingmethod2' => 'Cuttingmethod2',
            'cuttingmethod3' => 'Cuttingmethod3',
            'cuttingmethod4' => 'Cuttingmethod4',
            'wgap1' => 'Wgap1',
            'wgap2' => 'Wgap2',
            'wgap3' => 'Wgap3',
            'wgap4' => 'Wgap4',
            'alignment1' => 'Alignment1',
            'alignment2' => 'Alignment2',
            'alignment3' => 'Alignment3',
            'alignment4' => 'Alignment4',
            'railtemp1' => 'Railtemp1',
            'railtemp2' => 'Railtemp2',
            'railtemp3' => 'Railtemp3',
            'railtemp4' => 'Railtemp4',
            'weldtype1' => 'Weldtype1',
            'weldtype2' => 'Weldtype2',
            'weldtype3' => 'Weldtype3',
            'weldtype4' => 'Weldtype4',
            'mould1' => 'Mould1',
            'mould2' => 'Mould2',
            'mould3' => 'Mould3',
            'mould4' => 'Mould4',
            'fuelgas1' => 'Fuelgas1',
            'fuelgas2' => 'Fuelgas2',
            'fuelgas3' => 'Fuelgas3',
            'fuelgas4' => 'Fuelgas4',
            'gkitno1' => 'Gkitno1',
            'gkitno2' => 'Gkitno2',
            'gkitno3' => 'Gkitno3',
            'gkitno4' => 'Gkitno4',
            'pbno1' => 'Pbno1',
            'pbno2' => 'Pbno2',
            'pbno3' => 'Pbno3',
            'pbno4' => 'Pbno4',
            'portionno1' => 'Portionno1',
            'portionno2' => 'Portionno2',
            'portionno3' => 'Portionno3',
            'portionno4' => 'Portionno4',
            'kit1no1' => 'Kit1no1',
            'kit1no2' => 'Kit1no2',
            'kit1no3' => 'Kit1no3',
            'kit1no4' => 'Kit1no4',
            'preheat1' => 'Preheat1',
            'preheat2' => 'Preheat2',
            'preheat3' => 'Preheat3',
            'preheat4' => 'Preheat4',
            'shearing1' => 'Shearing1',
            'shearing2' => 'Shearing2',
            'shearing3' => 'Shearing3',
            'shearing4' => 'Shearing4',
            'tappingtime1' => 'Tappingtime1',
            'tappingtime2' => 'Tappingtime2',
            'tappingtime3' => 'Tappingtime3',
            'tappingtime4' => 'Tappingtime4',
            'kitno1' => 'Kitno1',
            'kitno2' => 'Kitno2',
            'kitno3' => 'Kitno3',
            'kitno4' => 'Kitno4',
            'conforms1' => 'Conforms1',
            'conforms2' => 'Conforms2',
            'conforms3' => 'Conforms3',
            'conforms4' => 'Conforms4',
            'stamp1' => 'Stamp1',
            'stamp2' => 'Stamp2',
            'stamp3' => 'Stamp3',
            'stamp4' => 'Stamp4',
            'nonconrepc1' => 'Nonconrepc1',
            'nonconrepc2' => 'Nonconrepc2',
            'nonconrepc3' => 'Nonconrepc3',
            'nonconrepc4' => 'Nonconrepc4',
            'clamped1' => 'Clamped1',
            'clamped2' => 'Clamped2',
            'clamped3' => 'Clamped3',
            'clamped4' => 'Clamped4',
            'nonconr1' => 'Nonconr1',
            'nonconr2' => 'Nonconr2',
            'nonconr3' => 'Nonconr3',
            'nonconr4' => 'Nonconr4',
            'wsjobno1' => 'Wsjobno1',
            'wsjobno2' => 'Wsjobno2',
            'wsjobno3' => 'Wsjobno3',
            'wsjobno4' => 'Wsjobno4',
            'weldwono1' => 'Weldwono1',
            'weldwono2' => 'Weldwono2',
            'weldwono3' => 'Weldwono3',
            'weldwono4' => 'Weldwono4',
            'wisstdjobno1' => 'Wisstdjobno1',
            'wisstdjobno2' => 'Wisstdjobno2',
            'wisstdjobno3' => 'Wisstdjobno3',
            'wisstdjobno4' => 'Wisstdjobno4',
            'inspectionwono1' => 'Inspectionwono1',
            'inspectionwono2' => 'Inspectionwono2',
            'inspectionwono3' => 'Inspectionwono3',
            'inspectionwono4' => 'Inspectionwono4',
            'protectiont1' => 'Protectiont1',
            'protectiont2' => 'Protectiont2',
            'protectiont3' => 'Protectiont3',
            'protectiont4' => 'Protectiont4',
            'protectionm1' => 'Protectionm1',
            'protectionm2' => 'Protectionm2',
            'protectionm3' => 'Protectionm3',
            'protectionm4' => 'Protectionm4',
            'tools1' => 'Tools1',
            'tools2' => 'Tools2',
            'tools3' => 'Tools3',
            'tools4' => 'Tools4',
            'npt1' => 'Npt1',
            'npt2' => 'Npt2',
            'npt3' => 'Npt3',
            'npt4' => 'Npt4',
            'dbref1' => 'Dbref1',
            'dbref2' => 'Dbref2',
            'dbref3' => 'Dbref3',
            'dbref4' => 'Dbref4',
            'insname' => 'Insname',
            'insdate' => 'Insdate',
            'formno1' => 'Formno1',
            'formno2' => 'Formno2',
            'formno3' => 'Formno3',
            'formno4' => 'Formno4',
            'ellipseby' => 'Ellipseby',
            'ellipsedate' => 'Ellipsedate',
            'client' => 'Client',
            'siterepsignature' => 'Site Rep Signature',
            'siterepprint' => 'Site Rep Print',
            'dbname' => 'Dbname',
            'dbdate' => 'Dbdate',
            'createdby' => 'Created By',
            'createdon' => 'Created On',
            'wsignatureloc' => 'Welders Signature Location',
            'signatureloc' => 'Client Signature Location'
        ];
    }

       public function getAccount()
    {
        return Accounts::findOne(['id' => $this->client]);
    }
    public function getActivity()
    {
        return Activities::findOne(['id' => $this->actid]);
        
	}
	public function beforeValidate() {
		
			if ($this->weldersname != '') {$this->weldersname = implode(",", $this->weldersname);} else {$this->weldersname = Yii::$app->user->identity->username;};
			if ($this->weldersassistantname) {$this->weldersassistantname = implode(",", $this->weldersassistantname);} else {$this->weldersassistantname = Null;};
            $this->padno = $this->padno == null ? User::Padno() : $this->padno;
		return parent::beforeValidate();
	}
    
    public function init()
    {
        // Parameters 
        if(Yii::$app->controller->action->id == 'create' && $this->actid !== null ){
           $act = Activities::find()->select(['jobno', 'relatedid', 'location', 'sdate', 'elr', 'weekno', 'jobtype'])->where(['id' => $this->actid])->asArray()->one();
           $this->injobno = $act['jobno'];
           $this->client = $act['relatedid'];
           $this->worksitelocation = $act['location'];
        //   $this->elr = $act['elr'];
           $this->installdate = date('d/m/Y H:i', strtotime($act['sdate']));
           $this->weekno = $act['weekno'];
           $this->jobtype = $act['jobtype'];
        }
        return parent::init();
    }


    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;
    }
}