<?php


namespace modules\forms\models;


use Yii;

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

class Dt142 extends Model {


/**
 * This is the model class For table "dt142".
 */
public $id;
public $noofwelds;
public $goodwelds;
public $badwelds;
public $weldscompleted;
public $area;
public $client;
public $stampno;
public $wsignatureloc;
public $repdate;
public $comments;
public $elr1;
public $elr2;
public $elr3;
public $elr4;
public $elr5;
public $elr6;
public $elr7;
public $elr8;
public $mileage1mm;
public $mileage1b;
public $mileage1yc;
public $mileage2mm;
public $mileage2b;
public $mileage2yc;
public $mileage3mm;
public $mileage3b;
public $mileage3yc;
public $mileage4mm;
public $mileage4b;
public $mileage4yc;
public $mileage5mm;
public $mileage5b;
public $mileage5yc;
public $mileage6mm;
public $mileage6b;
public $mileage6yc;
public $mileage7mm;
public $mileage7b;
public $mileage7yc;
public $mileage8mm;
public $mileage8b;
public $mileage8yc;
public $comments1;
public $comments2;
public $comments3;
public $comments4;
public $comments5;
public $comments6;
public $comments7;
public $comments8;
public $consumablesdiameter1;
public $consumablesdiameter2;
public $consumablesdiameter3;
public $consumablesdiameter4;
public $consumablesdiameter5;
public $consumablesdiameter6;
public $consumablesdiameter7;
public $consumablesdiameter8;
public $consumablestype1;
public $consumablestype2;
public $consumablestype3;
public $consumablestype4;
public $consumablestype5;
public $consumablestype6;
public $consumablestype7;
public $consumablestype8;
public $databaseno1;
public $databaseno2;
public $databaseno3;
public $databaseno4;
public $databaseno5;
public $databaseno6;
public $databaseno7;
public $databaseno8;
public $date;
public $dateinspected1;
public $dateinspected2;
public $dateinspected3;
public $dateinspected4;
public $dateinspected5;
public $dateinspected6;
public $dateinspected7;
public $dateinspected8;
public $dbref;
public $defectdepth1;
public $defectdepth2;
public $defectdepth3;
public $defectdepth4;
public $defectdepth5;
public $defectdepth6;
public $defectdepth7;
public $defectdepth8;
public $defectlength1;
public $defectlength2;
public $defectlength3;
public $defectlength4;
public $defectlength5;
public $defectlength6;
public $defectlength7;
public $defectlength8;
public $defectno1;
public $defectno2;
public $defectno3;
public $defectno4;
public $defectno5;
public $defectno6;
public $defectno7;
public $defectno8;
public $defectype1;
public $defectype2;
public $defectype3;
public $defectype4;
public $defectype5;
public $defectype6;
public $defectype7;
public $defectype8;
public $ellipseby;
public $ellipsedate;
public $ellipseno;
public $elr_trackid1;
public $elr_trackid2;
public $elr_trackid3;
public $elr_trackid4;
public $elr_trackid5;
public $elr_trackid6;
public $elr_trackid7;
public $elr_trackid8;
public $excavationldepth1;
public $excavationldepth2;
public $excavationldepth3;
public $excavationldepth4;
public $excavationldepth5;
public $excavationldepth6;
public $excavationldepth7;
public $excavationldepth8;
public $excavationlength1;
public $excavationlength2;
public $excavationlength3;
public $excavationlength4;
public $excavationlength5;
public $excavationlength6;
public $excavationlength7;
public $excavationlength8;
public $finish_time;
public $formbnos;
public $signatureloc;
public $from;
public $generator;
public $gpseast1;
public $gpseast2;
public $gpseast3;
public $gpseast4;
public $gpseast5;
public $gpseast6;
public $gpseast7;
public $gpseast8;
public $gpswest1;
public $gpswest2;
public $gpswest3;
public $gpswest4;
public $gpswest5;
public $gpswest6;
public $gpswest7;
public $gpswest8;
public $dt142_inno;
public $insepectedby1;
public $insepectedby2;
public $insepectedby3;
public $insepectedby4;
public $insepectedby5;
public $insepectedby6;
public $insepectedby7;
public $insepectedby8;
public $inspectdate;
public $inspectedby1;
public $inspectedby2;
public $inspectedby3;
public $inspectedby4;
public $inspectedby5;
public $inspectedby6;
public $inspectedby7;
public $inspectedby8;
public $inspectname;
public $jcn;
public $lastustestdate1;
public $lastustestdate2;
public $lastustestdate3;
public $lastustestdate4;
public $lastustestdate5;
public $lastustestdate6;
public $lastustestdate7;
public $lastustestdate8;
public $location1;
public $location2;
public $location3;
public $location4;
public $location5;
public $location6;
public $location7;
public $location8;
public $mileage1;
public $mileage2;
public $mileage3;
public $mileage4;
public $mileage5;
public $mileage6;
public $mileage7;
public $mileage8;
public $minactioncode2fetc1;
public $minactioncode2fetc2;
public $minactioncode2fetc3;
public $minactioncode2fetc4;
public $minactioncode2fetc5;
public $minactioncode2fetc6;
public $minactioncode2fetc7;
public $minactioncode2fetc8;
public $preheater;
public $preheattemp1;
public $preheattemp2;
public $preheattemp3;
public $preheattemp4;
public $preheattemp5;
public $preheattemp6;
public $preheattemp7;
public $preheattemp8;
public $rail_grade1;
public $rail_grade2;
public $rail_grade3;
public $rail_grade4;
public $rail_grade5;
public $rail_grade6;
public $rail_grade7;
public $rail_grade8;
public $rail_section1;
public $rail_section2;
public $rail_section3;
public $rail_section4;
public $rail_section5;
public $rail_section6;
public $rail_section7;
public $rail_section8;
public $rep;
public $repair_completed1;
public $repair_completed2;
public $repair_completed3;
public $repair_completed4;
public $repair_completed5;
public $repair_completed6;
public $repair_completed7;
public $repair_completed8;
public $repname;
public $result01;
public $result02;
public $result03;
public $result04;
public $result05;
public $result06;
public $result07;
public $result08;
public $result1;
public $result2;
public $result3;
public $result4;
public $result5;
public $result6;
public $result7;
public $result701;
public $result702;
public $result703;
public $result704;
public $result705;
public $result706;
public $result707;
public $result708;
public $result8;
public $rfdref1;
public $rfdref2;
public $rfdref3;
public $rfdref4;
public $rfdref5;
public $rfdref6;
public $rfdref7;
public $rfdref8;
public $sheet;
public $start_time;
public $tel_no;
public $dt142_tmetsm;
public $total_travel;
public $ultrasonic1;
public $ultrasonic2;
public $ultrasonic3;
public $ultrasonic4;
public $ultrasonic5;
public $ultrasonic6;
public $ultrasonic7;
public $ultrasonic8;
public $uscomments1;
public $uscomments2;
public $uscomments3;
public $uscomments4;
public $uscomments5;
public $uscomments6;
public $uscomments7;
public $uscomments8;
public $usdateinspected1;
public $usdateinspected2;
public $usdateinspected3;
public $usdateinspected4;
public $usdateinspected5;
public $usdateinspected6;
public $usdateinspected7;
public $usdateinspected8;
public $week_no;
public $welders_name;
public $welders_signature;
public $wfu;
public $rail1;
public $rail2;
public $rail3;
public $rail4;
public $rail5;
public $rail6;
public $rail7;
public $rail8;
public $tracktrolley;
public $padno;
public $snag1;
public $snag2;
public $snag3;
public $snag4;
public $snag5;
public $snag6;
public $snag7;
public $snag8;
public $snag1id;
public $snag2id;
public $snag3id;
public $snag4id;
public $snag5id;
public $snag6id;
public $snag7id;
public $snag8id;


public $deleted_at;
public $deleted_by;
public $created_at;
public $created_by;
public $updated_at;
public $updated_by;
public $created_by2;
public $updated_by2;
public $actid;
public $status;
public $deleted;


