<?php

namespace modules\forms\models;

use Yii;
use \common\models\DynamicModel;
use \kartik\date\DatePicker;
use \yii\helpers\ArrayHelper;
use modules\activities\models\Activities;
use modules\users\models\User;
use modules\custom\models\Accounts;
/**
 * This is the model class For table "dt022".
 *
 * @property string $id
 * @property string $actid
 * @property string $date
 * @property string $location
 * @property string $welder
 * @property string $stampno
 * @property string $weldersasst
 * @property string $jobno
 * @property string $sentinelno
 * @property string $workdescription
 * @property integer $client
 * @property string $area
 * @property string $sitesuditor
 * @property string $auditorsign
 * @property string $auditoredsign
 * @property string $cced1
 * @property string $cced2
 * @property string $cced3
 * @property string $cced4
 * @property string $cced5
 * @property string $cced6
 * @property string $cced7
 * @property string $cced8
 * @property string $cced9
 * @property string $cced10
 * @property string $cced11
 * @property string $cced12
 * @property string $cced13
 * @property string $cced14
 * @property string $cced15
 * @property string $twrailtech
 * @property string $twtermit
 * @property string $twstandardgap
 * @property string $twwidegap
 * @property string $twmma
 * @property integer $ppe1
 * @property integer $ppe2
 * @property integer $ppe3
 * @property integer $ppe4
 * @property integer $ppe5
 * @property integer $ppe6
 * @property integer $ppe7
 * @property integer $ppe8
 * @property integer $ppe9
 * @property integer $ppe11
 * @property integer $ppe12
 * @property integer $ppe13
 * @property integer $ppe14
 * @property integer $ppe15
 * @property integer $ffu1
 * @property string $ffuid1
 * @property string $ffused1
 * @property integer $ffu2
 * @property integer $ffu3
 * @property integer $ffu4
 * @property integer $ffu5
 * @property integer $ffu6
 * @property integer $ffu7
 * @property integer $ffu8
 * @property integer $ffu9
 * @property integer $ffu10
 * @property integer $ffu11
 * @property integer $ffu12
 * @property integer $ffu13
 * @property integer $ffu14
 * @property integer $ffu15
 * @property string $ffuid2
 * @property string $ffuid3
 * @property string $ffuid4
 * @property string $ffuid5
 * @property string $ffuid6
 * @property string $ffuid7
 * @property string $ffuid8
 * @property string $ffuid9
 * @property string $ffuid10
 * @property string $ffuid11
 * @property string $ffuid12
 * @property string $ffuid13
 * @property string $ffuid14
 * @property string $ffuid15
 * @property string $ffused2
 * @property string $ffused3
 * @property string $ffused4
 * @property string $ffused5
 * @property string $ffused6
 * @property string $ffused7
 * @property string $ffused8
 * @property string $ffused9
 * @property string $ffused10
 * @property string $ffused11
 * @property string $ffused12
 * @property string $ffused13
 * @property string $ffused14
 * @property string $ffused15
 * @property string $tc1
 * @property string $tc2
 * @property string $tc3
 * @property string $tc4
 * @property string $tc5
 * @property string $tc6
 * @property string $tc7
 * @property string $tc8
 * @property string $tc9
 * @property string $tc10
 * @property string $rs1
 * @property string $rs2
 * @property string $rt1
 * @property string $rt2
 * @property string $tw1
 * @property string $rw2
 * @property string $rep1
 * @property string $gasfuel
 * @property string $comments
 * @property integer $created_at
 * @property integer $created_by
 * @property integer $updated_at
 * @property integer $updated_by
 * @property string $advcomments
 */
class Dt022 extends \Yii\base\Model 
{
    public $id;
    public $actid;
    public $date;
    public $location;
    public $welder;
    public $stampno;
    public $weldersasst;
    public $jobno;
    public $sentinelno;
    public $workdescription;
    public $client;
    public $area;
    public $sitesuditor;
    public $auditorsign;
    public $auditoredsign;
    public $cced1;
    public $cced2;
    public $cced3;
    public $cced4;
    public $cced5;
    public $cced6;
    public $cced7;
    public $cced8;
    public $cced9;
    public $cced10;
    public $cced11;
    public $cced12;
    public $cced13;
    public $cced14;
    public $cced15;
    public $twrailtech;
    public $twtermit;
    public $twstandardgap;
    public $twwidegap;
    public $twmma;
    public $ppe1;
    public $ppe2;
    public $ppe3;
    public $ppe4;
    public $ppe5;
    public $ppe6;
    public $ppe7;
    public $ppe8;
    public $ppe9;
    public $ppe10;
    public $ppe11;
    public $ppe12;
    public $ppe13;
    public $ppe14;
    public $ppe15;
    public $ffu1;
    public $ffuid1;
    public $ffused0;
    public $ffused1;
    public $ffu2;
    public $ffu3;
    public $ffu4;
    public $ffu5;
    public $ffu6;
    public $ffu7;
    public $ffu8;
    public $ffu9;
    public $ffu10;
    public $ffu11;
    public $ffu12;
    public $ffu13;
    public $ffu14;
    public $ffu15;
    public $ffuid2;
    public $ffuid3;
    public $ffuid4;
    public $ffuid5;
    public $ffuid6;
    public $ffuid7;
    public $ffuid8;
    public $ffuid9;
    public $ffuid10;
    public $ffuid11;
    public $ffuid12;
    public $ffuid13;
    public $ffuid14;
    public $ffuid15;
    public $ffused2;
    public $ffused3;
    public $ffused4;
    public $ffused5;
    public $ffused6;
    public $ffused7;
    public $ffused8;
    public $ffused9;
    public $ffused10;
    public $ffused11;
    public $ffused12;
    public $ffused13;
    public $ffused14;
    public $ffused15;
    public $tc1;
    public $tc2;
    public $tc3;
    public $tc4;
    public $tc5;
    public $tc6;
    public $tc7;
    public $tc8;
    public $tc9;
    public $tc10;
    public $rs1;
    public $rs2;
    public $rt1;
    public $rt2;
    public $tw1;
    public $rw2;
    public $rep1;
    public $gasfuel;
    public $comments;
    public $created_at;
    public $created_by;
    public $updated_at;
    public $updated_by;
    public $advcomments;
    public $rowData;
    public $hseqrows;
    public $wsorows;
    public $commentsrows;
    public $addcomments;
    public $deleted;
    public $deleted_at;
    public $deleted_by;
    public $updated_by2;
    public $created_by2;
    public $status;
    public $padno;
    public $relatedid;

