<?php

namespace Dashboard\Form;

use Zend\Form\Form;
use Zend\Form\Element\{
    Select,
    File,
    Text,
    Date,
    Radio,
    Submit,
    Checkbox,
    Email,
    Hidden,
    Textarea
};
use Zend\Validator\{
    NotEmpty,
    Digits,
    EmailAddress,
    StringLength
};
use Zend\InputFilter\InputFilterProviderInterface;

class SightseeingMetaTagForm extends Form implements InputFilterProviderInterface {

    public static $country = [];
    public static $state = [];
    public static $city = [];
    public static $category = [];
    public static $sightseeing_type = [];
    public static $things_to_carry = [];
    public static $season = [];
    public static $sightseeing_list = [];

    public function __construct($name = null) {

        parent::__construct('sightseeing-meta-tag-form');

        $this->setAttribute('method', 'post');


        /**
         * Sightseeing Name
         */
        $this->add([
            'name' => 'sightseeing_name',
            'type' => Select::class,
            'attributes' => [
                'id' => 'sightseeing-name',
                'class' => 'form-control',
                'disable_inarray_validator' => true
            ],
            'options' => [
                'label' => 'Sightseeing Name <span style="color: red"> *</span>',
                'disable_inarray_validator' => true,
                'label_options' => ['disable_html_escape' => true],
                'empty_option' => '--Select Name--',
                'value_options' => self::$sightseeing_list
            ],
        ]);


        /**
         * 
         * Meta Image
         */
        $this->add([
            'name' => 'activity_image',
            'type' => File::class,
            'attributes' => [
                'id' => 'activity-image',
                'class' => 'form-control sightseeing-common-upload-file',
                'data-level-name' => 'main_image'
            ],
            'options' => [
                'label' => 'Upload Images<span style="color: red"> *</span>',
                'label_options' => ['disable_html_escape' => true]
            ],
        ]);

        /**
         * 
         * Meta Image
         */
        $this->add([
            'name' => 'spots_image',
            'type' => File::class,
            'attributes' => [
                'id' => 'spots-image',
                'class' => 'form-control sightseeing-common-upload-file',
                'data-level-name' => 'gallery_image'
            ],
            'options' => [
                'label' => 'Upload Images<span style="color: red"> *</span>',
                'label_options' => ['disable_html_escape' => true]
            ],
        ]);

        /**
         * 
         * Default Feature
         *
         */
        $this->add([
            'type' => Radio::class,
            'name' => 'default_feature',
            'attributes' => [
                'id' => 'default-feature',
                'style' => 'font-normal'
            ],
            'options' => [
                'label' => 'Do you Choose?',
                'value_options' => [
                    '0' => 'Default Pic',
                ],
            ],
        ]);







        /**
         * 
         * Tours

         */
        $this->add([
            'name' => 'related_tours',
            'type' => Select::class,
            'attributes' => [
                'id' => 'related-tours',
                'placeholder' => 'tours',
                'class' => 'demo-default input-tags selectized form-control',
                'multiple' => 'multiple',
            ],
            'options' => [
                'label' => 'Select Related tours <span style="color: red"> *</span>',
                'label_options' => ['disable_html_escape' => true],
                'empty_option' => '--Select tours--',
                'value_options' => [
                    '1' => '3-Day Bus Tour to Washington D.C. , Philadelphia, Niagara Falls from New York',
                    '2' => 'Amazing Madhabkunda waterfall',
                    '3' => 'Darjeeling Tour Packages',
                    '4' => 'East Coast US from Washington D.CSpots',
                    '5' => 'Enticing Bali',
                    '6' => 'Essence of Kashmir and Ladakh Tour',
                    '7' => 'Grand Canyon Railway Adventure Package',
                    '8' => 'Independent 3-Day Trip to Liverpool including the Beatles Story Experience',
                    '9' => 'Kuala Lumpur &amp; Penang Wonder',
                    '10' => 'Lalbagh fort Tour'
                ]
            ],
        ]);



        /**
         * Brochure Title
         */
        $this->add([
            'name' => 'brochure_title',
            'type' => Text::class,
            'attributes' => [
                'id' => 'brochure-title',
                'placeholder' => 'Brochure title',
                'class' => 'form-control inputchange',
                'onkeypress'=>'return isAlpha(event)'
            ],
            'options' => [
                'label' => 'Brochure Title<span style="color: red">*</span>',
                'label_options' => ['disable_html_escape' => true]
            ],
        ]);
        /**
         * Brochure Description
         */
        $this->add([
            'name' => 'brochure_description',
            'type' => Textarea::class,
            'attributes' => [
                'id' => 'brochure-description',
                'placeholder' => 'Brochure description',
                'class' => 'form-control editor',
                'onkeypress'=>'return isAlpha(event)'
            ],
            'options' => [
                'label' => 'Brochure Description<span style="color: red">*</span>',
                'label_options' => ['disable_html_escape' => true]
            ],
        ]);

        /**
         * Meta Title
         */
        $this->add([
            'name' => 'meta_title',
            'type' => Text::class,
            'attributes' => [
                'id' => 'meta-title',
                'placeholder' => 'Meta title',
                'class' => 'form-control inputchange',
                'onkeypress'=>'return isAlpha(event)'
            ],
            'options' => [
                'label' => 'Meta Title<span style="color: red">*</span>',
                'label_options' => ['disable_html_escape' => true]
            ],
        ]);

        /**
         * Meta Keywords
         */
        $this->add([
            'name' => 'meta_keywords',
            'type' => Text::class,
            'attributes' => [
                'id' => ' meta_keywords',
                'placeholder' => ' Meta keywords',
                'class' => 'form-control inputchange',
                'onkeypress'=>'return isAlpha(event)'
            ],
            'options' => [
                'label' => 'Meta Keywords <span style="color: red">*</span>',
                'label_options' => ['disable_html_escape' => true]
            ],
        ]);

        /**
         * Meta Description
         */
        $this->add([
            'name' => 'meta_description',
            'type' => Textarea::class,
            'attributes' => [
                'id' => 'meta-description',
                'placeholder' => 'Meta description',
                'class' => 'form-control editor',
                'onkeypress'=>'return isAlpha(event)'
            ],
            'options' => [
                'label' => 'Meta Description<span style="color: red">*</span>',
                'label_options' => ['disable_html_escape' => true]
            ],
        ]);


        /**
         *  Submit
         */
        $this->add([
            'name' => 'submit',
            'type' => Submit::class,
            'attributes' => [
                'id' => 'save',
                'placeholder' => 'save',
                'class' => 'btn btn-red defaultbtnsearch btn-warning',
                'value' => 'Save'
            ],
        ]);
        
        
         $this->add([
            'name' => 'id',
            'type' => Hidden::class,
            'attributes' => [
                'id' => 'id'
            ],
        ]);
    }