    public $form = 'Dt142';
    public $formname = 'Welders Work Return - Plain Line Repairs (DT142)';
    public $formType = 'Arc';



    public $printlayout = 'Portrait';
    public $formLayout = '/dt142/_form.php';
    public $viewLayout = '@modules/forms/views/dt142/_view.php';
    public $createpath = '/forms/dt142/create';
    
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['date', 'dateinspected1', 'dateinspected2', 'dateinspected3', 'dateinspected4', 'dateinspected5', 'dateinspected6', 'dateinspected7', 'dateinspected8', 'ellipsedate', 'inspectdate', 'inspectedby1', 'inspectedby2', 'inspectedby3', 'inspectedby4', 'inspectedby5', 'inspectedby6', 'inspectedby7', 'inspectedby8', 'inspectname', 'lastustestdate1', 'lastustestdate2', 'lastustestdate3', 'lastustestdate4', 'lastustestdate5', 'lastustestdate6', 'lastustestdate7', 'lastustestdate8', 'usdateinspected1', 'usdateinspected2', 'usdateinspected3', 'usdateinspected4', 'usdateinspected5', 'usdateinspected6', 'usdateinspected7', 'usdateinspected8', 'welders_name'], 'safe'],
            [['area', 'client', 'consumablesdiameter1', 'consumablesdiameter2', 'consumablesdiameter3', 'consumablesdiameter4', 'consumablesdiameter5', 'consumablesdiameter6', 'consumablesdiameter7', 'consumablesdiameter8', 'consumablestype1', 'consumablestype2', 'consumablestype3', 'consumablestype4', 'consumablestype5', 'consumablestype6', 'consumablestype7', 'consumablestype8', 'databaseno1', 'databaseno2', 'databaseno3', 'databaseno4', 'databaseno5', 'databaseno6', 'databaseno7', 'databaseno8', 'dbref', 'defectdepth1', 'defectdepth2', 'defectdepth3', 'defectdepth4', 'defectdepth5', 'defectdepth6', 'defectdepth7', 'defectdepth8', 'defectlength1', 'defectlength2', 'defectlength3', 'defectlength4', 'defectlength5', 'defectlength6', 'defectlength7', 'defectlength8', 'defectno1', 'defectno2', 'defectno3', 'defectno4', 'defectno5', 'defectno6', 'defectno7', 'defectno8', 'defectype1', 'defectype2', 'defectype3', 'defectype4', 'defectype5', 'defectype6', 'defectype7', 'defectype8', 'ellipseby', 'ellipseno', 'elr_trackid1', 'elr_trackid2', 'elr_trackid3', 'elr_trackid4', 'elr_trackid5', 'elr_trackid6', 'elr_trackid7', 'elr_trackid8', 'excavationldepth1', 'excavationldepth2', 'excavationldepth3', 'excavationldepth4', 'excavationldepth5', 'excavationldepth6', 'excavationldepth7', 'excavationldepth8', 'excavationlength1', 'excavationlength2', 'excavationlength3', 'excavationlength4', 'excavationlength5', 'excavationlength6', 'excavationlength7', 'excavationlength8', 'finish_time', 'formbnos', 'from', 'generator', 'gpseast1', 'gpseast2', 'gpseast3', 'gpseast4', 'gpseast5', 'gpseast6', 'gpseast7', 'gpseast8', 'gpswest1', 'gpswest2', 'gpswest3', 'gpswest4', 'gpswest5', 'gpswest6', 'gpswest7', 'gpswest8', 'dt142_inno', 'insepectedby1', 'insepectedby2', 'insepectedby3', 'insepectedby4', 'insepectedby5', 'insepectedby6', 'insepectedby7', 'insepectedby8', 'jcn', 'location1', 'location2', 'location3', 'location4', 'location5', 'location6', 'location7', 'location8', 'mileage1', 'mileage1b', 'mileage1mm', 'mileage1yc', 'mileage2', 'mileage2b', 'mileage2mm', 'mileage2yc', 'mileage3', 'mileage3b', 'mileage3mm', 'mileage3yc', 'mileage4', 'mileage4b', 'mileage4mm', 'mileage4yc','mileage5', 'mileage5b', 'mileage5mm', 'mileage5yc', 'mileage6', 'mileage6b', 'mileage6mm', 'mileage6yc', 'mileage7', 'mileage7b', 'mileage7mm', 'mileage7yc', 'mileage8', 'mileage8b', 'mileage8mm', 'mileage8yc',  'minactioncode2fetc1', 'minactioncode2fetc2', 'minactioncode2fetc3', 'minactioncode2fetc4', 'minactioncode2fetc5', 'minactioncode2fetc6', 'minactioncode2fetc7', 'minactioncode2fetc8', 'preheater', 'preheattemp1', 'preheattemp2', 'preheattemp3', 'preheattemp4', 'preheattemp5', 'preheattemp6', 'preheattemp7', 'preheattemp8', 'rail_grade1', 'rail_grade2', 'rail_grade3', 'rail_grade4', 'rail_grade5', 'rail_grade6', 'rail_grade7', 'rail_grade8', 'rail_section1', 'rail_section2', 'rail_section3', 'rail_section4', 'rail_section5', 'rail_section6', 'rail_section7', 'rail_section8', 'rep', 'repair_completed1', 'repair_completed2', 'repair_completed3', 'repair_completed4', 'repair_completed5', 'repair_completed6', 'repair_completed7', 'repair_completed8', 'repname', 'result01', 'result02', 'result03', 'result04', 'result05', 'result06', 'result07', 'result08', 'result1', 'result2', 'result3', 'result4', 'result5', 'result6', 'result7', 'result701', 'result702', 'result703', 'result704', 'result705', 'result706', 'result707', 'result708', 'result8', 'rfdref1', 'rfdref2', 'rfdref3', 'rfdref4', 'rfdref5', 'rfdref6', 'rfdref7', 'rfdref8', 'sheet', 'start_time', 'tel_no', 'dt142_tmetsm', 'total_travel', 'ultrasonic1', 'ultrasonic2', 'ultrasonic3', 'ultrasonic4', 'ultrasonic5', 'ultrasonic6', 'ultrasonic7', 'ultrasonic8', 'uscomments1', 'uscomments2', 'uscomments3', 'uscomments4', 'uscomments5', 'uscomments6', 'uscomments7', 'uscomments8', 'week_no', 'welders_signature', 'wfu',  'stampno'], 'string', 'max' => 100],
			[['comments', 'comments1', 'comments2', 'comments3', 'comments4', 'comments5', 'comments6', 'comments7', 'comments8'], 'string'],
            [['rail1', 'rail2', 'rail3', 'rail4', 'rail5', 'rail6', 'rail7', 'rail8', 'repdate'], 'string', 'max' => 45],
		    [[ 'elr1', 'elr2', 'elr3', 'elr4', 'elr5', 'elr6', 'elr7', 'elr8',], 'string'],
			[['signatureloc', 'wsignatureloc', 'actid', 'padno'], 'safe'],
			[['noofwelds', 'weldscompleted', 'badwelds', 'goodwelds'], 'integer'],
								//Defaults
			[['created_at', 'updated_at', 'deleted_at', 'created_by', 'updated_by', 'id'],'safe'],


        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'area' => 'Area',
            'client' => 'Client',
            'comments' => 'Comments',
            'comments1' => 'Comments1',
            'comments2' => 'Comments2',
            'comments3' => 'Comments3',
            'comments4' => 'Comments4',
            'comments5' => 'Comments5',
            'comments6' => 'Comments6',
            'comments7' => 'Comments7',
            'comments8' => 'Comments8',
            'consumablesdiameter1' => 'Consumablesdiameter1',
            'consumablesdiameter2' => 'Consumablesdiameter2',
            'consumablesdiameter3' => 'Consumablesdiameter3',
            'consumablesdiameter4' => 'Consumablesdiameter4',
            'consumablesdiameter5' => 'Consumablesdiameter5',
            'consumablesdiameter6' => 'Consumablesdiameter6',
            'consumablesdiameter7' => 'Consumablesdiameter7',
            'consumablesdiameter8' => 'Consumablesdiameter8',
            'consumablestype1' => 'Consumablestype1',
            'consumablestype2' => 'Consumablestype2',
            'consumablestype3' => 'Consumablestype3',
            'consumablestype4' => 'Consumablestype4',
            'consumablestype5' => 'Consumablestype5',
            'consumablestype6' => 'Consumablestype6',
            'consumablestype7' => 'Consumablestype7',
            'consumablestype8' => 'Consumablestype8',
            'databaseno1' => 'Databaseno1',
            'databaseno2' => 'Databaseno2',
            'databaseno3' => 'Databaseno3',
            'databaseno4' => 'Databaseno4',
            'databaseno5' => 'Databaseno5',
            'databaseno6' => 'Databaseno6',
            'databaseno7' => 'Databaseno7',
            'databaseno8' => 'Databaseno8',
            'date' => 'Date',
            'dateinspected1' => 'Dateinspected1',
            'dateinspected2' => 'Dateinspected2',
            'dateinspected3' => 'Dateinspected3',
            'dateinspected4' => 'Dateinspected4',
            'dateinspected5' => 'Dateinspected5',
            'dateinspected6' => 'Dateinspected6',
            'dateinspected7' => 'Dateinspected7',
            'dateinspected8' => 'Dateinspected8',
            'dbref' => 'Dbref',
            'defectdepth1' => 'Defectdepth1',
            'defectdepth2' => 'Defectdepth2',
            'defectdepth3' => 'Defectdepth3',
            'defectdepth4' => 'Defectdepth4',
            'defectdepth5' => 'Defectdepth5',
            'defectdepth6' => 'Defectdepth6',
            'defectdepth7' => 'Defectdepth7',
            'defectdepth8' => 'Defectdepth8',
            'defectlength1' => 'Defectlength1',
            'defectlength2' => 'Defectlength2',
            'defectlength3' => 'Defectlength3',
            'defectlength4' => 'Defectlength4',
            'defectlength5' => 'Defectlength5',
            'defectlength6' => 'Defectlength6',
            'defectlength7' => 'Defectlength7',
            'defectlength8' => 'Defectlength8',
            'defectno1' => 'Defectno1',
            'defectno2' => 'Defectno2',
            'defectno3' => 'Defectno3',
            'defectno4' => 'Defectno4',
            'defectno5' => 'Defectno5',
            'defectno6' => 'Defectno6',
            'defectno7' => 'Defectno7',
            'defectno8' => 'Defectno8',
            'defectype1' => 'Defectype1',
            'defectype2' => 'Defectype2',
            'defectype3' => 'Defectype3',
            'defectype4' => 'Defectype4',
            'defectype5' => 'Defectype5',
            'defectype6' => 'Defectype6',
            'defectype7' => 'Defectype7',
            'defectype8' => 'Defectype8',
            'ellipseby' => 'Ellipseby',
            'ellipsedate' => 'Ellipsedate',
            'ellipseno' => 'Ellipseno',
            'elr_trackid1' => 'Elr Trackid1',
            'elr_trackid2' => 'Elr Trackid2',
            'elr_trackid3' => 'Elr Trackid3',
            'elr_trackid4' => 'Elr Trackid4',
            'elr_trackid5' => 'Elr Trackid5',
            'elr_trackid6' => 'Elr Trackid6',
            'elr_trackid7' => 'Elr Trackid7',
            'elr_trackid8' => 'Elr Trackid8',
            'excavationldepth1' => 'Excavationldepth1',
            'excavationldepth2' => 'Excavationldepth2',
            'excavationldepth3' => 'Excavationldepth3',
            'excavationldepth4' => 'Excavationldepth4',
            'excavationldepth5' => 'Excavationldepth5',
            'excavationldepth6' => 'Excavationldepth6',
            'excavationldepth7' => 'Excavationldepth7',
            'excavationldepth8' => 'Excavationldepth8',
            'excavationlength1' => 'Excavationlength1',
            'excavationlength2' => 'Excavationlength2',
            'excavationlength3' => 'Excavationlength3',
            'excavationlength4' => 'Excavationlength4',
            'excavationlength5' => 'Excavationlength5',
            'excavationlength6' => 'Excavationlength6',
            'excavationlength7' => 'Excavationlength7',
            'excavationlength8' => 'Excavationlength8',
            'finish_time' => 'Finish Time',
            'formbnos' => 'Formbnos',
            'from' => 'From',
            'generator' => 'Generator',
            'gpseast1' => 'Gpseast1',
            'gpseast2' => 'Gpseast2',
            'gpseast3' => 'Gpseast3',
            'gpseast4' => 'Gpseast4',
            'gpseast5' => 'Gpseast5',
            'gpseast6' => 'Gpseast6',
            'gpseast7' => 'Gpseast7',
            'gpseast8' => 'Gpseast8',
            'gpswest1' => 'Gpswest1',
            'gpswest2' => 'Gpswest2',
            'gpswest3' => 'Gpswest3',
            'gpswest4' => 'Gpswest4',
            'gpswest5' => 'Gpswest5',
            'gpswest6' => 'Gpswest6',
            'gpswest7' => 'Gpswest7',
            'gpswest8' => 'Gpswest8',
            'dt142_inno' => 'Dt142 Inno',
            'insepectedby1' => 'Insepectedby1',
            'insepectedby2' => 'Insepectedby2',
            'insepectedby3' => 'Insepectedby3',
            'insepectedby4' => 'Insepectedby4',
            'insepectedby5' => 'Insepectedby5',
            'insepectedby6' => 'Insepectedby6',
            'insepectedby7' => 'Insepectedby7',
            'insepectedby8' => 'Insepectedby8',
            'inspectdate' => 'Inspectdate',
            'inspectedby1' => 'Inspectedby1',
            'inspectedby2' => 'Inspectedby2',
            'inspectedby3' => 'Inspectedby3',
            'inspectedby4' => 'Inspectedby4',
            'inspectedby5' => 'Inspectedby5',
            'inspectedby6' => 'Inspectedby6',
            'inspectedby7' => 'Inspectedby7',
            'inspectedby8' => 'Inspectedby8',
            'inspectname' => 'Inspectname',
            'jcn' => 'Jcn',
            'lastustestdate1' => 'Lastustestdate1',
            'lastustestdate2' => 'Lastustestdate2',
            'lastustestdate3' => 'Lastustestdate3',
            'lastustestdate4' => 'Lastustestdate4',
            'lastustestdate5' => 'Lastustestdate5',
            'lastustestdate6' => 'Lastustestdate6',
            'lastustestdate7' => 'Lastustestdate7',
            'lastustestdate8' => 'Lastustestdate8',
            'location1' => 'Location1',
            'location2' => 'Location2',
            'location3' => 'Location3',
            'location4' => 'Location4',
            'location5' => 'Location5',
            'location6' => 'Location6',
            'location7' => 'Location7',
            'location8' => 'Location8',
            'mileage1' => 'Mileage1',
            'mileage2' => 'Mileage2',
            'mileage3' => 'Mileage3',
            'mileage4' => 'Mileage4',
            'mileage5' => 'Mileage5',
            'mileage6' => 'Mileage6',
            'mileage7' => 'Mileage7',
            'mileage8' => 'Mileage8',
            'minactioncode2fetc1' => 'Minactioncode2fetc1',
            'minactioncode2fetc2' => 'Minactioncode2fetc2',
            'minactioncode2fetc3' => 'Minactioncode2fetc3',
            'minactioncode2fetc4' => 'Minactioncode2fetc4',
            'minactioncode2fetc5' => 'Minactioncode2fetc5',
            'minactioncode2fetc6' => 'Minactioncode2fetc6',
            'minactioncode2fetc7' => 'Minactioncode2fetc7',
            'minactioncode2fetc8' => 'Minactioncode2fetc8',
            'preheater' => 'Preheater',
            'preheattemp1' => 'Preheattemp1',
            'preheattemp2' => 'Preheattemp2',
            'preheattemp3' => 'Preheattemp3',
            'preheattemp4' => 'Preheattemp4',
            'preheattemp5' => 'Preheattemp5',
            'preheattemp6' => 'Preheattemp6',
            'preheattemp7' => 'Preheattemp7',
            'preheattemp8' => 'Preheattemp8',
            'rail_grade1' => 'Rail Grade1',
            'rail_grade2' => 'Rail Grade2',
            'rail_grade3' => 'Rail Grade3',
            'rail_grade4' => 'Rail Grade4',
            'rail_grade5' => 'Rail Grade5',
            'rail_grade6' => 'Rail Grade6',
            'rail_grade7' => 'Rail Grade7',
            'rail_grade8' => 'Rail Grade8',
            'rail_section1' => 'Rail Section1',
            'rail_section2' => 'Rail Section2',
            'rail_section3' => 'Rail Section3',
            'rail_section4' => 'Rail Section4',
            'rail_section5' => 'Rail Section5',
            'rail_section6' => 'Rail Section6',
            'rail_section7' => 'Rail Section7',
            'rail_section8' => 'Rail Section8',
            'rep' => 'Rep',
            'repair_completed1' => 'Repair Completed1',
            'repair_completed2' => 'Repair Completed2',
            'repair_completed3' => 'Repair Completed3',
            'repair_completed4' => 'Repair Completed4',
            'repair_completed5' => 'Repair Completed5',
            'repair_completed6' => 'Repair Completed6',
            'repair_completed7' => 'Repair Completed7',
            'repair_completed8' => 'Repair Completed8',
            'repname' => 'Repname',
            'result01' => 'Result01',
            'result02' => 'Result02',
            'result03' => 'Result03',
            'result04' => 'Result04',
            'result05' => 'Result05',
            'result06' => 'Result06',
            'result07' => 'Result07',
            'result08' => 'Result08',
            'result1' => 'Result1',
            'result2' => 'Result2',
            'result3' => 'Result3',
            'result4' => 'Result4',
            'result5' => 'Result5',
            'result6' => 'Result6',
            'result7' => 'Result7',
            'result701' => 'Result701',
            'result702' => 'Result702',
            'result703' => 'Result703',
            'result704' => 'Result704',
            'result705' => 'Result705',
            'result706' => 'Result706',
            'result707' => 'Result707',
            'result708' => 'Result708',
            'result8' => 'Result8',
            'rfdref1' => 'Rfdref1',
            'rfdref2' => 'Rfdref2',
            'rfdref3' => 'Rfdref3',
            'rfdref4' => 'Rfdref4',
            'rfdref5' => 'Rfdref5',
            'rfdref6' => 'Rfdref6',
            'rfdref7' => 'Rfdref7',
            'rfdref8' => 'Rfdref8',
            'sheet' => 'Sheet',
            'start_time' => 'Start Time',
            'tel_no' => 'Tel No',
            'dt142_tmetsm' => 'Dt142 Tmetsm',
            'total_travel' => 'Total Travel',
            'ultrasonic1' => 'Ultrasonic1',
            'ultrasonic2' => 'Ultrasonic2',
            'ultrasonic3' => 'Ultrasonic3',
            'ultrasonic4' => 'Ultrasonic4',
            'ultrasonic5' => 'Ultrasonic5',
            'ultrasonic6' => 'Ultrasonic6',
            'ultrasonic7' => 'Ultrasonic7',
            'ultrasonic8' => 'Ultrasonic8',
            'uscomments1' => 'Uscomments1',
            'uscomments2' => 'Uscomments2',
            'uscomments3' => 'Uscomments3',
            'uscomments4' => 'Uscomments4',
            'uscomments5' => 'Uscomments5',
            'uscomments6' => 'Uscomments6',
            'uscomments7' => 'Uscomments7',
            'uscomments8' => 'Uscomments8',
            'usdateinspected1' => 'Usdateinspected1',
            'usdateinspected2' => 'Usdateinspected2',
            'usdateinspected3' => 'Usdateinspected3',
            'usdateinspected4' => 'Usdateinspected4',
            'usdateinspected5' => 'Usdateinspected5',
            'usdateinspected6' => 'Usdateinspected6',
            'usdateinspected7' => 'Usdateinspected7',
            'usdateinspected8' => 'Usdateinspected8',
            'week_no' => 'Week No',
            'welders_name' => 'Welders Name',
            'welders_signature' => 'Welders Signature',
            'wfu' => 'Wfu',
            'rail1' => 'Rail1',
            'rail2' => 'Rail2',
            'rail3' => 'Rail3',
            'rail4' => 'Rail4',
            'rail5' => 'Rail5',
            'rail6' => 'Rail6',
            'rail7' => 'Rail7',
            'rail8' => 'Rail8',
            'created_by' => 'Created By',
            'created_at' => 'Created On',
        ];
    }
    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 beforeValidate() {
		if (Yii::$app->name !== 'app-console' ) {
			if ($this->welders_name != '') {
                    $this->welders_name = implode(",", $this->welders_name);		
			} else {
				$this->welders_name = Yii::$app->user->identity->username;
			}
            $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','ordertitle', 'relatedid', 'location', 'sdate', 'elr', 'weekno'])->where(['id' => $this->actid])->asArray()->one();
           $this->dt142_inno = $act['jobno'];
          // $this->jcnno = $act['jobno'];
           $this->jcn = $act['ordertitle'];
           $this->client = $act['relatedid'];
           $this->week_no = $act['weekno'];
           $this->date = date('d/m/Y H:i', strtotime($act['sdate']));
        }
        return parent::init();
    }

		
		
	public function getMileage1A() {
		return($this->mileage1." ".$this->mileage1mm." ".$this->mileage1b." ".$this->mileage1yc);
		}
	public function getMileage2A() {
		return($this->mileage2." ".$this->mileage2mm." ".$this->mileage2b." ".$this->mileage2yc);
		}
	public function getMileage3A() {
		return($this->mileage3." ".$this->mileage3mm." ".$this->mileage3b." ".$this->mileage3yc);
		}			
	public function getMileage4A() {
		return($this->mileage4." ".$this->mileage4mm." ".$this->mileage4b." ".$this->mileage4yc);
		}
	public function getMileage5A() {
		return($this->mileage5." ".$this->mileage5mm." ".$this->mileage5b." ".$this->mileage5yc);
		}
	public function getMileage6A() {
		return($this->mileage6." ".$this->mileage6mm." ".$this->mileage6b." ".$this->mileage6yc);
		}
	public function getMileage7A() {
		return($this->mileage7." ".$this->mileage7mm." ".$this->mileage7b." ".$this->mileage7yc);
		}
	public function getMileage8A() {
		return($this->mileage8." ".$this->mileage8mm." ".$this->mileage8b." ".$this->mileage8yc);
		}
			

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