<?php

namespace modules\forms\models;

use Yii;
use modules\activities\models\Activities;
use modules\custom\models\Accounts;
use modules\users\models\User;


/**
 * This is the model class For table "wel233".
 *
 * @property integer $id
 * @property string $seniorweldingcoordinator
 * @property string $maxlength
 * @property string $weekno
 * @property string $jcn
 * @property string $site
 * @property string $insdate
 * @property string $weldersname
 * @property string $welderssignature
 * @property string $weldersastname
 * @property string $weldersastsign
 * @property string $elr1
 * @property string $elr2
 * @property string $elr3
 * @property string $elr4
 * @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 $type1
 * @property string $type2
 * @property string $type3
 * @property string $type4
 * @property string $linespeed1
 * @property string $linespeed2
 * @property string $linespeed3
 * @property string $linespeed4
 * @property string $sleeper1
 * @property string $sleeper2
 * @property string $sleeper3
 * @property string $sleeper4
 * @property string $consolidated1
 * @property string $consolidated2
 * @property string $consolidated3
 * @property string $consolidated4
 * @property string $fffr1
 * @property string $fffr2
 * @property string $fffr3
 * @property string $fffr4
 * @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 $gapprep1
 * @property string $gapprep2
 * @property string $gapprep3
 * @property string $gapprep4
 * @property string $gap1
 * @property string $gap2
 * @property string $gap3
 * @property string $gap4
 * @property string $align1
 * @property string $align2
 * @property string $align3
 * @property string $align4
 * @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 $fuelgused1
 * @property string $fuelgused2
 * @property string $fuelgused3
 * @property string $fuelgused4
 * @property string $pbn1
 * @property string $pbn2
 * @property string $pbn3
 * @property string $pbn4
 * @property string $portion1
 * @property string $portion2
 * @property string $portion3
 * @property string $portion4
 * @property string $tappingtime1
 * @property string $tappingtime2
 * @property string $tappingtime3
 * @property string $tappingtime4
 * @property string $wstampno1
 * @property string $wstampno2
 * @property string $wstampno3
 * @property string $wstampno4
 * @property string $kitno1
 * @property string $kitno2
 * @property string $kitno3
 * @property string $kitno4
 * @property string $pressurep1
 * @property string $pressurep2
 * @property string $pressurep3
 * @property string $pressurep4
 * @property string $pressures1
 * @property string $pressures2
 * @property string $pressures3
 * @property string $pressures4
 * @property string $inspaspernr1
 * @property string $inspaspernr2
 * @property string $inspaspernr3
 * @property string $inspaspernr4
 * @property string $Nonconformanceform1
 * @property string $Nonconformanceform2
 * @property string $Nonconformanceform3
 * @property string $Nonconformanceform4
 * @property string $Weldclamped1
 * @property string $Weldclamped2
 * @property string $Weldclamped3
 * @property string $Weldclamped4
 * @property string $macsreported1
 * @property string $macsreported2
 * @property string $macsreported3
 * @property string $macsreported4
 * @property string $esr1
 * @property string $esr2
 * @property string $esr3
 * @property string $esr4
 * @property string $inspaspernrL2TRK00321
 * @property string $inspaspernrL2TRK00322
 * @property string $inspaspernrL2TRK00323
 * @property string $inspaspernrL2TRK00324
 * @property string $ResultofInspection1
 * @property string $ResultofInspection2
 * @property string $ResultofInspection3
 * @property string $ResultofInspection4
 * @property string $inspectiongdate1
 * @property string $inspectiongdate2
 * @property string $inspectiongdate3
 * @property string $inspectiongdate4
 * @property string $Shift
 * @property string $Day
 * @property string $Date
 * @property string $ShiftTimes
 * @property string $shiftFrom
 * @property string $shiftTo
 * @property string $BBRName
 * @property string $BBRSignature
 * @property string $BBRPostition
 * @property string $sheet
 * @property string $gkitno
 * @property string $mileage1
 * @property string $mileage2
 * @property string $mileage3
 * @property string $mileage4
 */