    public function getInputFilterSpecification() {
        return [
            'related_tours' => [
                'required' => true,
                'filters' => [
                    ['name' => 'StripTags'],
                    ['name' => 'StringTrim']
                ],
                'validators' => [
                    ['name' => 'NotEmpty',
                        'options' => [
                            'messages' => [
                                NotEmpty::IS_EMPTY => 'Please Select tours'
                            ]
                        ],
                        'break_chain_on_failure' => true
                    ]
                ]
            ],
            'default_feature' => [
                'required' => false,
                'filters' => [
                    ['name' => 'StripTags'],
                    ['name' => 'StringTrim']
                ],
                'validators' => [
                    ['name' => 'NotEmpty',
                        'options' => [
                            'messages' => [
                                NotEmpty::IS_EMPTY => 'Please Select tours'
                            ]
                        ],
                        'break_chain_on_failure' => true
                    ]
                ]
            ],
            'brochure_title' => [
                'required' => true,
                'filters' => [
                    ['name' => 'StripTags'],
                    ['name' => 'StringTrim']
                ],
                'validators' => [
                    ['name' => 'NotEmpty',
                        'options' => [
                            'messages' => [
                                NotEmpty::IS_EMPTY => 'Please Provide Brochure Title'
                            ]
                        ],
                        'break_chain_on_failure' => true
                    ]
                ]
            ],
            'brochure_description' => [
                'required' => true,
                'filters' => [
                    ['name' => 'StripTags'],
                    ['name' => 'StringTrim']
                ],
                'validators' => [
                    ['name' => 'NotEmpty',
                        'options' => [
                            'messages' => [
                                NotEmpty::IS_EMPTY => 'Please Provide Brochure Description'
                            ]
                        ],
                        'break_chain_on_failure' => true
                    ]
                ]
            ],
            'meta_keywords' => [
                'required' => true,
                'filters' => [
                    ['name' => 'StripTags'],
                    ['name' => 'StringTrim']
                ],
                'validators' => [
                    ['name' => 'NotEmpty',
                        'options' => [
                            'messages' => [
                                NotEmpty::IS_EMPTY => 'Please Provide Meta Keywords'
                            ]
                        ],
                        'break_chain_on_failure' => true
                    ]
                ]
            ],
            'meta_title' => [
                'required' => true,
                'filters' => [
                    ['name' => 'StripTags'],
                    ['name' => 'StringTrim']
                ],
                'validators' => [
                    ['name' => 'NotEmpty',
                        'options' => [
                            'messages' => [
                                NotEmpty::IS_EMPTY => 'Please Provide Meta Title'
                            ]
                        ],
                        'break_chain_on_failure' => true
                    ]
                ]
            ],
            'meta_description' => [
                'required' => true,
                'filters' => [
                    ['name' => 'StripTags'],
                    ['name' => 'StringTrim']
                ],
                'validators' => [
                    ['name' => 'NotEmpty',
                        'options' => [
                            'messages' => [
                                NotEmpty::IS_EMPTY => 'Please Provide Meta Description'
                            ]
                        ],
                        'break_chain_on_failure' => true
                    ]
                ]
            ],
        ];
    }

}
