<?php
namespace modules\custom\models;


use Yii;
use yii\base\Model;
use modules\users\models\User;

class Dt134a extends Model {

public $id;
public $date;
public $created_at;
public $updated_at;
 public $created_by;
 public $updated_by;
 public $deleted_by;
 public $deleted_at;
 public $deleted;
 public $actid;
 public $status;
 public $driver;
 public $vehiclereg;
 public $vehicleid;
 public $startmileage;
 public $finishmileage;
 public $question1;
 public $question2;
 public $question3;
 public $question4;
 public $question5;
 public $question6;
 public $question7;
 public $question8;
 public $question9;
 public $question10;
 public $question11;
 public $question12;
 public $question13;
 public $question14;
 public $question15;
 public $question16;
 public $question17;
 public $question18;
 public $question19;
 public $question20;
 public $question21;
 public $question22;
 public $tyredepthin1;
 public $tyredepthin2;
 public $tyredepthin3;
 public $tyredepthin4;
 public $tyredepthin5;
 public $tyredepthout1;
 public $tyredepthout2;
 public $tyredepthout3;
 public $tyredepthout4;
 public $tyredepthout5;
 public $tyrepressure1;
 public $tyrepressure2;
 public $tyrepressure3;
 public $tyrepressure4;
 public $tyrepressure5;
 public $image;
 public $signature1;
 public $signature2;
 public $comments;
 public $correctivemeasures;
 public $result;
 public $jobno;

public function formName(){
   return 'Dt134a';
}

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'created_by', 'updated_by', 'deleted_by', 'actid', 'status', 'driver', 'vehiclereg', 'vehicleid', 'question1', 'question2', 'question3', 'question4', 'question5', 'question6', 'question7', 'question8', 'question9', 'question10', 'question11', 'question12', 'question13', 'question14', 'question15', 'question16', 'question17', 'question18', 'question19', 'question20', 'question21', 'question22', 'image', 'signature1', 'signature2', 'comments', 'result','correctivemeasures'], 'string'],
            [['startmileage', 'finishmileage', 'jobno'], 'integer'],
            [['tyredepthin1', 'tyredepthin2', 'tyredepthin3', 'tyredepthin4', 'tyredepthin5', 'tyredepthout1', 'tyredepthout2', 'tyredepthout3', 'tyredepthout4', 'tyredepthout5', 'tyrepressure1', 'tyrepressure2', 'tyrepressure3', 'tyrepressure4', 'tyrepressure5'],'number'],
            [['created_at', 'updated_at', 'deleted_at', 'date'], 'safe'],
            [['id'], 'unique'],
            [['deleted' ], 'boolean'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'created_by' => 'Created By',
            'updated_by' => 'Updated By',
            'deleted_by' => 'Deleted By',
            'deleted_at' => 'Deleted At',
            'deleted' => 'Deleted',
            'actid' => 'Actid',
            'status' => 'Status',
            'driver' => 'Driver',
            'vehiclereg' => 'Vehiclereg',
            'vehicleid' => 'Vehicleid',
            'startmileage' => 'Startmileage',
            'finishmileage' => 'Finishmileage',
            'question1' => 'Question1',
            'question2' => 'Question2',
            'question3' => 'Question3',
            'question4' => 'Question4',
            'question5' => 'Question5',
            'question6' => 'Question6',
            'question7' => 'Question7',
            'question8' => 'Question8',
            'question9' => 'Question9',
            'question10' => 'Question10',
            'question11' => 'Question11',
            'question12' => 'Question12',
            'question13' => 'Question13',
            'question14' => 'Question14',
            'question15' => 'Question15',
            'question16' => 'Question16',
            'question17' => 'Question17',
            'question18' => 'Question18',
            'question19' => 'Question19',
            'question20' => 'Question20',
            'question21' => 'Question21',
            'question22' => 'Question22',
            'tyredepthin1' => 'Tyredepthin1',
            'tyredepthin2' => 'Tyredepthin2',
            'tyredepthin3' => 'Tyredepthin3',
            'tyredepthin4' => 'Tyredepthin4',
            'tyredepthin5' => 'Tyredepthin5',
            'tyredepthout1' => 'Tyredepthout1',
            'tyredepthout2' => 'Tyredepthout2',
            'tyredepthout3' => 'Tyredepthout3',
            'tyredepthout4' => 'Tyredepthout4',
            'tyredepthout5' => 'Tyredepthout5',
            'tyrepressure1' => 'Tyrepressure1',
            'tyrepressure2' => 'Tyrepressure2',
            'tyrepressure3' => 'Tyrepressure3',
            'tyrepressure4' => 'Tyrepressure4',
            'tyrepressure5' => 'Tyrepressure5',
            'image' => 'Image',
            'signature1' => 'Signature1',
            'signature2' => 'Signature2',
            'comments' => 'Comments',
        ];
    }
    
	public function getVehiclel() {
        return \modules\cors\models\Vehiclebe::findOne('vehicleid');
    }
    
    public function getDriverl() {
		return User::findOne('driver');
	}
}