<?php

namespace modules\forms\models;

use Yii;
use yii\helpers\ArrayHelper;
use \kartik\date\DatePicker;
use modules\users\models\User;
use modules\activities\models\Activities;
use modules\custom\models\Accounts;

use frontend\models\{Settings};

class Dt130 extends \common\models\DynamicModel
{
    public $printlayout = 'Portrait';
    public $form = 'DT130';
    public $formname = 'Conductor Rail Welding Installation & Timesheet Form (DT130)';
    public $formType = 'Arc';
    
    public $createpath = '/forms/dt130/create';
    public $formLayout = '/dt130/_form.php';
    public $viewLayout = '@modules/forms/views/dt130/_view.php';

    public static function localAttributes()
    {
        return [
            'area' => [
                'rules' => [['string']],
                'label' => 'Dt130 Area',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'company' => [
                'rules' => [['string']],
                'label' => 'Company',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'date' => [
                'rules' => [['safe']],
                'label' => 'Date',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'weekno' => [
                'rules' => [['integer']],
                'label' => 'Week Number',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'actid' => [
                'rules' => [['safe']],
                'label' => 'Act Id',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'badwelds' => [
                'rules' => [['string']],
                'label' => 'Bad Welds',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'btol1' => [
                'rules' => [['string']],
                'label' => 'Back to Low Mileage Rail 1',
                'input' => ['input' => 'dropDownList', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'btol2' => [
                'rules' => [['string']],
                'label' => 'Back to Low Mileage Rail 2',
                'input' => ['input' => 'dropDownList', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'btol3' => [
                'rules' => [['string']],
                'label' => 'Back to Low Mileage Rail 3',
                'input' => ['input' => 'dropDownList', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'btol4' => [
                'rules' => [['string']],
                'label' => 'Back to Low Mileage Rail 4',
                'input' => ['input' => 'dropDownList', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'chord1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Chord1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'chord2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Chord2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'chord3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Chord3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'chord4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Chord4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'client_name' => [
                'rules' => [['string']],
                'label' => 'Dt130 Client Name',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'conform_1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Conform 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'conform_2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Conform 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'conform_3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Conform 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'conform_4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Conform 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'created_at' => [
                'rules' => [['safe']],
                'label' => 'Created At',
                'input' => ['input' => 'widget', 'fieldclass' => DatePicker::class, 'options' => ['type' => 1, 'pluginOptions' => ['todayBtn' => true, 'format' => 'dd/mm/yyyy']], 'width' => 'col-12'],
                'search' => false,
            ],
            'created_by' => [
                'rules' => [['safe']],
                'label' => 'Created By',
                'input' => ['input' => 'textInput', 'options' => ['label' => false, 'type' => 'number'], 'width' => 'col-12'],
                'search' => false,
            ],
            'dates' => [
                'rules' => [['safe']],
                'label' => 'Dates',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'deleted_at' => [
                'rules' => [['safe']],
                'label' => 'Deleted At',
                'input' => ['input' => 'widget', 'fieldclass' => DatePicker::class, 'options' => ['type' => 1, 'pluginOptions' => ['todayBtn' => true, 'format' => 'dd/mm/yyyy']], 'width' => 'col-12'],
                'search' => false,
            ],
            'deleted_by' => [
                'rules' => [['safe']],
                'label' => 'Deleted By',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'drawingcanvas' => [
                'rules' => [['string']],
                'label' => 'Drawing Canvas',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'drawingloc' => [
                'rules' => [['string']],
                'label' => 'Drawing Loc',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'elr1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Elr1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'elr2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Elr2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'elr3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Elr3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'elr4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Elr4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'finish_time' => [
                'rules' => [['string']],
                'label' => 'Dt130 Finish Time',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot1_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot1 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot1_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot1 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot2_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot2 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot2_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot2 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot3_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot3 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot3_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot3 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot4_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot4 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'foot4_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Foot4 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'form' => [
                'rules' => [['string']],
                'label' => 'Form',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'formname' => [
                'rules' => [['string']],
                'label' => 'Form Name',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_foot_1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Foot 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_foot_2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Foot 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_foot_3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Foot 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_foot_4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Foot 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_head_1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Head 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_head_2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Head 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_head_3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Head 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_head_4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Head 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_web_1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Web 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_web_2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Web 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_web_3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Web 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'gap_web_4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Gap Web 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'goodwelds' => [
                'rules' => [['string']],
                'label' => 'Good Welds',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head1_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head1 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head1_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head1 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head2_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head2 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head2_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head2 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head3_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head3 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head3_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head3 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head4_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head4 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'head4_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Head4 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'id' => [
                'rules' => [['safe']],
                'label' => 'ID',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'inlinejobno' => [
                'rules' => [['string']],
                'label' => 'Inline Job No',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'insdate' => [
                'rules' => [['safe']],
                'label' => 'Installation Date',
                'input' => ['input' => 'widget', 'fieldclass' => DatePicker::class, 'options' => ['type' => 1, 'pluginOptions' => ['todayBtn' => true, 'format' => 'dd/mm/yyyy']], 'width' => 'col-12'],
                'search' => false,
            ],
            'jobno' => [
                'rules' => [['string']],
                'label' => 'Job No',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'location' => [
                'rules' => [['string']],
                'label' => 'Dt130 Location',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'lt1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Lt1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'lt2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Lt2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'lt3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Lt3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'lt4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Lt4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage10' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage10',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage11' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage11',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage12' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage12',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage13' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage13',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage14' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage14',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage15' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage15',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage16' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage16',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage5' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage5',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage6' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage6',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage7' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage7',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage8' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage8',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'mileage9' => [
                'rules' => [['string']],
                'label' => 'Dt130 Mileage9',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'noofwelds' => [
                'rules' => [['string']],
                'label' => 'No Of Welds',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'non_con_1' => [
                'rules' => [['string']],
                'label' => 'Non Con 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'non_con_2' => [
                'rules' => [['string']],
                'label' => 'Non Con 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'non_con_3' => [
                'rules' => [['string']],
                'label' => 'Non Con 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'non_con_4' => [
                'rules' => [['string']],
                'label' => 'Non Con 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'noncon_1' => [
                'rules' => [['string']],
                'label' => 'Noncon 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'noncon_r_1' => [
                'rules' => [['string']],
                'label' => 'Noncon R 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'noncon_r_2' => [
                'rules' => [['string']],
                'label' => 'Noncon R 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'noncon_r_3' => [
                'rules' => [['string']],
                'label' => 'Noncon R 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'noncon_r_4' => [
                'rules' => [['string']],
                'label' => 'Noncon R 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'padno' => [
                'rules' => [['string']],
                'label' => 'Padno',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'process' => [
                'rules' => [['string']],
                'label' => 'Dt130 Process',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile1_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile1 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile1_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile1 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile2_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile2 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile2_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile2 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile3_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile3 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile3_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile3 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile4_lh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile4 Lh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'profile4_rh' => [
                'rules' => [['string']],
                'label' => 'Dt130 Profile4 Rh',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'relatedid' => [
                'rules' => [['string']],
                'label' => 'Related Id',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'rep_date' => [
                'rules' => [['safe']],
                'label' => 'Rep Date',
                'input' => ['input' => 'widget', 'fieldclass' => DatePicker::class, 'options' => ['type' => 1, 'pluginOptions' => ['todayBtn' => true, 'format' => 'dd/mm/yyyy']], 'width' => 'col-12'],
                'search' => false,
            ],
            'rep_print' => [
                'rules' => [['string']],
                'label' => 'Rep Print',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'rt1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Rt1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'rt2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Rt2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'rt3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Rt3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'rt4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Rt4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'securefields' => [
                'rules' => [['safe']],
                'label' => 'Secure Fields',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'signatureloc' => [
                'rules' => [['string']],
                'label' => 'Signature Loc',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag1' => [
                'rules' => [['string']],
                'label' => 'Snag1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag1id' => [
                'rules' => [['string']],
                'label' => 'Snag1 Id',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag2' => [
                'rules' => [['string']],
                'label' => 'Snag2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag2id' => [
                'rules' => [['string']],
                'label' => 'Snag2 Id',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag3' => [
                'rules' => [['string']],
                'label' => 'Snag3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag3id' => [
                'rules' => [['string']],
                'label' => 'Snag3 Id',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag4' => [
                'rules' => [['string']],
                'label' => 'Snag4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'snag4id' => [
                'rules' => [['string']],
                'label' => 'Snag4 Id',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'stamp_1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Stamp 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'stamp_2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Stamp 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'stamp_3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Stamp 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'stamp_4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Stamp 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'standing4foot1' => [
                'rules' => [['string']],
                'label' => 'Standing 4 Foot 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'standing4foot2' => [
                'rules' => [['string']],
                'label' => 'Standing 4 Foot 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'standing4foot3' => [
                'rules' => [['string']],
                'label' => 'Standing 4 Foot 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'standing4foot4' => [
                'rules' => [['string']],
                'label' => 'Standing 4 Foot 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'start_time' => [
                'rules' => [['string']],
                'label' => 'Dt130 Start Time',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'status' => [
                'rules' => [['string']],
                'label' => 'Status',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'trackid1' => [
                'rules' => [['string']],
                'label' => 'Dt130 Track Id1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'trackid2' => [
                'rules' => [['string']],
                'label' => 'Dt130 Track Id2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'trackid3' => [
                'rules' => [['string']],
                'label' => 'Dt130 Track Id3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'trackid4' => [
                'rules' => [['string']],
                'label' => 'Dt130 Track Id4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'tracktrolley' => [
                'rules' => [['string']],
                'label' => 'Track Trolley',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'travel_finish' => [
                'rules' => [['string']],
                'label' => 'Dt130 Travel Finish',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'travel_start' => [
                'rules' => [['string']],
                'label' => 'Dt130 Travel Start',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'uniqueidentifiers' => [
                'rules' => [['safe']],
                'label' => 'Unique Identifiers',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'updated_at' => [
                'rules' => [['safe']],
                'label' => 'Updated At',
                'input' => ['input' => 'widget', 'fieldclass' => DatePicker::class, 'options' => ['type' => 1, 'pluginOptions' => ['todayBtn' => true, 'format' => 'dd/mm/yyyy']], 'width' => 'col-12'],
                'search' => false,
            ],
            'updated_by' => [
                'rules' => [['safe']],
                'label' => 'Updated By',
                'input' => ['input' => 'textInput', 'options' => ['label' => false, 'type' => 'number'], 'width' => 'col-12'],
                'search' => false,
            ],
            'welders_name' => [
                'rules' => [['safe']],
                'label' => 'Welders Name',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'weldersassist_name' => [
                'rules' => [['string']],
                'label' => 'Welders Assist Name',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'weld_1' => [
                'rules' => [['string']],
                'label' => 'Weld 1',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'weld_2' => [
                'rules' => [['string']],
                'label' => 'Weld 2',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'weld_3' => [
                'rules' => [['string']],
                'label' => 'Weld 3',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'weld_4' => [
                'rules' => [['string']],
                'label' => 'Weld 4',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'weldscompleted' => [
                'rules' => [['string']],
                'label' => 'Welds Completed',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
            'wsignatureloc' => [
                'rules' => [['string']],
                'label' => 'W Signature Loc',
                'input' => ['input' => 'textInput', 'options' => ['label' => false], 'width' => 'col-12'],
                'search' => false,
            ],
        ];
    }

    public function Pdf()
    {
        $urls = [];
        $urls['page1'] = [
            'render' => '/forms/dt130/_view.php',
            'options' => [
                'landscape' => false,
                'printBackground' => true,
                'displayHeaderFooter' => true,
                'preferCSSPageSize' => true,
                'marginTop' => 0.0,
                'marginBottom' => 1.4,
                'marginLeft' => 5.0,
                'marginRight' => 1.0,
                'paperWidth' => 6.0,
                'paperHeight' => 6.0,
                'headerTemplate' => '<div>foo</div>',
                'footerTemplate' => '<div>foo</div>',
                'scale' => 1.0,

            ]

        ];
        return $urls;
    }




    public function getActivity()
    {
        return Activities::findOne(['id' => $this->actid]);
    }
    public function getAccountL()
    {
        return Accounts::findOne(['accountid' => $this->company])
            ->joinwith(['activity']);
    }
    public function getAccount()
    {
        return Accounts::findOne(['accountid' => $this->client_name]);
    }
    public function getUser()
    {
        return User::findOne(['id' => $this->created_by]);
    }
    public function getLogo()
    {
        return ArrayHelper::map(Settings::find()->where("id = '1'")->all(), 'logo', 'logo');
    }

    public function beforeValidate()
    {
        $this->padno = $this->padno == null ? User::Padno() : $this->padno;
        return parent::beforeValidate();
    }

    public function afterValidate()
    {
        parent::afterValidate();
        Yii::Warning($this->errors);
        return;
    }
    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;
    }


    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->inlinejobno = $act['jobno'];
           //$this->jcnno = $act['jobno'];
           $this->client_name = $act['relatedid'];
           $this->location = $act['location'];
         //  $this->elr = $act['elr'];
           $this->weekno = $act['weekno'];
           $this->date = date('d/m/Y H:i', strtotime($act['sdate']));
           $this->insdate = date('d/m/Y H:i', strtotime($act['sdate']));
        }
    }

}