class Wel233 extends yii\base\Model
{
    public $id;
    public $injobno;
    public $client;
    public $repname;
    public $repposition;
    public $sheet2;
    public $signatureloc;
    public $wsignatureloc;
    public $wasignatureloc;
    public $noofwelds;
    public $goodwelds;
    public $badwelds;
    public $weldscompleted;
    public $w1date;
    public $w2date;
    public $w3date;
    public $w4date;
    public $w1time;
    public $w2time;
    public $w3time;
    public $w4time;
	public $seniorweldingcoordinator;
	public $maxlength;
	public $weekno;
	public $jcn;
	public $site;
	public $insdate;
	public $weldersname;
	public $welderssignature;
	public $weldersastname;
	public $weldersastsign;
	public $elr1;
	public $elr2;
	public $elr3;
	public $elr4;
	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 $type1;
	public $type2;
	public $type3;
	public $type4;
	public $linespeed1;
	public $linespeed2;
	public $linespeed3;
	public $linespeed4;
	public $sleeper1;
	public $sleeper2;
	public $sleeper3;
	public $sleeper4;
	public $consolidated1;
	public $consolidated2;
	public $consolidated3;
	public $consolidated4;
	public $fffr1;
	public $fffr2;
	public $fffr3;
	public $fffr4;
	public $profile1;
	public $profile2;
	public $profile3;
	public $profile4;
	public $profile5;
	public $profile6;
	public $profile7;
	public $profile8;
	public $grade1;
	public $grade2;
	public $grade3;
	public $grade4;
	public $grade5;
	public $grade6;
	public $grade7;
	public $grade8;
	public $insnrtrk1;
	public $insnrtrk2;
	public $insnrtrk3;
	public $insnrtrk4;
	public $result1;
	public $result2;
	public $result3;
	public $result4;
	public $nrtrk1;
	public $nrtrk2;
	public $nrtrk3;
	public $nrtrk4;
	public $nrtrk5;
	public $nrtrk6;
	public $nrtrk7;
	public $nrtrk8;
	public $clamped1;
	public $clamped2;
	public $clamped3;
	public $clamped4;
	public $ncfr1;
	public $ncfr2;
	public $ncfr3;
	public $ncfr4;
	public $ncfr5;
	public $ncfr6;
	public $ncfr7;
	public $ncfr8;
	public $wear1;
	public $wear2;
	public $wear3;
	public $wear4;
	public $wear5;
	public $wear6;
	public $wear7;
	public $wear8;
	public $gapprep1;
	public $gapprep2;
	public $gapprep3;
	public $gapprep4;
	public $gap1;
	public $gap2;
	public $gap3;
	public $gap4;
	public $wgap5;
	public $wgap6;
	public $wgap7;
	public $wgap8;
	public $wgap9;
	public $wgap10;
	public $wgap11;
	public $wgap12;
	public $wgap13;
	public $wgap14;
	public $wgap15;
	public $wgap16;
	public $align1;
	public $align2;
	public $align3;
	public $align4;
	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 $fuelgused1;
	public $fuelgused2;
	public $fuelgused3;
	public $fuelgused4;
	public $pbn1;
	public $pbn2;
	public $pbn3;
	public $pbn4;
	public $portion1;
	public $portion2;
	public $portion3;
	public $portion4;
	public $tappingtime1;
	public $tappingtime2;
	public $tappingtime3;
	public $tappingtime4;
	public $wstampno1;
	public $wstampno2;
	public $wstampno3;
	public $wstampno4;
	public $kitno1;
	public $kitno2;
	public $kitno3;
	public $kitno4;
	public $pressurep1;
	public $pressurep2;
	public $pressurep3;
	public $pressurep4;
	public $pressures1;
	public $pressures2;
	public $pressures3;
	public $pressures4;
	public $inspaspernr1;
	public $inspaspernr2;
	public $inspaspernr3;
	public $inspaspernr4;
	public $nonconformanceform1;
	public $nonconformanceform2;
	public $nonconformanceform3;
	public $nonconformanceform4;
	public $weldclamped1;
	public $weldclamped2;
	public $weldclamped3;
	public $weldclamped4;
	public $macsreported1;
	public $macsreported2;
	public $macsreported3;
	public $macsreported4;
	public $esr1;
	public $esr2;
	public $esr3;
	public $esr4;
	public $inspaspernrl2trk00321;
	public $inspaspernrl2trk00322;
	public $inspaspernrl2trk00323;
	public $inspaspernrl2trk00324;
	public $resultofinspection1;
	public $resultofinspection2;
	public $resultofinspection3;
	public $resultofinspection4;
	public $inspectiongdate1;
	public $inspectiongdate2;
	public $inspectiongdate3;
	public $inspectiongdate4;
	public $shift;
	public $day;
	public $date;
	public $shifttimes;
	public $shiftfrom;
	public $shiftto;
	public $bbrname;
	public $bbrsignature;
	public $bbrpostition;
	public $sheet;
	public $gkitno;
	public $mileage1;
	public $mileage2;
	public $mileage3;
	public $mileage4;
	public $mileage5;
	public $mileage6;
	public $mileage7;
	public $mileage8;
	public $mileage9;
	public $mileage10;
	public $mileage11;
	public $mileage12;
	public $mileage13;
	public $mileage14;
	public $mileage15;
	public $mileage16;
	public $created_at;
	public $created_by;
	public $esrrequired1;
	public $esrrequired2;
	public $esrrequired3;
	public $esrrequired4;
	public $starttime;
	public $finishtime;
	public $clientemail;
	public $welderemail;
	public $adminemail;
	public $name;
	public $tracktrolley;
	public $padno;
	public $deleted;
	public $snag1;
	public $snag2;
	public $snag3;
	public $snag4;
	public $created_by2;
	public $updated_by2;
    public $actid;
    public $updated_at;
    public $updated_by;
    public $deleted_by;
    public $deleted_at;
    public $snag1id;
    public $snag2id;
    public $snag3id;
    public $snag4id;