    public $response1, $repsonsecomment1;
    public $response2, $repsonsecomment2;
    public $response3, $repsonsecomment3;
    public $response4, $repsonsecomment4;
    public $response5, $repsonsecomment5;
    public $response6, $repsonsecomment6;
    public $response7, $repsonsecomment7;
    public $response8, $repsonsecomment8;
    public $response9, $repsonsecomment9;
    public $response10, $repsonsecomment10;
    public $response11, $repsonsecomment11;
    public $response12, $repsonsecomment12;
    public $response13, $repsonsecomment13;
    public $response14, $repsonsecomment14;
    public $response15, $repsonsecomment15;
    public $response16, $repsonsecomment16;
    public $response17, $repsonsecomment17;
    public $response18, $repsonsecomment18;
    public $response19, $repsonsecomment19;
    public $response20, $repsonsecomment20;
    public $response21, $repsonsecomment21;
    public $response22, $repsonsecomment22;
    public $response23, $repsonsecomment23;
    public $response24, $repsonsecomment24;
    public $response25, $repsonsecomment25;
    public $response26, $repsonsecomment26;
    public $response27, $repsonsecomment27;
    public $response28, $repsonsecomment28;
    public $response29, $repsonsecomment29;
    public $response30, $repsonsecomment30;
    public $response31, $repsonsecomment31;
    public $response32, $repsonsecomment32;
    public $response33, $repsonsecomment33;
    public $response34, $repsonsecomment34;
    public $response35, $repsonsecomment35;
    public $response36, $repsonsecomment36;
    public $response37, $repsonsecomment37;
    public $response38, $repsonsecomment38;
    public $response39, $repsonsecomment39;
    public $response40, $repsonsecomment40;
    public $response41, $repsonsecomment41;
    public $response42, $repsonsecomment42;
    public $response43, $repsonsecomment43;
    public $response44, $repsonsecomment44;
    public $response45, $repsonsecomment45;
    public $response46, $repsonsecomment46;
    public $response47, $repsonsecomment47;
    public $response48, $repsonsecomment48;
    public $response49, $repsonsecomment49;
    public $response50, $repsonsecomment50;
    public $response51, $repsonsecomment51;
    public $response52, $repsonsecomment52;
    public $response53, $repsonsecomment53;
    public $response54, $repsonsecomment54;
    public $response55, $repsonsecomment55;
    public $response56, $repsonsecomment56;
    public $response57, $repsonsecomment57;
    public $response58, $repsonsecomment58;
    public $response59, $repsonsecomment59;
    public $response60, $repsonsecomment60;
    public $response61, $repsonsecomment61;
    public $response62, $repsonsecomment62;
    public $response63, $repsonsecomment63;
    public $response64, $repsonsecomment64;
    public $response65, $repsonsecomment65;
    public $response66, $repsonsecomment66;
    public $response67, $repsonsecomment67;
    public $response68, $repsonsecomment68;
    public $response69, $repsonsecomment69;
    public $response70, $repsonsecomment70;
    public $response71, $repsonsecomment71;
    public $response72, $repsonsecomment72;
    public $response73, $repsonsecomment73;
    public $response74, $repsonsecomment74;
    public $response75, $repsonsecomment75;
    public $response76, $repsonsecomment76;
    public $response77, $repsonsecomment77;
    public $response78, $repsonsecomment78;
    public $response79, $repsonsecomment79;
    public $response80, $repsonsecomment80;
    public $response81, $repsonsecomment81;
    public $response82, $repsonsecomment82;
    public $response83, $repsonsecomment83;
    public $response84, $repsonsecomment84;
    public $response85, $repsonsecomment85;
    public $response86, $repsonsecomment86;
    public $response87, $repsonsecomment87;
    public $response88, $repsonsecomment88;
    public $response89, $repsonsecomment89;
    public $response90, $repsonsecomment90;
    public $response91, $repsonsecomment91;
    public $response92, $repsonsecomment92;
    public $response93, $repsonsecomment93;
    public $response94, $repsonsecomment94;
    public $response95, $repsonsecomment95;
    public $response96, $repsonsecomment96;
    public $response97, $repsonsecomment97;
    public $response98, $repsonsecomment98;
    public $response99, $repsonsecomment99;
    public $response100, $repsonsecomment100;
    public $response101, $repsonsecomment101;
    public $response102, $repsonsecomment102;
    public $response103, $repsonsecomment103;
    public $response104, $repsonsecomment104;
    public $response105, $repsonsecomment105;
    public $response106, $repsonsecomment106;
    public $response107, $repsonsecomment107;
    public $response108, $repsonsecomment108;
    public $response109, $repsonsecomment109;
    public $response110, $repsonsecomment110;
    public $response111, $repsonsecomment111;
    public $response112, $repsonsecomment112;
    public $response113, $repsonsecomment113;
    public $response114, $repsonsecomment114;
    public $response115, $repsonsecomment115;
    public $response116, $repsonsecomment116;
    public $response117, $repsonsecomment117;
    public $response118, $repsonsecomment118;
    public $response119, $repsonsecomment119;
    public $response120, $repsonsecomment120;
    public $response121, $repsonsecomment121;
    public $response122, $repsonsecomment122;
    public $response123, $repsonsecomment123;
    public $response124, $repsonsecomment124;
    public $response125, $repsonsecomment125;
    public $response126, $repsonsecomment126;
    public $response127, $repsonsecomment127;
    public $response128, $repsonsecomment128;
    public $response129, $repsonsecomment129;
    public $response130, $repsonsecomment130;
    public $response131, $repsonsecomment131;
    public $response132, $repsonsecomment132;
    public $response133, $repsonsecomment133;
    public $response134, $repsonsecomment134;
    public $response135, $repsonsecomment135;
    public $response136, $repsonsecomment136;
    public $response137, $repsonsecomment137;
    public $response138, $repsonsecomment138;
    public $response139, $repsonsecomment139;
    public $response140, $repsonsecomment140;
    public $response141, $repsonsecomment141;
    public $response142, $repsonsecomment142;
    public $response143, $repsonsecomment143;
    public $response144, $repsonsecomment144;
    public $response145, $repsonsecomment145;
    public $response146, $repsonsecomment146;
    public $response147, $repsonsecomment147;
    public $response148, $repsonsecomment148;
    public $response149, $repsonsecomment149;
    public $response150, $repsonsecomment150;
    public $response151, $repsonsecomment151;
    public $response152, $repsonsecomment152;
    public $response153, $repsonsecomment153;
    public $response154, $repsonsecomment154;
    public $response155, $repsonsecomment155;
    public $response156, $repsonsecomment156;
    public $response157, $repsonsecomment157;
    public $response158, $repsonsecomment158;
    public $response159, $repsonsecomment159;
    public $response160, $repsonsecomment160;


