<?php 
namespace modules\forms\models\sub;

use PhpOffice\PhpSpreadsheet\Calculation\Category;
use yii;
use yii\base\{Model};
use common\models\DynamicModel;
use yii\helpers\{ArrayHelper,FileHelper, Json};
use backend\models\{Categoriesbe, Attributesvalues};
use modules\custom\models\Assetsbe;
use modules\forms\models\sub\ServiceItem;

class ServiceLifeRaft extends DynamicModel
{
	const type ='ServiceLifeRaft';
	public $form = 'ServiceLifeRaft';
	public $filename = 'Service_Life_Raft';
	public $viewpath = '@modules/forms/views/default/Service_Life_Raft_view';
	
	public function getActivity()
	{
		
		return  \modules\activities\models\Activities::find()->where(['id' => $this->actid])->One();
	}
	public function getActivityitem()
	{
		return \modules\activities\models\Activitiesitemsbe::find()->where(['id' => $this->relatedid])->One();
	}

	public function getImages() {
		if($this->activity){
			$dir = Yii::getAlias('@documents').'/'.$this->activity?->jobno;
			return file_exists($dir) ? FileHelper::findFiles($dir, ['only' => [$this->certno.'*.json']]) : [];
		} else {
			return [];
		}
	}
    
    public function __construct(array $attributes = [], $config = [])
	{
		parent::__construct($attributes, $config);  
		$this->loadItems($this->items);
		return ;
	}
        
    
	/**
	 * @param array|null $data
	 * @return void
	 */
	public function loadItems(?array $data): void
	{
		$items = [];
		if ($data !== null) {
			foreach ($data as $key => $item) {
				$serviceitem = new ServiceItem();
				$serviceitem->attributes = $item;
				$items[$key] = $serviceitem;
			}
		} else {
			$items = [new ServiceItem()];
		}
		$this->items = $items;
	}


	public function CertnofromForms(){
		if (empty($this->certno) == true){
			$certno = new \yii\db\Expression("cast(json_value(`forms`.`data`, '$.certno') as INTEGER)");
			$form = \modules\forms\models\Forms::find()
			->select(["$certno as certno"])
			->where(['form' => $this->form])
			->orderby(['certno' => SORT_DESC])
			->limit(1)
			->asArray()
			->one();
			$result = empty($form['certno']) == false ? intval($form['certno']) + 1 : 2000;
		} else {
			$result = $this->certno;
		}
		return $result;
	}

	public function updateAsset(){
		$asset = Assetsbe::Find()->where(['id' => $this->assetid])->one();
		if($asset){
			$data = $asset->data;
			$data->last_service = $this->date_of_service;
			$data->next_service = $this->date_of_next_service;
			$data->last_service_id = $this->id;
			$asset->data  = $data;
			$asset->save();
		}
	}

	public function PreProcess()
	{
		
		if (empty($this->assetid) && !empty($this->serial_number) && !empty($this->productid)) {
			$asset = \modules\custom\models\Assetsbe::findbyserial($this->serial_number, $this->productid);
			if(!$asset && $this->actid !== null){	
				$asset = \modules\custom\models\Assetsbe::create($this->actid);
				$asset ? $this->assetid = $asset?->id : false;
			} else {
				$this->assetid = $asset?->id;
			}
		}
		
		empty($this->certno) == true ? $this->certno = $this->CertnofromForms() : false;
		$this->processItems(yii::$app->request->post());
	}
	
	public function postprocess(){
		if($this->status == 'Complete'){
			$this->updateAsset();
		}
	}

    