    public $gapdhead1, $gapdhead2, $gapdhead3, $gapdhead4;
    public $gapdweb1, $gapdweb2, $gapdweb3, $gapdweb4;
    public $gapdfoot1, $gapdfoot2, $gapdfoot3, $gapdfoot4;
    public $welddbno1, $welddbno2, $welddbno3, $welddbno4;
    public $inspreportno1, $inspreportno2, $inspreportno3, $inspreportno4;

    public $trackweldername1, $trackweldername2, $trackwelderstampno2, $trackwelderstampno1, $trackwelderdate1, $trackwelderdate2, $trackwelderdate3, $personincharge;
    public $printlayout = 'Portrait';
    public $form = 'Wel233';
    public $formType = 'Thermic';
    public $formname = 'Balfour Beatty Welder Return Form (WEL233)';

    public $formLayout = '/wel233/_form.php';
    public $viewLayout = '@modules/forms/views/wel233/_view.php';
    public $createpath = '/forms/wel233/create';
    public $dates = ['created_at', 'updated_at', 'deleted_at'];
	public $uniqueidentifiers = ['actid'];
    public $securefields = [];

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            
            [['seniorweldingcoordinator', 'maxlength', 'weekno', 'jcn', 'site', 'insdate', 'weldersname', 'welderssignature','weldersastsign', 'elr1', 'elr2', 'elr3', 'elr4', 'chord1', 'chord2', 'chord3', 'chord4', 'trackid1', 'trackid2', 'trackid3', 'trackid4', 'btol1', 'btol2', 'btol3', 'btol4', 'type1', 'type2', 'type3', 'type4', 'linespeed1', 'linespeed2', 'linespeed3', 'linespeed4', 'sleeper1', 'sleeper2', 'sleeper3', 'sleeper4', 'consolidated1', 'consolidated2', 'consolidated3', 'consolidated4', 'fffr1', 'fffr2', 'fffr3', 'fffr4', 'profile1', 'profile2', 'profile3', 'profile4', 'grade1', 'grade2', 'grade3', 'grade4', 'wear1', 'wear2', 'wear3', 'wear4', 'gapprep1', 'gapprep2', 'gapprep3', 'gapprep4', 'gap1', 'gap2', 'gap3', 'gap4', 'align1', 'align2', 'align3', 'align4', 'railtemp1', 'railtemp2', 'railtemp3', 'railtemp4', 'weldtype1', 'weldtype2', 'weldtype3', 'weldtype4', 'mould1', 'mould2', 'mould3', 'mould4', 'fuelgused1', 'fuelgused2', 'fuelgused3', 'fuelgused4', 'pbn1', 'pbn2', 'pbn3', 'pbn4', 'portion1', 'portion2', 'portion3', 'portion4', 'tappingtime1', 'tappingtime2', 'tappingtime3', 'tappingtime4', 'wstampno1', 'wstampno2', 'wstampno3', 'wstampno4', 'kitno1', 'kitno2', 'kitno3', 'kitno4', 'pressurep1', 'pressurep2', 'pressurep3', 'pressurep4', 'pressures1', 'pressures2', 'pressures3', 'pressures4', 'inspaspernr1', 'inspaspernr2', 'inspaspernr3', 'inspaspernr4', 'nonconformanceform1', 'nonconformanceform2', 'nonconformanceform3', 'nonconformanceform4', 'weldclamped1', 'weldclamped2', 'weldclamped3', 'weldclamped4', 'macsreported1', 'macsreported2', 'macsreported3', 'macsreported4', 'esrrequired1', 'esrrequired2', 'esrrequired3', 'esrrequired4', 'inspaspernrl2trk00321', 'inspaspernrl2trk00322', 'inspaspernrl2trk00323', 'inspaspernrl2trk00324', 'resultofinspection1', 'resultofinspection2', 'resultofinspection3', 'resultofinspection4', 'inspectiongdate1', 'inspectiongdate2', 'inspectiongdate3', 'inspectiongdate4', 'shift', 'day', 'date', 'shifttimes', 'shiftfrom', 'shiftto', 'bbrname', 'bbrsignature', 'bbrpostition', 'sheet', 'gkitno', 'mileage1', 'mileage2', 'mileage3', 'mileage4', 'grade5', 'grade6', 'grade7', 'grade8', 'profile5', 'profile6', 'profile7', 'profile8', 'wear5', 'wear6', 'wear7', 'wear8', 'ncfr1', 'ncfr2', 'ncfr3', 'ncfr4', 'nrtrk1', 'nrtrk2', 'nrtrk3', 'nrtrk4', 'clamped1', 'clamped2', 'clamped3', 'clamped4', 'esr1', 'esr2', 'esr3', 'esr4', 'insnrtrk1', 'insnrtrk2', 'insnrtrk3', 'insnrtrk4', 'result1', 'result2', 'result3', 'result4', 'repname', 'repposition', 'starttime', 'finishtime', 'clientemail', 'welderemail', 'adminemail', 'client', 'mileage5', 'mileage6', 'mileage7', 'mileage8', 'mileage9', 'mileage10', 'mileage11', 'mileage12', 'mileage13', 'mileage14', 'mileage15', 'mileage16', 'sheet2', 'name', 'w1date', 'w2date', 'w3date', 'w4date', 'w1time', 'w2time', 'w3time', 'w4time', 'tracktrolley', 'padno', 'wgap5', 'wgap6', 'wgap7', 'wgap8', 'wgap9', 'wgap10', 'wgap11', 'wgap12', 'wgap13', 'wgap14', 'wgap15', 'wgap16'], 'string'],
            [['welddbno1', 'welddbno2', 'welddbno3', 'welddbno4', 'trackweldername1', 'trackweldername2', 'trackwelderstampno2', 'trackwelderstampno1', 'personincharge'], 'string'],
            [['inspreportno1', 'inspreportno2', 'inspreportno3', 'inspreportno4', 'trackwelderdate1', 'trackwelderdate2', 'trackwelderdate3'], 'safe'],
            [['noofwelds', 'weldscompleted', 'badwelds', 'goodwelds', 'injobno', ], 'integer'],
            [['gapdhead1', 'gapdhead2', 'gapdhead3', 'gapdhead4', 'gapdweb1', 'gapdweb2', 'gapdweb3', 'gapdweb4','gapdfoot1', 'gapdfoot2', 'gapdfoot3', 'gapdfoot4',], 'safe'],
            [['wsignatureloc', 'signatureloc', 'wasignatureloc', 'weldersname', 'weldersastname', 'actid','updated_at', 'created_at', 'deleted_at'], 'safe'],
					//defaults 
			[['deleted', 'snag1', 'snag2','snag3', 'snag4'], 'boolean'],
			[['created_by', 'updated_by', 'id', 'snag1id', 'snag2id', 'snag3id', 'snag4id'],'safe'],
			//redundant
			[['created_by2', 'updated_by2'], 'integer'],
        ];
	
    }