    public $form = 'dt022';
    public $printlayout = 'Portrait';
    public $formname = 'Inline Track Welding Limited Welding Site Surveillance Report: (DT022)';


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

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['location', 'welder', 'stampno', 'weldersasst', 'jobno', 'sentinelno', 'workdescription', 'area', 'sitesuditor', 'auditorsign', 'auditoredsign', 'twrailtech', 'twtermit', 'twstandardgap', 'twwidegap', 'twmma', 'ffuid1', 'ffuid2', 'ffuid3', 'ffuid4', 'ffuid5', 'ffuid6', 'ffuid7', 'ffuid8', 'ffuid9', 'ffuid10', 'ffuid11', 'ffuid12', 'ffuid13', 'ffuid14', 'ffuid15', 'tc1', 'tc2', 'tc3', 'tc4', 'tc5', 'tc6', 'tc7', 'tc8', 'tc9', 'tc10', 'rs1', 'rs2', 'rt1', 'rt2', 'tw1', 'rw2', 'rep1', 'gasfuel', 'comments', 'advcomments', 'addcomments', 'padno'], 'string'],
            [[
                'response1', 'repsonsecomment1', 'response2', 'repsonsecomment2', 'response3', 'repsonsecomment3', 'response4', 'repsonsecomment4', 'response5', 'repsonsecomment5', 'response6', 'repsonsecomment6', 'response7', 'repsonsecomment7', 'response8', 'repsonsecomment8', 'response9', 'repsonsecomment9', 'response10', 'repsonsecomment10', 
                'response11', 'repsonsecomment11', 'response12', 'repsonsecomment12', 'response13', 'repsonsecomment13', 'response14',  'repsonsecomment14', 'response15', 'repsonsecomment15', 'response16', 'repsonsecomment16','response17', 'repsonsecomment17', 'response18', 'repsonsecomment18', 'response19', 'repsonsecomment19',
                'response20', 'repsonsecomment20', 'response21', 'repsonsecomment21', 'response22', 'repsonsecomment22', 'response23', 'repsonsecomment23', 'response24', 'repsonsecomment24', 'response25', 'repsonsecomment25', 'response26', 'repsonsecomment26', 'response27', 'repsonsecomment27', 'response28', 'repsonsecomment28', 'response29', 'repsonsecomment29', 
                'response30', 'repsonsecomment30', 'response31', 'repsonsecomment31', 'response32', 'repsonsecomment32', 'response33',  'repsonsecomment33', 'response34', 'repsonsecomment34', 'response35', 'repsonsecomment35','response36', 'repsonsecomment36', 'response37', 'repsonsecomment37', 'response38', 'repsonsecomment38', 'response39', 'repsonsecomment39',
                'response40', 'repsonsecomment40', 'response41', 'repsonsecomment41', 'response42', 'repsonsecomment42', 'response43', 'repsonsecomment43', 'response44', 'repsonsecomment44', 'response45', 'repsonsecomment45', 'response46', 'repsonsecomment46', 'response47', 'repsonsecomment47', 'response48', 'repsonsecomment48', 'response49', 'repsonsecomment49', 
                'response50', 'repsonsecomment50', 'response51', 'repsonsecomment51', 'response52', 'repsonsecomment52', 'response53',  'repsonsecomment53', 'response54', 'repsonsecomment54', 'response55', 'repsonsecomment55','response56', 'repsonsecomment56', 'response57', 'repsonsecomment57', 'response58', 'repsonsecomment58', 'response59', 'repsonsecomment59',
                'response60', 'repsonsecomment60', 'response61', 'repsonsecomment61', 'response62', 'repsonsecomment62', 'response63', 'repsonsecomment63', 'response64', 'repsonsecomment64', 'response65', 'repsonsecomment65', 'response66', 'repsonsecomment66', 'response67', 'repsonsecomment67', 'response68', 'repsonsecomment68', 'response69', 'repsonsecomment69', 
                'response70', 'repsonsecomment70', 'response71', 'repsonsecomment71', 'response72', 'repsonsecomment72', 'response73',  'repsonsecomment73', 'response74', 'repsonsecomment74', 'response75', 'repsonsecomment75','response76', 'repsonsecomment76', 'response77', 'repsonsecomment77', 'response78', 'repsonsecomment78', 'response79', 'repsonsecomment79',
                'response80', 'repsonsecomment80', 'response81', 'repsonsecomment81', 'response82', 'repsonsecomment82', 'response83', 'repsonsecomment83', 'response84', 'repsonsecomment84', 'response85', 'repsonsecomment85', 'response86', 'repsonsecomment86', 'response87', 'repsonsecomment87', 'response88', 'repsonsecomment88', 'response89', 'repsonsecomment89', 
                'response90', 'repsonsecomment90', 'response91', 'repsonsecomment91', 'response92', 'repsonsecomment92', 'response93',  'repsonsecomment93', 'response94', 'repsonsecomment94', 'response95', 'repsonsecomment95','response96', 'repsonsecomment96', 'response97', 'repsonsecomment97', 'response98', 'repsonsecomment98', 'response99', 'repsonsecomment99',
                'response100', 'repsonsecomment100', 'response101', 'repsonsecomment101', 'response102', 'repsonsecomment102', 'response103', 'repsonsecomment103', 'response104', 'repsonsecomment104', 'response105', 'repsonsecomment105', 'response106', 'repsonsecomment106', 'response107', 'repsonsecomment107', 'response108', 'repsonsecomment108', 'response109', 'repsonsecomment109', 
                'response110', 'repsonsecomment110', 'response111', 'repsonsecomment111', 'response112', 'repsonsecomment112', 'response113', 'repsonsecomment113', 'response114', 'repsonsecomment114', 'response115', 'repsonsecomment115', 'response116', 'repsonsecomment116', 'response117', 'repsonsecomment117', 'response118', 'repsonsecomment118', 'response119', 'repsonsecomment119', 
                'response120', 'repsonsecomment120', 'response121', 'repsonsecomment121', 'response122', 'repsonsecomment122', 'response123', 'repsonsecomment123', 'response124', 'repsonsecomment124', 'response125', 'repsonsecomment125', 'response126', 'repsonsecomment126', 'response127', 'repsonsecomment127', 'response128', 'repsonsecomment128', 'response129', 'repsonsecomment129', 
                'response130', 'repsonsecomment130', 'response131', 'repsonsecomment131', 'response132', 'repsonsecomment132', 'response133', 'repsonsecomment133', 'response134', 'repsonsecomment134', 'response135', 'repsonsecomment135', 'response136', 'repsonsecomment136', 'response137', 'repsonsecomment137', 'response138', 'repsonsecomment138', 'response139', 'repsonsecomment139', 
                'response140', 'repsonsecomment140', 'response141', 'repsonsecomment141', 'response142', 'repsonsecomment142', 'response143', 'repsonsecomment143', 'response144', 'repsonsecomment144', 'response145', 'repsonsecomment145', 'response146', 'repsonsecomment146', 'response147', 'repsonsecomment147', 'response148', 'repsonsecomment148', 'response149', 'repsonsecomment149', 
                'response150', 'repsonsecomment150', 'response151', 'repsonsecomment151', 'response152', 'repsonsecomment152', 'response153', 'repsonsecomment153', 'response154', 'repsonsecomment154', 'response155', 'repsonsecomment155', 'response156', 'repsonsecomment156', 'response157', 'repsonsecomment157', 'response158', 'repsonsecomment158', 'response159', 'repsonsecomment159', 
                'response160', 'repsonsecomment160',
            ], 'string'],
            [['actid', 'date', 'cced1', 'cced2', 'cced3', 'cced4', 'cced5', 'cced6', 'cced7', 'cced8', 'cced9', 'cced10', 'cced11', 'cced12', 'cced13', 'cced14', 'cced15','ffused0', 'ffused1', 'ffused2', 'ffused3', 'ffused4', 'ffused5', 'ffused6', 'ffused7', 'ffused8', 'ffused9', 'ffused10', 'ffused11', 'ffused12', 'ffused13', 'ffused14', 'ffused15'], 'safe'],
            [[ 'ppe1', 'ppe2', 'ppe3', 'ppe4', 'ppe5', 'ppe6', 'ppe7', 'ppe8', 'ppe9','ppe10', 'ppe11', 'ppe12', 'ppe13', 'ppe14', 'ppe15', 'ffu1', 'ffu2', 'ffu3', 'ffu4', 'ffu5', 'ffu6', 'ffu7', 'ffu8', 'ffu9', 'ffu10', 'ffu11', 'ffu12', 'ffu13', 'ffu14', 'ffu15'], 'integer'],
            [['client',], 'string'],
            [['deleted'], 'boolean'],
			[['created_at', 'updated_at', 'deleted_at'], 'safe'],
			[['created_by', 'updated_by','id', 'relatedid', ],'safe'],
			//Redundant
			[['created_by2', 'updated_by2'], 'integer'],
        
	 ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'actid' => 'Actid',
            'date' => 'Date',
            'location' => 'Location',
            'welder' => 'Welder',
            'stampno' => 'Stampno',
            'weldersasst' => 'Weldersasst',
            'jobno' => 'Jobno',
            'sentinelno' => 'Sentinelno',
            'workdescription' => 'Workdescription',
            'client' => 'Client',
            'area' => 'Area',
            'sitesuditor' => 'Sitesuditor',
            'auditorsign' => 'Auditorsign',
            'auditoredsign' => 'Auditoredsign',
            'cced1' => '',
            'cced2' => 'Sentinel PTS',
            'cced3' => 'Sentinel Welders',
            'cced4' => 'Abrasive Wheels',
            'cced5' => 'Rail Grinder',
            'cced6' => 'Angle Grinder',
            'cced7' => 'Needle Gun',
            'cced8' => 'Electric Generator',
            'cced9' => 'Weld Trimmer',
            'cced10' => 'Rail Saw',
            'cced11' => 'Stressing Equipment',
            'cced12' => 'Cced12',
            'cced13' => 'Cced13',
            'cced14' => 'Cced14',
            'cced15' => 'Cced15',
            'twrailtech' => 'Twrailtech',
            'twtermit' => 'Twtermit',
            'twstandardgap' => 'Twstandardgap',
            'twwidegap' => 'Twwidegap',
            'twmma' => 'Twmma',
            'ppe1' => 'Flame Retardent Overalls',
            'ppe2' => 'Flame Retardent Foul Weather',
            'ppe3' => 'Hard Hat',
            'ppe4' => 'Welders Gauntlets',
            'ppe5' => 'Fatigue Gloves',
            'ppe6' => 'Steel Toe Cap Welders Boots',
            'ppe7' => 'Clear Goggles & Blast Mask',
            'ppe8' => 'Shaded Goggles GW5 (welding)',
            'ppe9' => 'Ear Defenders',
            'ppe10' => 'Head Torch',
            'ppe11' => 'Ppe11',
            'ppe12' => 'Ppe12',
            'ppe13' => 'Ppe13',
            'ppe14' => 'Ppe14',
            'ppe15' => 'Ppe15',
            'ffu1' => 'Ffu1',
            'ffuid1' => 'Ffuid1',
            'ffused1' => 'Ffused1',
            'ffu2' => 'Ffu2',
            'ffu3' => 'Ffu3',
            'ffu4' => 'Ffu4',
            'ffu5' => 'Ffu5',
            'ffu6' => 'Ffu6',
            'ffu7' => 'Ffu7',
            'ffu8' => 'Ffu8',
            'ffu9' => 'Ffu9',
            'ffu10' => 'Ffu10',
            'ffu11' => 'Ffu11',
            'ffu12' => 'Ffu12',
            'ffu13' => 'Ffu13',
            'ffu14' => 'Ffu14',
            'ffu15' => 'Ffu15',
            'ffuid2' => 'Ffuid2',
            'ffuid3' => 'Ffuid3',
            'ffuid4' => 'Ffuid4',
            'ffuid5' => 'Ffuid5',
            'ffuid6' => 'Ffuid6',
            'ffuid7' => 'Ffuid7',
            'ffuid8' => 'Ffuid8',
            'ffuid9' => 'Ffuid9',
            'ffuid10' => 'Ffuid10',
            'ffuid11' => 'Ffuid11',
            'ffuid12' => 'Ffuid12',
            'ffuid13' => 'Ffuid13',
            'ffuid14' => 'Ffuid14',
            'ffuid15' => 'Ffuid15',
            'ffused2' => 'Ffused2',
            'ffused3' => 'Ffused3',
            'ffused4' => 'Ffused4',
            'ffused5' => 'Ffused5',
            'ffused6' => 'Ffused6',
            'ffused7' => 'Ffused7',
            'ffused8' => 'Ffused8',
            'ffused9' => 'Ffused9',
            'ffused10' => 'Ffused10',
            'ffused11' => 'Ffused11',
            'ffused12' => 'Ffused12',
            'ffused13' => 'Ffused13',
            'ffused14' => 'Ffused14',
            'ffused15' => 'Ffused15',
            'tc1' => 'Tc1',
            'tc2' => 'Tc2',
            'tc3' => 'Tc3',
            'tc4' => 'Tc4',
            'tc5' => 'Tc5',
            'tc6' => 'Tc6',
            'tc7' => 'Tc7',
            'tc8' => 'Tc8',
            'tc9' => 'Tc9',
            'tc10' => 'Tc10',
            'rs1' => 'Rs1',
            'rs2' => 'Rs2',
            'rt1' => 'Rt1',
            'rt2' => 'Rt2',
            'tw1' => 'Tw1',
            'rw2' => 'Rw2',
            'rep1' => 'Rep1',
            'gasfuel' => 'Gasfuel',
            'comments' => 'Comments',
            'created_at' => 'Created At',
            'created_by' => 'Created By',
            'updated_at' => 'Updated At',
            'updated_by' => 'Updated By',
            'advcomments' => 'Advcomments',
            'response1' => '1.10 Are the welding team in possession of the correct method statements and risk assessments?', 'repsonsecomment1' => 'repsonsecomment1',
            'response2' => '1.20 Have the method statements been briefed to all the appropriate staff?', 'repsonsecomment2' => 'repsonsecomment2',
            'response3' => '1.30 Are working methods in accordance with risk assessments and method statements?', 'repsonsecomment3' => 'repsonsecomment3',
            'response4' => '1.40 Do working methods keep risks to a minimum ', 'repsonsecomment4' => 'repsonsecomment4',
            'response5' => '1.50 Have all staff booked on site before starting work', 'repsonsecomment5' => 'repsonsecomment5',
            'response6' => '1.60 Have accident reporting and recording arrangements been briefed?', 'repsonsecomment6' => 'repsonsecomment6',
            'response7' => '1.70 Are accident procedures adequate for all likely scenarios?', 'repsonsecomment7' => 'repsonsecomment7',
            'response8' => 'response8', 'repsonsecomment8' => 'repsonsecomment8',
            'response9' => 'response9', 'repsonsecomment9' => 'repsonsecomment9',
            'response10' => '2.10 Has a COSS been appointed?', 'repsonsecomment10' => 'repsonsecomment10',
            'response11' => '2.20 Has a site specific briefing been given by the COSS to all staff?', 'repsonsecomment11' => 'repsonsecomment11',
            'response12' => '2.30 Has a green zone been created?', 'repsonsecomment12' => 'repsonsecomment12',
            'response13' => '2.40 Has fencing or barriers been erected or site wardens appointed where necessary?', 'repsonsecomment13' => 'repsonsecomment13',
            'response14' => '2.50 Has possession of the line been taken where necessary?', 'repsonsecomment14' => 'repsonsecomment14',
            'response15' => '2.60 Is red zone working permitted?', 'repsonsecomment15' => 'repsonsecomment15',
            'response16' => '2.70 If working in a red zone has adequate lookout protection been provided?', 'repsonsecomment16' => 'repsonsecomment16',
            'response17' => '2.80 Are staff and plant working more than 2.5mtrs away from OHEL?', 'repsonsecomment17' => 'repsonsecomment17',
            'response18' => '2.90 Are staff prevented from working in close proximity to live conductor rails?', 'repsonsecomment18' => 'repsonsecomment18',
            'response19' => 'response19', 'repsonsecomment19' => 'repsonsecomment19',
            'response20' => '3.10 Are the appropriate statutory notices, safety and warning signs displayed?', 'repsonsecomment20' => 'repsonsecomment20',
            'response21' => 'response21', 'repsonsecomment21' => 'repsonsecomment21',
            'response22' => 'response22', 'repsonsecomment22' => 'repsonsecomment22',
            'response23' => 'response23', 'repsonsecomment23' => 'repsonsecomment23',
            'response24' => 'response24', 'repsonsecomment24' => 'repsonsecomment24',
            'response25' => '4.10 Is access to and from site and the work place safe and clear of obstructions?', 'repsonsecomment25' => 'repsonsecomment25',
            'response26' => '4.20 Are walk-ways, passage-ways, staircases and ramps free from slipping and tripping hazards?', 'repsonsecomment26' => 'repsonsecomment26',
            'response27' => '4.30 Is adequate lighting provided for poorly lit areas', 'repsonsecomment27' => 'repsonsecomment27',
            'response28' => 'response28', 'repsonsecomment28' => 'repsonsecomment28',
            'response29' => 'response29', 'repsonsecomment29' => 'repsonsecomment29',
            'response30' => '5.10 Are adequate welfare facilities available on site', 'repsonsecomment30' => 'repsonsecomment30',
            'response31' => '5.20 Are first aid arrangements adequate?', 'repsonsecomment31' => 'repsonsecomment31',
            'response32' => 'response32', 'repsonsecomment32' => 'repsonsecomment32',
            'response33' => 'response33', 'repsonsecomment33' => 'repsonsecomment33',
            'response34' => 'response34', 'repsonsecomment34' => 'repsonsecomment34',
            'response35' => '6.10 Are all hazardous materials and substances been identified and assessed in accordance with COSHH?' , 'repsonsecomment35' => 'repsonsecomment35',
            'response36' => '6.20 Are all hazardous materials and substances stored in a safe and secure manner?', 'repsonsecomment36' => 'repsonsecomment36',
            'response37' => 'response37', 'repsonsecomment37' => 'repsonsecomment37',
            'response38' => 'response38', 'repsonsecomment38' => 'repsonsecomment38',
            'response39' => 'response39', 'repsonsecomment39' => 'repsonsecomment39',
            'response40' => '7.10 Are there adequate precautions to prevent theft vandalism and scavagening of stored waste?', 'repsonsecomment40' => 'repsonsecomment40',
            'response41' => '7.20 Is waste regularly removed from site by an authorised person/company?', 'repsonsecomment41' => 'repsonsecomment41',
            'response42' => '7.30 Are adequate precautions taken to prevent ground or water contamination by oils, solvents fuels, metallic powder or any other materials?', 'repsonsecomment42' => 'repsonsecomment42',
            'response43' => 'response43', 'repsonsecomment43' => 'repsonsecomment43',
            'response44' => 'response44', 'repsonsecomment44' => 'repsonsecomment44',
            'response45' => '8.10 Is the work site fencing/boarding secure and undamaged?', 'repsonsecomment45' => 'repsonsecomment45',
            'response46' => '8.20 Is all plant immobilised, secured and stored when the site is unattended?', 'repsonsecomment46' => 'repsonsecomment46',
            'response47' => 'response47', 'repsonsecomment47' => 'repsonsecomment47',
            'response48' => 'response48', 'repsonsecomment48' => 'repsonsecomment48',
            'response49' => 'response49', 'repsonsecomment49' => 'repsonsecomment49',
            'response50' => '9.10 Have all staff received appropriate fire training?', 'repsonsecomment50' => 'repsonsecomment50',
            'response51' => '9.20 Are all combustable materials and substances removed from site before starting?', 'repsonsecomment51' => 'repsonsecomment51',
            'response52' => '9.30 Is appropriate fire equipment available?', 'repsonsecomment52' => 'repsonsecomment52',
            'response53' => '9.40 Are no smoking areas designated where combustable or flammable materials are kept?', 'repsonsecomment53' => 'repsonsecomment53',
            'response54' => 'response54', 'repsonsecomment54' => 'repsonsecomment54',
            'response55' => '10.10 Is a hot work permit system in place?', 'repsonsecomment55' => 'repsonsecomment55',
            'response56' => '10.20 Are hot work areas inspected after completion of work to ensure the area is safe?', 'repsonsecomment56' => 'repsonsecomment56',
            'response57' => 'response57', 'repsonsecomment57' => 'repsonsecomment57',
            'response58' => 'response58', 'repsonsecomment58' => 'repsonsecomment58',
            'response59' => 'response59', 'repsonsecomment59' => 'repsonsecomment59',
            'response60' => '11.10 Have noise risks been assessed where appropriate?', 'repsonsecomment60' => 'repsonsecomment60',
            'response61' => '11.20 Are any noise controls required?', 'repsonsecomment61' => 'repsonsecomment61',
            'response62' => '11.30 Have attempts been made to silence any noisy plant or equipment or other suitable controls put in place?', 'repsonsecomment62' => 'repsonsecomment62',
            'response63' => 'response63', 'repsonsecomment63' => 'repsonsecomment63',
            'response64' => 'response64', 'repsonsecomment64' => 'repsonsecomment64',
            'response65' => '12.10 Are there adequate procedures for indicating and protecting the presence of electricity power lines and other services?', 'repsonsecomment65' => 'repsonsecomment65',
            'response66' => '12.20 Is all portable electricity equipment, including tempory lighting operated at 110v or less?', 'repsonsecomment66' => 'repsonsecomment66',
            'response67' => '12.30 Are residual current devices used where possible?', 'repsonsecomment67' => 'repsonsecomment67',
            'response68' => '12.40 Have all electrical tools and equipment been tested by a competent person and date stamped', 'repsonsecomment68' => 'repsonsecomment68',
            'response69' => 'response69', 'repsonsecomment69' => 'repsonsecomment69',
            'response70' => '13.10 Are all vibration tools fitted with dampners', 'repsonsecomment70' => 'repsonsecomment70',
            'response71' => '13.20 Are operators using the vibration tools correctly', 'repsonsecomment71' => 'repsonsecomment71',
            'response72' => '13.30 Are operators taking the correct breaks', 'repsonsecomment72' => 'repsonsecomment72',
            'response73' => '13.40 Is there a operator rotation system in place', 'repsonsecomment73' => 'repsonsecomment73',
            'response74' => '13.50 Is there risk assessmentas in place', 'repsonsecomment74' => 'repsonsecomment74',
            'response75' => '13.60 Has the correct HAVS form been completed', 'repsonsecomment75' => 'repsonsecomment75',
            'response76' => 'response76', 'repsonsecomment76' => 'repsonsecomment76',
            'response77' => 'response77', 'repsonsecomment77' => 'repsonsecomment77',
            'response78' => 'response78', 'repsonsecomment78' => 'repsonsecomment78',
            'response79' => 'response79', 'repsonsecomment79' => 'repsonsecomment79',
            'response80' => '1.10 Identify rails in respect to profile, grade & wear', 'repsonsecomment80' => 'repsonsecomment80',
            'response81' => '1.20 Identify features that could affect acceptance', 'repsonsecomment81' => 'repsonsecomment81',
            'response82' => 'response82', 'repsonsecomment82' => 'repsonsecomment82',
            'response83' => 'response83', 'repsonsecomment83' => 'repsonsecomment83',
            'response84' => 'response84', 'repsonsecomment84' => 'repsonsecomment84',
            'response85' => '2.10 Correct gas equipment is selected & checked', 'repsonsecomment85' => 'repsonsecomment85',
            'response86' => '2.20 Gas equipment assembled correctly', 'repsonsecomment86' => 'repsonsecomment86',
            'response87' => '2.30 Gas equipment is leak tested with correct spray', 'repsonsecomment87' => 'repsonsecomment87',
            'response88' => 'response88', 'repsonsecomment88' => 'repsonsecomment88',
            'response89' => 'response89', 'repsonsecomment89' => 'repsonsecomment89',
            'response90' => '3.10 Measure welding gap for the welding process used', 'repsonsecomment90' => 'repsonsecomment90',
            'response91' => '3.20 Cut rails to the defined tolorences', 'repsonsecomment91' => 'repsonsecomment91',
            'response92' => 'response92', 'repsonsecomment92' => 'repsonsecomment92',
            'response93' => 'response93', 'repsonsecomment93' => 'repsonsecomment93',
            'response94' => 'response94', 'repsonsecomment94' => 'repsonsecomment94',
            'response95' => '4.10 The correct moulds are selected', 'repsonsecomment95' => 'repsonsecomment95',
            'response96' => '4.20 The correct portion/SUC selected', 'repsonsecomment96' => 'repsonsecomment96',
            'response97' => 'response97', 'repsonsecomment97' => 'repsonsecomment97',
            'response98' => 'response98', 'repsonsecomment98' => 'repsonsecomment98',
            'response99' => 'response99', 'repsonsecomment99' => 'repsonsecomment99',
            'response100' => '5.10 Correct LLC procedure ussed', 'repsonsecomment100' => 'repsonsecomment100',
            'response101' => '5.20 One-shot/SUC inspected for signs of damage', 'repsonsecomment101' => 'repsonsecomment101',
            'response102' => 'response102', 'repsonsecomment102' => 'repsonsecomment102',
            'response103' => 'response103', 'repsonsecomment103' => 'repsonsecomment103',
            'response104' => 'response104', 'repsonsecomment104' => 'repsonsecomment104',
            'response105' => '6.10 Align joint using approved methods', 'repsonsecomment105' => 'repsonsecomment105',
            'response106' => '6.20 Datum marks are correctly applied', 'repsonsecomment106' => 'repsonsecomment106',
            'response107' => '6.30 Record details of final alignment/welding gap', 'repsonsecomment107' => 'repsonsecomment107',
            'response108' => 'response108', 'repsonsecomment108' => 'repsonsecomment108',
            'response109' => 'response109', 'repsonsecomment109' => 'repsonsecomment109',
            'response110' => '7.10 Pre-heater is positioned correctly', 'repsonsecomment110' => 'repsonsecomment110',
            'response111' => 'response111', 'repsonsecomment111' => 'repsonsecomment111',
            'response112' => 'response112', 'repsonsecomment112' => 'repsonsecomment112',
            'response113' => 'response113', 'repsonsecomment113' => 'repsonsecomment113',
            'response114' => 'response114', 'repsonsecomment114' => 'repsonsecomment114',
            'response115' => '8.10 The moulds are adjusted correctly ', 'repsonsecomment115' => 'repsonsecomment115',
            'response116' => '8.20 Moulds are fitted centrally to the gap', 'repsonsecomment116' => 'repsonsecomment116',
            'response117' => '8.30 Moulds are checked for vertical, squareness & foot alignment', 'repsonsecomment117' => 'repsonsecomment117',
            'response118' => '8.40 Moulds are luted using the correct medium, tools & equipment', 'repsonsecomment118' => 'repsonsecomment118',
            'response119' => 'response119', 'repsonsecomment119' => 'repsonsecomment119',
            'response120' => '9.10 Adjust pressures to obtain correct flame condition prior to preheating', 'repsonsecomment120' => 'repsonsecomment120',
            'response121' => '9.20 Check the preheating gas pressures and preheat as per procedure', 'repsonsecomment121' => 'repsonsecomment121',
            'response122' => '9.30 Datum marks are checked at the appropriate times', 'repsonsecomment122' => 'repsonsecomment122',
            'response123' => '9.40 The crucible is positioned correctly', 'repsonsecomment123' => 'repsonsecomment123',
            'response124' => '9.50 The portion is ignited, checking for normal reaction & tapping time', 'repsonsecomment124' => 'repsonsecomment124',
            'response125' => 'response125', 'repsonsecomment125' => 'repsonsecomment125',
            'response126' => 'response126', 'repsonsecomment126' => 'repsonsecomment126',
            'response127' => 'response127', 'repsonsecomment127' => 'repsonsecomment127',
            'response128' => 'response128', 'repsonsecomment128' => 'repsonsecomment128',
            'response129' => 'response129', 'repsonsecomment129' => 'repsonsecomment129',
            'response130' => '10.10 Equipment is removed within the defined timescales', 'repsonsecomment130' => 'repsonsecomment130',
            'response131' => '10.20 Hot waste tray avalable and used correctly', 'repsonsecomment131' => 'repsonsecomment131',
            'response132' => '10.30 Trimming is started after specified time has elasped & support system is checked', 'repsonsecomment132' => 'repsonsecomment132',
            'response133' => '10.40 Support system is removed afetr specified time scale', 'repsonsecomment133' => 'repsonsecomment133',
            'response134' => 'response134', 'repsonsecomment134' => 'repsonsecomment134',
            'response135' => '11.10 The rail seating is cleaned', 'repsonsecomment135' => 'repsonsecomment135',
            'response136' => '11.20 All pads & insulators are replaced', 'repsonsecomment136' => 'repsonsecomment136',
            'response137' => '11.30 The weld is ground after the specified time using the correct equipment', 'repsonsecomment137' => 'repsonsecomment137',
            'response138' => '11.40 The weld is ground to the correct tolorence', 'repsonsecomment138' => 'repsonsecomment138',
            'response139' => '11.50 The weld is thouroghly cleaned', 'repsonsecomment139' => 'repsonsecomment139',
            'response140' => 'response140', 'repsonsecomment140' => 'repsonsecomment140',
            'response141' => '12.10 Weld debris is removed from site and ballast reinstated if any', 'repsonsecomment141' => 'repsonsecomment141',
            'response142' => '12.20 The weld is checked for any visual defects in accordance with NR/L2/TRK/0032', 'repsonsecomment142' => 'repsonsecomment142',
            'response143' => '12.30 Weld is stamped correctly following visual checks', 'repsonsecomment143' => 'repsonsecomment143',
            'response144' => 'response144', 'repsonsecomment144' => 'repsonsecomment144',
            'response145' => '13.10 All weld details are recorded correctly', 'repsonsecomment145' => 'repsonsecomment145',
            'response146' => '13.20 Non-conformance report completed if required', 'repsonsecomment146' => 'repsonsecomment146',
            'response147' => '13.30 Appropriate action taken in the event of a defect weld', 'repsonsecomment147' => 'repsonsecomment147',
            'response148' => 'response148', 'repsonsecomment148' => 'repsonsecomment148',
            'response149' => '1.10 DETAILS OF OBSERVATIONS NEEDING CORRECTION', 'repsonsecomment149' => 'repsonsecomment149',
            'response150' => '1.20 AGREED CORRECTIVE ACTIONS AND DATE', 'repsonsecomment150' => 'repsonsecomment150',
            'response151' => '2.10 DETAILS OF OBSERVATIONS NEEDING CORRECTION', 'repsonsecomment151' => 'repsonsecomment151',
            'response152' => '2.20 AGREED CORRECTIVE ACTIONS AND DATE', 'repsonsecomment152' => 'repsonsecomment152',
            'response153' => '3.10 DETAILS OF OBSERVATIONS NEEDING CORRECTION', 'repsonsecomment153' => 'repsonsecomment153',
            'response154' => '3.20 AGREED CORRECTIVE ACTIONS AND DATE', 'repsonsecomment154' => 'repsonsecomment154',
            'response155' => '4.10 DETAILS OF OBSERVATIONS NEEDING CORRECTION', 'repsonsecomment155' => 'repsonsecomment155',
            'response156' => '4.20 AGREED CORRECTIVE ACTIONS AND DATE', 'repsonsecomment156' => 'repsonsecomment156',
            'response157' => 'response157', 'repsonsecomment157' => 'repsonsecomment157',
            'response158' => 'response158', 'repsonsecomment158' => 'repsonsecomment158',
            'response159' => 'response159', 'repsonsecomment159' => 'repsonsecomment159',
            'response160' => 'response160', 'repsonsecomment160' => 'repsonsecomment160',

        ];
    }
	public function beforeValidate() {
        if (Yii::$app->name !== 'app-console' ) {
            $this->padno = $this->padno == null ? User::Padno() : $this->padno;
			$this->date !== null ? $this->date = date('Y-m-d', strtotime(str_replace('/', '-', $this->date))) : false;
            $this->cced1 !== null ? $this->cced1 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced1))) : false;
            $this->cced2 !== null ? $this->cced2 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced2))) : false;
            $this->cced3 !== null ? $this->cced3 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced3))) : false;
            $this->cced4 !== null ? $this->cced4 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced4))) : false;
            $this->cced5 !== null ? $this->cced5 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced5))) : false;
            $this->cced6 !== null ? $this->cced6 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced6))) : false;
            $this->cced7 !== null ? $this->cced7 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced7))) : false;
            $this->cced8 !== null ? $this->cced8 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced8))) : false;
            $this->cced9 !== null ? $this->cced9 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced9))) : false;
			$this->cced10 !== null ? $this->cced10 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced10))) : false;
			$this->cced11 !== null ? $this->cced11 = date('Y-m-d', strtotime(str_replace('/', '-', $this->cced11))) : false;
			$this->ffused0 !== null ? $this->ffused0 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused0))) : false;
			$this->ffused1 !== null ? $this->ffused1 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused1))) : false;
			$this->ffused2 !== null ? $this->ffused2 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused2))) : false;
			$this->ffused3 !== null ? $this->ffused3 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused3))) : false;
			$this->ffused4 !== null ? $this->ffused4 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused4))) : false;
			$this->ffused5 !== null ? $this->ffused5 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused5))) : false;
			$this->ffused6 !== null ? $this->ffused6 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused6))) : false;
			$this->ffused7 !== null ? $this->ffused7 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused7))) : false;
			$this->ffused8 !== null ? $this->ffused8 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused8))) : false;
			$this->ffused9 !== null ? $this->ffused9 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused9))) : false;
			$this->ffused10 !== null ? $this->ffused10 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused0))) : false;
			$this->ffused11 !== null ? $this->ffused11 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused11))) : false;
			$this->ffused12 !== null ? $this->ffused12 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused12))) : false;
			$this->ffused13 !== null ? $this->ffused13 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused13))) : false;
			$this->ffused14 !== null ? $this->ffused14 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused14))) : false;
			$this->ffused15 !== null ? $this->ffused15 = date('Y-m-d', strtotime(str_replace('/', '-', $this->ffused15))) : false;
        }
        return parent::beforeValidate();
    }
    
    public function getActivity() {
		return Activities::findOne(['id' => $this->actid]);
	}
	
	public function getClientl()
	{
		return Accounts::findOne(['id' => $this->client]);
		
	} 
	public function getAccount()
	{
		return Accounts::findOne(['accountid' => $this->company])
		->joinwith(['activity']);
	} 
    public function getUser() {
        return User::findOne(['id' => $this->created_by]);
    }

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

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