    public static function localattributes(){
        return [
			'id' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Id'),
				'input' => 'default',
			],
			'relatedid' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'related Id'),
				'input' => 'default',
			],
			'created_at' => [
				'rules' => [
					['integer']
				],
				'label' => Yii::t('app', 'Created At'),
				'input' => false,
			],
			'actid' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'related Id'),
				'input' => 'default',
			],
			'status' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Status'),
				'input' => 'default',
			],
			'servicesheetpdf' => [
				'rules' => [
					['safe']
				],
				'label' => Yii::t('app', 'Service Sheet'),
				'input' => 'default',
			],
            'items' => [
				'rules' => [
					['safe']
				],
				'label' => Yii::t('app', 'Addititional Items'),
				'input' => false,
			],
			'assetid' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Asset ID'),
				'input' => 'default',
			],
			'client_fullname' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Full Name'),
				'input' => 'default',
			],
			'client_address' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Client Address'),
				'input' => 'default',
			],
			'name' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Name'),
				'input' => 'default',
			],
			'phone' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Phone No'),
				'input' => 'default',
			],
			'mobile' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Mobile No'),
				'input' => 'default',
			],
			'email' => [
				'rules' => [
					['string'],
                    ['email'],
				],
				'label' => Yii::t('app', 'Email Address'),
                'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['type' => 'email', ],
					'width' => 'col-md-6',
				],
			],
			'ownerid' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Chandler / Agent'),
				'input' => 'default',
			],
			'agent' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Chandler / Agent'),
				'input' => 'default',
			],
			'instype' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Inspection Type'),
                'input' => [
					'input' => 'dropdownList',
					'fieldlist' => ['ORC' => 'ORC', 'ISO 9650-1' => 'ISO 9650-1', 'ISO 9650-2' => 'ISO 9650-2', 'SOLAS' => 'SOLAS', 'ISAF' => 'ISAF'], 
					'options' => ['prompt' => 'Please Select', 'class' => 'custom-select'],
					'width' => 'col-12 col-md-6',
				],
			],
			'packed' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Packed In'),
                'input' => [
					'input' => 'dropdownList',
					'fieldlist' => ['Valise' => 'Valise', 'Canister' => 'Canister'], 
					'options' => ['prompt' => 'Please Select', 'class' => 'custom-select'],
					'width' => 'col-12 col-md-6',
				],
			],
			'productid' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'LifeRaft Type'),
                'input' => [
					'input' => 'widget',
					'fieldclass' => \modules\forms\widgets\ProductsDropdown::class,
					'fieldlist' => null,
					'options' => ['options' => ['prompt' => 'Please Select', 'class' => 'custom-select']],
					'width' => 'col-12 col-md-6',
				],
			],
			'size' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Size (No of Persons)'),
				'input' => 'default',
			],
			'ljtypea' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'LifeJacket Type'),
				'input' => 'default',
			],
			'productname' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'product Name'),
				'input' => 'default',
			],
			'serial_number' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Serial Number'),
                'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-5',
				],
			],
			'date_of_manufacturer' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Date of Manufacturer'),
				'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-12 col-md-6',
				],
			],
			'date_of_service' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Date of Service'),
                'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\date\DatePicker::class,
					'fieldlist' => null,
					'options' => ['type' => 1, 'pluginOptions' => ['convertFormat' => true, 'format' => 'dd/mm/yyyy']],
					'width' => 'col-12 col-md-6',
				],
			],
			'date_of_next_service' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Date of Next Service'),
                'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\date\DatePicker::class,
					'fieldlist' => null,
					'options' => ['type' => 1, 'pluginOptions' => ['convertFormat' => true, 'format' => 'dd/mm/yyyy']],
					'width' => 'col-12 col-md-6',
				],
			],
			'cylinder_serial_number' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Clyinder Serial Number'),
				'input' => 'default',
			],

			'cylinder_grossweight' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Cylinder Gross Weight'),
				'input' => 'default',
			],
			'cylinder_co2' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'CO2 (kg)'),
				'input' => 'default',
			],
			'cylinder_no2' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'N2 (kg)'),
				'input' => 'default',
			],
			'cylinder_hydro_testdate' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Hydrotest Date'),
                'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\date\DatePicker::class,
					'fieldlist' => null,
					'options' => ['type' => 1, 'options' => ['autocomplete' => 'n'], 'pluginOptions' => ['convertFormat' => true, 'format' => 'dd/mm/yyyy']],
					'width' => 'col-md-3',
				],
			],
			'cylinder_hydro_expriry' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Expiry'),
                'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\date\DatePicker::class,
					'fieldlist' => null,
					'options' => ['type' => 1, 'options' => ['autocomplete' => 'n'], 'pluginOptions' => ['convertFormat' => true, 'format' => 'dd/mm/yyyy']],
					'width' => 'col-md-3',
				],
			],
			'cylinder_serial_number_r' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Serial No'),
				'input' => 'default',
			],

			'cylinder_grossweight_r' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Gross (kg)'),
				'input' => 'default',
			],
			'cylinder_co2_r' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'CO2 (kg)'),
				'input' => 'default',
			],
			'cylinder_no2_r' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'N2 (kg)'),
				'input' => 'default',
			],
			'cylinder_hydro_testdate_r' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Hydrotest Date:'),
                'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\date\DatePicker::class,
					'fieldlist' => null,
					'options' => ['type' => 1, 'options' => ['autocomplete' => 'n'], 'pluginOptions' => ['convertFormat' => true, 'format' => 'dd/mm/yyyy']],
					'width' => 'col-md-3',
				],
			],
			'cylinder_hydro_expriry_r' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Expriy Date:'),
                'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\date\DatePicker::class,
					'fieldlist' => null,
					'options' => ['type' => 1, 'options' => ['autocomplete' => 'n'], 'pluginOptions' => ['convertFormat' => true, 'format' => 'dd/mm/yyyy']],
					'width' => 'col-md-3',
				],
			],

            'fhwc' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Wire & Clip'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'fhpb' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Pin & barrell (PFill)'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'fhsc' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Seal / Cap'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'fhhw' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Hose & washers'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'fhbody' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Body'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'fht' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Torque'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'fwpt' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Firing wire pull test'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'nrwt' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Newtons result within tolerance'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],

            'it1' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Raft inflates normally'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],

            'wptest' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'WP Test'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'it2' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', '30 mins pre-test to 2x working pressure *'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],

            'gitest' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'GI Test'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'it3' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Relief valve operation (lower)'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],

            'naptest' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'NAP Test'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
            'it4' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Relief valve operation (upper)'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],

            'fstest' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'FS Test'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
			'pressuretest' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Pressure Test'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-3',
				],
			],
			'pressuretest_start' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Start Time'),
				'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\time\TimePicker::class,
					'fieldlist' => null,
					'options' => ['options' => ['autocomplete' => 'n'], 'pluginOptions' => ['convertFormat' => true, 'format' => 'H:i']],
					'width' => 'col-md-3',
				],
			],
			'pressuretest_finish' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Finish Time'),
				'input' => [
					'input' => 'widget',
					'fieldclass' => \kartik\time\TimePicker::class,
					'fieldlist' => null,
					'options' => ['options' => ['autocomplete' => 'n'], 'pluginOptions' => ['convertFormat' => true, 'format' => 'H:i']],
					'width' => 'col-md-3',
				],
			],
            'pressuretest_starttemp' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Start Temp'),
                'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
            'pressuretest_finishtemp' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Finish Temp'),
                'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
			'pressuretest_lowertube_start' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Lower Tube Start'),
				'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
			
			'pressuretest_lowertube_finish' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Lower Tube Finish'),
				'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
			
			'pressuretest_uppertube_start' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Upper Tube Start'),
				'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
			'pressuretest_uppertube_finish' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Upper Tube Finish'),
				'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
			'pressuretest_arch_start' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Arch Start'),
				'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
			'pressuretest_arch_finish' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Arch Finish'),
				'input' => [
					'input' => 'textInput',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => [],
					'width' => 'col-md-3',
				],
			],
			'pressuretest_comments' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Comments'),
				'input' => 'default'
			],
			
			'verification1' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Lower Tube'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification2' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Upper Tube'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification3' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Arch'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification4' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Floor'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification5' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Canopy'),
                'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification6' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Zips/Closers'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification7' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Ballast Pockets'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification8' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Towline'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification9' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Painter'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification10' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Sea Anchor'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification11' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Quoit & Line'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification12' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Safety knife'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification13' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Rain Collection bag'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification14' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Vacuum bag'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification15' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', ''),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification16' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', ''),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification17' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', ''),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification18' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Equipment Bag'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification19' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Intruction manual'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification20' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Pump & Hose'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification21' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repair clamps x2'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification22' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Paddles x 2'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification23' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Sponges x 2'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification24' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Signal Card'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification25' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Torch & Batteries'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification26' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Red Hand Flares x3'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification27' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Whistle'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification28' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Bouyant bailer'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification29' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Container'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification30' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Gasket Seal'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification31' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'All label'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'verification32' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack1' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Secure Equipment'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack2' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Relief valves open'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack3' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Connect battery'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack4' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Assemble firing head'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack5' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Mount cylinder'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack6' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Vacuum chambers'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack7' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Close inflation valves'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack8' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack9' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack10' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack11' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack12' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack13' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack14' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-12',
				],
			],
			'repack15' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-12',
				],
			],
			'repack16' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Place in Vac. Bag'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack17' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Seal Vac. bag'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack18' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Vacuumed'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack19' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Valet canister'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack20' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Raft in canister'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack21' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Fit painter & plug'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack22' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Close & seal'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-12 col-md-6 ',
				],
			],
			'repack23' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-12',
				],
			],
			'repack24' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-12',
				],
			],
			'repack25' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-12',
				],
			],
			'repack26' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'Repack and fold lung & cover'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => null,
					'fieldlist' => null,
					'options' => ['label' => false, ],
					'width' => 'col-md-12',
				],
			],
			'technician' => [
				'rules' => [
					['safe']
				],
				'label' => Yii::t('app', "By Service Technician",),
				'input' => [
					'input' => 'widget',
					'fieldclass' => \modules\forms\widgets\TechDropdown::class,
					'fieldlist' => null,
					'options' => ['options' => ['prompt' => 'Please Select', 'class' => 'custom-select']],
					'width' => 'col-12 col-md-6',
				],
			],
			'tested' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', "Status",),
				'input' => [
					'input' => 'dropdownList',
					'fieldlist' => ['passed' => 'PASSED', 'failed' => 'FAILED'], 
					'options' => ['prompt' =>'Please Select'],
					'width' => 'col-12 col-md-6',
				],
			],
			'remarks' => [
				'rules' => [
					['string']
				],
				'label' => null,
				'input' => [
					'input' => 'widget',
					'fieldclass' => \common\widgets\TinyMce::class, 
					'fieldlist' => false, 
					'options' => ['height' => '100px'],
					'width' => 'col-12',
				],
			],

			'certno' => [
				'rules' => [
					['integer']
				],
				'label' => Yii::t('app', 'Certificate No'),
				'input' => [
					'input' => 'textInput',
					'fieldlist' => false, 
					'options' => ['type' => 'number', 'readonly' => true],
					'width' => 'col-12 col-md-3',
				],
			],
			'invoiceno' => [
				'rules' => [
					['integer']
				],
				'label' => Yii::t('app', 'Invoice Number'),
				'input' => [
					'input' => 'textInput',
					'fieldlist' => false, 
					'options' => ['type' => 'number'],
					'width' => 'col-12 col-md-3',
				],
			],
			'signature' => [
				'rules' => [
					['string']
				],
				'label' => Yii::t('app', 'Signature'),
				'input' => [
					'input' => 'widget',
					'fieldclass' => \common\widgets\SignatureInput::class,
					'fieldlist' => false, 
					'options' => [],
					'width' => 'col-12 col-md-3',
				],
			],
			'nodate' => [
				'rules' => [
					['boolean']
				],
				'label' => Yii::t('app', 'No Date'),
				'input' => [
					'input' => 'checkbox',
					'fieldclass' => false,
					'fieldlist' => false, 
					'options' => [],
					'width' => 'col-12 col-md-3',
				],
			],
        ];
        
    }

	public function ProcessItems($post){
		$items = $this->items;
		if(array_key_exists('ServiceItem', $post) == true){
			$postData = $post['ServiceItem'];
			$pageIds = [];
			foreach($postData as $key => $data){
				$pageIds[] = $data['id'];
			}
			$itemsb = [];
			foreach($items as $key => $item){
				$itemsa[$item['id']] = $item;
			}
			$x = 0;
			$results = [];
			foreach($postData as $key => $data){
				if(in_array($data['id'], $pageIds) == true && $data['id'] !== ''){
					$item = $itemsa[$data['id']];
					$item->attributes = $data;
					$results[] = $item->validate();
					$itemsb[$x] = $item;
				}elseif($data['id'] == ''){
					$item = new ServiceItem();
					$item->attributes = $data;
					$results[] = $item->validate();
					$itemsb[$x] = $item;
				}
				$x++;
			}
			$this->items = $itemsb;
			return \in_array(false, $results) ? false : true;
		} else {
			$this->items = [];
			return true;
		}
	}

	public function Pdf(){
		return \common\models\Base::generatePdf($this->id, null, \yii\helpers\Url::to(["/forms/pdfview", 'id' => $this->id, 'form' => 'ServiceLifeRaft']), $this->id.'.pdf', true);
	}

	public static function createServicesheet($actitem){
		$model = new self();
		$model->loadDefaultValues();
		$activity = $actitem->activity;
        $product = $actitem->productl;
		$model->relatedid = $actitem->id;
        $model->actid = $actitem->relatedid;
        $model->ownerid = $activity?->clientid;
        $model->productid = $actitem->product;
        $model->serial_number = $actitem->serial;
        property_exists($model, 'size') ? $model->size = $product?->data->custom->size : false;
        property_exists($model, 'packed') ? $model->packed = $product?->data->custom->packed : false;
        if(empty($actitem->serial) == false){
            $asset = $actitem->asset;
            $model->assetid = $actitem->assetid;
            $model->date_of_manufacturer =  is_object($asset) && empty($asset->dom) == false ? $asset->dom : null;
        }
        if(empty($client = $activity?->client) == false){
            $model->mobile =$client->adv->mobileno;
            $model->phone = $client->adv->phoneno;
            $model->email = $client->email;
        }elseif (!empty($activity->agentname)) {
            $agentl = $activity->agentl;
            if(property_exists($agentl, 'adv')){
                $model->email = $agentl->email;
                $model->mobile = $agentl->adv->mobileno;
                $model->phone = $agentl->adv->phoneno;
                $model->agent = $agentl->fullname;
            } else {
                $model->email = $agentl->email;
                $model->phone = $agentl->addressl?->telephone;
                $model->agent = $activity->agentname;

            }
        }
        $model->client_fullname = $activity?->clientname;
        $model->email = $activity?->email;
        $relatedparts = \modules\custom\models\Products::getPrimeparts($actitem->product);
        
        if(\is_array($relatedparts) && count($relatedparts) > 0){
            $items = [];
            foreach($relatedparts as $key => $part){
                $item = new \modules\forms\models\sub\ServiceItem();
                $item->id = \common\models\Base::Tempid();
                $item->type = $part['product_name'];
                $item->typeid = $part['id'];
                $item->qty = empty($part['pack_qty']) == false ?$part['pack_qty'] : 1;
                $items[$item->id] = $item;
            }
        } else {
            $items = $model->items;
        }
        $model->items = $items;
        return $model->save();
	}

	

	/**
     * Finds self
     */
    public static function findOne($options) {
       
		$model = \modules\forms\models\Forms::find()
			->onCondition(['form' => static::type])
			->andonCondition($options)
			->one();    
		if(!$model){
			return false;
		} else {
			$data = $model->data;
			$dataModel = new Self();
			//$dataModel->id = $dataModel->id == null ? $model->id : self::tempid();
			$dataModel->attributes = json_decode($data,1);
			$dataModel->loadItems($dataModel->items);
			return $dataModel;
		}
    }
	
	public function afterValidate(){
		
		return parent::afterValidate();
	}

	public function save(){
	//	$this->id = empty($this->id) ? (Yii::$app->controller->id == 'forms' ? $_GET['id'] : \common\models\Base::tempid()) : $this->id;
		yii::warning($this->attributes);	
		$formModel = \modules\forms\models\Forms::find()
			->onCondition(['form' => $this->form])
			->andonCondition(['id' => $this->id])
			->one();
		if($formModel){
			Yii::$app->request->isConsoleRequest == false && $this->hasMethod('PreProcess') ? $this->PreProcess(Yii::$app->request->post()) : false;
			Yii::$app->request->isConsoleRequest == false && $this->hasMethod('PostProcess') ? $this->PostProcess(Yii::$app->request->post()) : false;
		} else {
			$formModel = new \modules\forms\models\Forms([
				'id' => $this->id, 
				'language' => 'en', 
				'form' => $this->form, 
				'formclass' => $this->className(), 
				'relatedid' => $this->relatedid,
				'status' => 'Active',
			]);
		}
		
		if($this->validateModel()){
			$formModel->data = $this->attributes;
			return $formModel->save();
		}
		yii::Warning($this->errors);
		return false;
	}

	
	public function loadDefaultValues(){
		$this->id = \common\models\Base::Tempid();
		$this->it1 = true;
		$this->it2 = true;
		$this->it3 = true;
		$this->it4 = true;
		$this->fhwc = true;
		$this->fhpb = true;
		$this->fhsc = true;
		$this->fhhw = true;
		$this->fhbody = true;
		$this->fht = true;
		$this->fwpt = true;
		$this->nrwt = true;
		$this->gitest = true;
		$this->naptest = true;
		$this->wptest = true;
		$this->fstest = true;
		$this->repack1 = true;
		$this->repack2 = true;
		$this->repack3 = true;
		$this->repack4 = true;
		$this->repack5 = true;
		$this->repack6 = true;
		$this->repack7 = true;
		$this->repack8 = true;
		$this->repack9 = true;
		$this->repack10 = true;
		$this->repack11 = true;
		$this->repack12 = true;
		$this->repack13 = true;
		$this->repack14 = true;
		$this->repack15 = true;
		$this->repack16 = true;
		$this->repack17 = true;
		$this->repack18 = true;
		$this->repack19 = true;
		$this->repack20 = true;
		$this->repack21 = true;
		$this->repack22 = true;
		$this->repack23 = true;
		$this->repack24 = true;
		$this->repack25 = true;
		$this->repack26 = true;
		$this->verification1 = true;
		$this->verification2 = true;
		$this->verification3 = true;
		$this->verification4 = true;
		$this->verification5 = true;
		$this->verification6 = true;
		$this->verification7 = true;
		$this->verification8 = true;
		$this->verification9 = true;
		$this->verification10 = true;
		$this->verification11 = true;
		$this->verification12 = true;
		$this->verification13 = true;
		$this->verification14 = true;
		$this->verification15 = true;
		$this->verification16 = true;
		$this->verification17 = true;
		$this->verification18 = true;
		$this->verification19 = true;
		$this->verification20 = true;
		$this->verification21 = true;
		$this->verification22 = true;
		$this->verification23 = true;
		$this->verification24 = true;
		$this->verification25 = true;
		$this->verification26 = true;
		$this->verification27 = true;
		$this->verification28 = true;
		$this->verification29 = true;
		$this->verification30 = true;
		$this->verification31 = true;
		$this->verification32 = true;
	}

}