/*
    public function attributes(){
        return [
            'id' => 'id',
            'injobno' => 'injobno',
            'client' => 'client',
            'repname' => 'repname',
            'repposition' => 'repposition',
            'sheet2' => 'sheet2',
            'signatureloc' => 'signatureloc',
            'wsignatureloc' => 'wsignatureloc',
            'wasignatureloc' => 'wasignatureloc',
            'noofwelds' => 'noofwelds',
            'goodwelds' => 'goodwelds',
            'badwelds' => 'badwelds',
            'weldscompleted' => 'weldscompleted',
            'w1date' => 'w1date',
            'w2date' => 'w2date',
            'w3date' => 'w3date',
            'w4date' => 'w4date',
            'w1time' => 'w1time',
            'w2time' => 'w2time',
            'w3time' => 'w3time',
            'w4time' => 'w4time',
            'seniorweldingcoordinator' => 'seniorweldingcoordinator',
            'maxlength' => 'maxlength',
            'weekno' => 'weekno',
            'jcn' => 'jcn',
            'site' => 'site',
            'insdate' => 'insdate',
            'weldersname' => 'weldersname',
            'welderssignature' => 'welderssignature',
            'weldersastname' => 'weldersastname',
            'weldersastsign' => 'weldersastsign',
            'elr1' => 'elr1',
            'elr2' => 'elr2',
            'elr3' => 'elr3',
            'elr4' => 'elr4',
            'chord1' => 'chord1',
            'chord2' => 'chord2',
            'chord3' => 'chord3',
            'chord4' => 'chord4',
            'trackid1' => 'trackid1',
            'trackid2' => 'trackid2',
            'trackid3' => 'trackid3',
            'trackid4' => 'trackid4',
            'btol1' => 'btol1',
            'btol2' => 'btol2',
            'btol3' => 'btol3',
            'btol4' => 'btol4',
            'type1' => 'type1',
            'type2' => 'type2',
            'type3' => 'type3',
            'type4' => 'type4',
            'linespeed1' => 'linespeed1',
            'linespeed2' => 'linespeed2',
            'linespeed3' => 'linespeed3',
            'linespeed4' => 'linespeed4',
            'sleeper1' => 'sleeper1',
            'sleeper2' => 'sleeper2',
            'sleeper3' => 'sleeper3',
            'sleeper4' => 'sleeper4',
            'consolidated1' => 'consolidated1',
            'consolidated2' => 'consolidated2',
            'consolidated3' => 'consolidated3',
            'consolidated4' => 'consolidated4',
            'fffr1' => 'fffr1',
            'fffr2' => 'fffr2',
            'fffr3' => 'fffr3',
            'fffr4' => 'fffr4',
            'profile1' => 'profile1',
            'profile2' => 'profile2',
            'profile3' => 'profile3',
            'profile4' => 'profile4',
            'profile5' => 'profile5',
            'profile6' => 'profile6',
            'profile7' => 'profile7',
            'profile8' => 'profile8',
            'grade1' => 'grade1',
            'grade2' => 'grade2',
            'grade3' => 'grade3',
            'grade4' => 'grade4',
            'grade5' => 'grade5',
            'grade6' => 'grade6',
            'grade7' => 'grade7',
            'grade8' => 'grade8',
            'insnrtrk1' => 'insnrtrk1',
            'insnrtrk2' => 'insnrtrk2',
            'insnrtrk3' => 'insnrtrk3',
            'insnrtrk4' => 'insnrtrk4',
            'result1' => 'result1',
            'result2' => 'result2',
            'result3' => 'result3',
            'result4' => 'result4',
            'nrtrk1' => 'nrtrk1',
            'nrtrk2' => 'nrtrk2',
            'nrtrk3' => 'nrtrk3',
            'nrtrk4' => 'nrtrk4',
            'nrtrk5' => 'nrtrk5',
            'nrtrk6' => 'nrtrk6',
            'nrtrk7' => 'nrtrk7',
            'nrtrk8' => 'nrtrk8',
            'clamped1' => 'clamped1',
            'clamped2' => 'clamped2',
            'clamped3' => 'clamped3',
            'clamped4' => 'clamped4',
            'ncfr1' => 'ncfr1',
            'ncfr2' => 'ncfr2',
            'ncfr3' => 'ncfr3',
            'ncfr4' => 'ncfr4',
            'ncfr5' => 'ncfr5',
            'ncfr6' => 'ncfr6',
            'ncfr7' => 'ncfr7',
            'ncfr8' => 'ncfr8',
            'wear1' => 'wear1',
            'wear2' => 'wear2',
            'wear3' => 'wear3',
            'wear4' => 'wear4',
            'wear5' => 'wear5',
            'wear6' => 'wear6',
            'wear7' => 'wear7',
            'wear8' => 'wear8',
            'gapprep1' => 'gapprep1',
            'gapprep2' => 'gapprep2',
            'gapprep3' => 'gapprep3',
            'gapprep4' => 'gapprep4',
            'gap1' => 'gap1',
            'gap2' => 'gap2',
            'gap3' => 'gap3',
            'gap4' => 'gap4',
            'wgap5' => 'wgap5',
            'wgap6' => 'wgap6',
            'wgap7' => 'wgap7',
            'wgap8' => 'wgap8',
            'wgap9' => 'wgap9',
            'wgap10' => 'wgap10',
            'wgap11' => 'wgap11',
            'wgap12' => 'wgap12',
            'wgap13' => 'wgap13',
            'wgap14' => 'wgap14',
            'wgap15' => 'wgap15',
            'wgap16' => 'wgap16',
            'align1' => 'align1',
            'align2' => 'align2',
            'align3' => 'align3',
            'align4' => 'align4',
            'railtemp1' => 'railtemp1',
            'railtemp2' => 'railtemp2',
            'railtemp3' => 'railtemp3',
            'railtemp4' => 'railtemp4',
            'weldtype1' => 'weldtype1',
            'weldtype2' => 'weldtype2',
            'weldtype3' => 'weldtype3',
            'weldtype4' => 'weldtype4',
            'mould1' => 'mould1',
            'mould2' => 'mould2',
            'mould3' => 'mould3',
            'mould4' => 'mould4',
            'fuelgused1' => 'fuelgused1',
            'fuelgused2' => 'fuelgused2',
            'fuelgused3' => 'fuelgused3',
            'fuelgused4' => 'fuelgused4',
            'pbn1' => 'pbn1',
            'pbn2' => 'pbn2',
            'pbn3' => 'pbn3',
            'pbn4' => 'pbn4',
            'portion1' => 'portion1',
            'portion2' => 'portion2',
            'portion3' => 'portion3',
            'portion4' => 'portion4',
            'tappingtime1' => 'tappingtime1',
            'tappingtime2' => 'tappingtime2',
            'tappingtime3' => 'tappingtime3',
            'tappingtime4' => 'tappingtime4',
            'wstampno1' => 'wstampno1',
            'wstampno2' => 'wstampno2',
            'wstampno3' => 'wstampno3',
            'wstampno4' => 'wstampno4',
            'kitno1' => 'kitno1',
            'kitno2' => 'kitno2',
            'kitno3' => 'kitno3',
            'kitno4' => 'kitno4',
            'pressurep1' => 'pressurep1',
            'pressurep2' => 'pressurep2',
            'pressurep3' => 'pressurep3',
            'pressurep4' => 'pressurep4',
            'pressures1' => 'pressures1',
            'pressures2' => 'pressures2',
            'pressures3' => 'pressures3',
            'pressures4' => 'pressures4',
            'inspaspernr1' => 'inspaspernr1',
            'inspaspernr2' => 'inspaspernr2',
            'inspaspernr3' => 'inspaspernr3',
            'inspaspernr4' => 'inspaspernr4',
            'nonconformanceform1' => 'nonconformanceform1',
            'nonconformanceform2' => 'nonconformanceform2',
            'nonconformanceform3' => 'nonconformanceform3',
            'nonconformanceform4' => 'nonconformanceform4',
            'weldclamped1' => 'weldclamped1',
            'weldclamped2' => 'weldclamped2',
            'weldclamped3' => 'weldclamped3',
            'weldclamped4' => 'weldclamped4',
            'macsreported1' => 'macsreported1',
            'macsreported2' => 'macsreported2',
            'macsreported3' => 'macsreported3',
            'macsreported4' => 'macsreported4',
            'esr1' => 'esr1',
            'esr2' => 'esr2',
            'esr3' => 'esr3',
            'esr4' => 'esr4',
            'inspaspernrl2trk00321' => 'inspaspernrl2trk00321',
            'inspaspernrl2trk00322' => 'inspaspernrl2trk00322',
            'inspaspernrl2trk00323' => 'inspaspernrl2trk00323',
            'inspaspernrl2trk00324' => 'inspaspernrl2trk00324',
            'resultofinspection1' => 'resultofinspection1',
            'resultofinspection2' => 'resultofinspection2',
            'resultofinspection3' => 'resultofinspection3',
            'resultofinspection4' => 'resultofinspection4',
            'inspectiongdate1' => 'inspectiongdate1',
            'inspectiongdate2' => 'inspectiongdate2',
            'inspectiongdate3' => 'inspectiongdate3',
            'inspectiongdate4' => 'inspectiongdate4',
            'shift' => 'shift',
            'day' => 'day',
            'date' => 'date',
            'shifttimes' => 'shifttimes',
            'shiftfrom' => 'shiftfrom',
            'shiftto' => 'shiftto',
            'bbrname' => 'bbrname',
            'bbrsignature' => 'bbrsignature',
            'bbrpostition' => 'bbrpostition',
            'sheet' => 'sheet',
            'gkitno' => 'gkitno',
            'mileage1' => 'mileage1',
            'mileage2' => 'mileage2',
            'mileage3' => 'mileage3',
            'mileage4' => 'mileage4',
            'mileage5' => 'mileage5',
            'mileage6' => 'mileage6',
            'mileage7' => 'mileage7',
            'mileage8' => 'mileage8',
            'mileage9' => 'mileage9',
            'mileage10' => 'mileage10',
            'mileage11' => 'mileage11',
            'mileage12' => 'mileage12',
            'mileage13' => 'mileage13',
            'mileage14' => 'mileage14',
            'mileage15' => 'mileage15',
            'mileage16' => 'mileage16',
            'created_at' => 'created_at',
            'created_by' => 'created_by',
            'esrrequired1' => 'esrrequired1',
            'esrrequired2' => 'esrrequired2',
            'esrrequired3' => 'esrrequired3',
            'esrrequired4' => 'esrrequired4',
            'starttime' => 'starttime',
            'finishtime' => 'finishtime',
            'clientemail' => 'clientemail',
            'welderemail' => 'welderemail',
            'adminemail' => 'adminemail',
            'name' => 'name',
            'tracktrolley' => 'tracktrolley',
            'padno' => 'padno',
            'deleted' => 'deleted',
            'snag1' => 'snag1',
            'snag2' => 'snag2',
            'snag3' => 'snag3',
            'snag4' => 'snag4',
            'shift' => 'shift',
            'day' => 'day',
            'shiftfrom' => 'shiftfrom',
            'shiftto' => 'shiftto',
            'created_by2' => 'created_by2',
            'updated_by2' => 'updated_by2',
            'inspaspernr1' => 'inspaspernr1',
            'inspaspernr2' => 'inspaspernr2',
            'inspaspernr3' => 'inspaspernr3',
            'inspaspernr4' => 'inspaspernr4',
            'nonconformanceform1' => 'nonconformanceform1',
            'nonconformanceform2' => 'nonconformanceform2',
            'nonconformanceform3' => 'nonconformanceform3',
            'nonconformanceform4' => 'nonconformanceform4',
            'weldclamped1' => 'weldclamped1',
            'weldclamped2' => 'weldclamped2',
            'weldclamped3' => 'weldclamped3',
            'weldclamped4' => 'weldclamped4',
            'inspaspernrl2trk00321' => 'inspaspernrl2trk00321',
            'inspaspernrl2trk00322' => 'inspaspernrl2trk00322',
            'inspaspernrl2trk00323' => 'inspaspernrl2trk00323',
            'inspaspernrl2trk00324' => 'inspaspernrl2trk00324',
            'resultofinspection1' => 'resultofinspection1',
            'resultofinspection2' => 'resultofinspection2',
            'resultofinspection3' => 'resultofinspection3',
            'resultofinspection4' => 'resultofinspection4',
            'date' => 'date',
            'shifttimes' => 'shifttimes',
            'bbrname' => 'bbrname',
            'bbrsignature' => 'bbrsignature',
            'bbrpostition' => 'bbrpostition',
            'actid' => 'actid',
            'updated_at' => 'updated_at',
            'updated_by' => 'updated_by',
            'deleted_by' => 'deleted_by',
            'deleted_at' => 'deleted_at',
            'snag1id' => 'snag1id',
            'snag2id' => 'snag2id',
            'snag3id' => 'snag3id',
            'snag4id' => 'snag4id',
        ];
    }
    */
    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'seniorweldingcoordinator' => 'Seniorweldingcoordinator',
            'maxlength' => 'Maxlength',
            'weekno' => 'Weekno',
            'jcn' => 'Jcn',
            'site' => 'Site',
            'insdate' => 'Installation Date',
            'weldersname' => 'Welders Name',
            'welderssignature' => 'Welderssignature',
            'weldersastname' => 'Welders Assists Name',
            'weldersastsign' => 'Weldersastsign',
            'elr1' => 'Elr1',
            'elr2' => 'Elr2',
            'elr3' => 'Elr3',
            'elr4' => 'Elr4',
            'chord1' => 'Chord1',
            'chord2' => 'Chord2',
            'chord3' => 'Chord3',
            'chord4' => 'Chord4',
            'trackid1' => 'Trackid1',
            'trackid2' => 'Trackid2',
            'trackid3' => 'Trackid3',
            'trackid4' => 'Trackid4',
            'btol1' => 'Btol1',
            'btol2' => 'Btol2',
            'btol3' => 'Btol3',
            'btol4' => 'Btol4',
            'type1' => 'Type1',
            'type2' => 'Type2',
            'type3' => 'Type3',
            'type4' => 'Type4',
            'linespeed1' => 'Linespeed1',
            'linespeed2' => 'Linespeed2',
            'linespeed3' => 'Linespeed3',
            'linespeed4' => 'Linespeed4',
            'sleeper1' => 'Sleeper1',
            'sleeper2' => 'Sleeper2',
            'sleeper3' => 'Sleeper3',
            'sleeper4' => 'Sleeper4',
            'consolidated1' => 'Consolidated1',
            'consolidated2' => 'Consolidated2',
            'consolidated3' => 'Consolidated3',
            'consolidated4' => 'Consolidated4',
            'fffr1' => 'Fffr1',
            'fffr2' => 'Fffr2',
            'fffr3' => 'Fffr3',
            'fffr4' => 'Fffr4',
            'profile1' => 'Profile1',
            'profile2' => 'Profile2',
            'profile3' => 'Profile3',
            'profile4' => 'Profile4',
            'grade1' => 'Grade1',
            'grade2' => 'Grade2',
            'grade3' => 'Grade3',
            'grade4' => 'Grade4',
            'wear1' => 'Wear1',
            'wear2' => 'Wear2',
            'wear3' => 'Wear3',
            'wear4' => 'Wear4',
            'gapprep1' => 'Gapprep1',
            'gapprep2' => 'Gapprep2',
            'gapprep3' => 'Gapprep3',
            'gapprep4' => 'Gapprep4',
            'gap1' => 'Gap1',
            'gap2' => 'Gap2',
            'gap3' => 'Gap3',
            'gap4' => 'Gap4',
            'align1' => 'Align1',
            'align2' => 'Align2',
            'align3' => 'Align3',
            'align4' => 'Align4',
            'railtemp1' => 'Railtemp1',
            'railtemp2' => 'Railtemp2',
            'railtemp3' => 'Railtemp3',
            'railtemp4' => 'Railtemp4',
            'weldtype1' => 'Weldtype1',
            'weldtype2' => 'Weldtype2',
            'weldtype3' => 'Weldtype3',
            'weldtype4' => 'Weldtype4',
            'mould1' => 'Mould1',
            'mould2' => 'Mould2',
            'mould3' => 'Mould3',
            'mould4' => 'Mould4',
            'fuelgused1' => 'Fuelgused1',
            'fuelgused2' => 'Fuelgused2',
            'fuelgused3' => 'Fuelgused3',
            'fuelgused4' => 'Fuelgused4',
            'pbn1' => 'Pbn1',
            'pbn2' => 'Pbn2',
            'pbn3' => 'Pbn3',
            'pbn4' => 'Pbn4',
            'portion1' => 'Portion1',
            'portion2' => 'Portion2',
            'portion3' => 'Portion3',
            'portion4' => 'Portion4',
            'tappingtime1' => 'Tappingtime1',
            'tappingtime2' => 'Tappingtime2',
            'tappingtime3' => 'Tappingtime3',
            'tappingtime4' => 'Tappingtime4',
            'wstampno1' => 'Wstampno1',
            'wstampno2' => 'Wstampno2',
            'wstampno3' => 'Wstampno3',
            'wstampno4' => 'Wstampno4',
            'kitno1' => 'Kitno1',
            'kitno2' => 'Kitno2',
            'kitno3' => 'Kitno3',
            'kitno4' => 'Kitno4',
            'pressurep1' => 'Pressurep1',
            'pressurep2' => 'Pressurep2',
            'pressurep3' => 'Pressurep3',
            'pressurep4' => 'Pressurep4',
            'pressures1' => 'Pressures1',
            'pressures2' => 'Pressures2',
            'pressures3' => 'Pressures3',
            'pressures4' => 'Pressures4',
            'inspaspernr1' => 'Inspasper Nr1',
            'inspaspernr2' => 'Inspasper Nr2',
            'inspaspernr3' => 'Inspasper Nr3',
            'inspaspernr4' => 'Inspasper Nr4',
            'Nonconformanceform1' => 'Nonconformanceform1',
            'Nonconformanceform2' => 'Nonconformanceform2',
            'Nonconformanceform3' => 'Nonconformanceform3',
            'Nonconformanceform4' => 'Nonconformanceform4',
            'Weldclamped1' => 'Weldclamped1',
            'Weldclamped2' => 'Weldclamped2',
            'Weldclamped3' => 'Weldclamped3',
            'Weldclamped4' => 'Weldclamped4',
            'macsreported1' => 'macsreported1',
            'macsreported2' => 'macsreported2',
            'macsreported3' => 'macsreported3',
            'macsreported4' => 'macsreported4',
            'esr1' => 'esr1',
            'esr2' => 'esr2',
            'esr3' => 'esr3',
            'esr4' => 'esr4',
            'inspaspernrL2TRK00321' => 'Inspasper Nrl2 Trk00321',
            'inspaspernrL2TRK00322' => 'Inspasper Nrl2 Trk00322',
            'inspaspernrL2TRK00323' => 'Inspasper Nrl2 Trk00323',
            'inspaspernrL2TRK00324' => 'Inspasper Nrl2 Trk00324',
            'ResultofInspection1' => 'Resultof Inspection1',
            'ResultofInspection2' => 'Resultof Inspection2',
            'ResultofInspection3' => 'Resultof Inspection3',
            'ResultofInspection4' => 'Resultof Inspection4',
            'inspectiongdate1' => 'Inspectiongdate1',
            'inspectiongdate2' => 'Inspectiongdate2',
            'inspectiongdate3' => 'Inspectiongdate3',
            'inspectiongdate4' => 'Inspectiongdate4',
            'Shift' => 'Shift',
            'Day' => 'Day',
            'Date' => 'Date',
            'ShiftTimes' => 'Shift Times',
            'shiftFrom' => 'Shift From',
            'shiftTo' => 'Shift To',
            'BBRName' => 'Bbrname',
            'BBRSignature' => 'Bbrsignature',
            'BBRPostition' => 'Bbrpostition',
            'sheet' => 'Sheet',
            'gkitno' => 'Gkitno',
            'mileage1' => 'Mileage1',
            'mileage2' => 'Mileage2',
            'mileage3' => 'Mileage3',
            'mileage4' => 'Mileage4',
            'created_at' => 'Created On',
            'created_by' => 'Created By',
            'gapdhead1' => 'Gap Dimensions Head 1', 
            'gapdhead2' => 'Gap Dimensions Head 2', 
            'gapdhead3' => 'Gap Dimensions Head 3', 
            'gapdhead4' => 'Gap Dimensions Head 4', 
            'gapdweb1' => 'Gap Dimensions Web 1', 
            'gapdweb2' => 'Gap Dimensions Web 2', 
            'gapdweb3' => 'Gap Dimensions Web 3', 
            'gapdweb4' => 'Gap Dimensions Web 4',
            'gapdfoot1' => 'Gap Dimensions Foot 1', 
            'gapdfoot2' => 'Gap Dimensions Foot 2', 
            'gapdfoot3' => 'Gap Dimensions Foot 3', 
            'gapdfoot4' => 'Gap Dimensions Foot 4',
            'welddbno1' => 'welddbno',
            'welddbno2' => 'welddbno',
            'welddbno3' => 'welddbno',
            'welddbno4' => 'welddbno',
            //'wsignatureloc', 
            //'signatureloc',
            //'clientemail', 
            //'adminemail', 
            //'welderemail',
                    ];
    }
    public function getActivity()
    {
		return Activities::findOne(['id' => $this->actid]);
	}
    
    public function beforeValidate() {
		if (Yii::$app->name  !== 'app-console') {
			$this->w1date == '' ? $this->w1time = null : false;
			$this->w2date == '' ? $this->w2time = null : false;
			$this->w3date == '' ? $this->w3time = null : false;
			$this->w4date == '' ? $this->w4time = null : false;
		} 
        return parent::beforeValidate();
	}
	
	public function getAccount() {
		return Accounts::findOne(['accountid' => $this->company])
		->Via('activity');
	} 
	public function getUser() {
        return User::findOne(['id' => $this->created_by]);
    }
    
        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', 'noofwelds', 'shift'])->where(['id' => $this->actid])->asArray()->one();
           $this->injobno = $act['jobno'];
           $this->jcn = $act['jobno'];
           $this->client = $act['relatedid'];
           $this->site = $act['location'];
        //   $this->elr = $act['elr'];
           $this->insdate = date('d/m/Y H:i', strtotime($act['sdate']));
           $this->weekno = $act['weekno'];
           //$this->jobtype = $act['jobtype'];
           $this->noofwelds = $act['noofwelds'];
           $this->shift = $act['shift'];
        }
        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;
    }
}