<?php
namespace XIMSAPLUGIN\Element;

use Elementor\Controls_Manager;
use Elementor\Controls_Stack;
use Elementor\Group_Control_Typography;
use Elementor\Scheme_Typography;
use Elementor\Scheme_Color;
use Elementor\Group_Control_Border;
use Elementor\Repeater;
use Elementor\Widget_Base;
use Elementor\Utils;
use Elementor\Group_Control_Text_Shadow;
use Elementor\Group_Control_Background;
use Elementor\Plugin;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.

class digm_pricing_table extends Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Elementor widget name.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'digm-pricing-table-';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve Elementor widget title.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return esc_html__( 'Digital Marketing Pricing Tabel', 'ximsa' );
	}

	/**
	 * Get widget icon.
	 *
	 * Retrieve Elementor widget icon.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'gl-custom-icon';
	}

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the Elementor widget belongs to.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return [ 'ximsa' ];
	}

	/**
	 * Register Elementor widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.0
	 * @access protected
	 */
	 
	
	protected function register_controls() {
		$this->start_controls_section(
            'pricing_tabel_info',
            [
                'label' => __( 'Pricing Tabel', 'ximsa' ),
                'tab' => Controls_Manager::TAB_CONTENT,
            ]
        );
        $this->add_control(
			'tm_subtitle',
			[
				'label' => esc_html__( 'Sub Title', 'ximsa' ),
				'type' => Controls_Manager::TEXT,
			]
		);
        $this->add_control(
			'tm_title',
			[
				'label' => esc_html__( 'Title', 'ximsa' ),
				'type' => Controls_Manager::TEXT,
                'label_block' => true,
			]
		);
        $this->add_control(
			'description',
			[
				'label' => esc_html__( 'Description', 'ximsa' ),
				'type' => Controls_Manager::TEXTAREA,
                'label_block' => true,
			]
		);
        
        $this->end_controls_section();

		$this->start_controls_section(
            'price_item_options',
            [
                'label' => __( 'Priceing Options', 'ximsa' ),
                'tab' => Controls_Manager::TAB_CONTENT,
            ]
        );
        $this->add_control(
			'tab_title',
			[
				'label' => esc_html__( 'Yearly Title', 'ximsa' ),
				'type' => Controls_Manager::TEXT,
                'label_block' => true,
			]
		);
        $this->add_control(
			'tab_mont_title',
			[
				'label' => esc_html__( 'Monthy Title', 'ximsa' ),
				'type' => Controls_Manager::TEXT,
                'label_block' => true,
			]
		);
        $repeater = new \Elementor\Repeater();
        $repeater->add_control(
			'list_item',
			[
				'label' => esc_html__( 'List Item', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => esc_html__( 'Type your Pricing List Item here', 'ximsa' ),
                'label_block' => true,
			]
		);
        $this->add_control(
			'listitems',
			[
				'label' => esc_html__( 'Add Pricing List', 'ximsa' ),
				'type' => Controls_Manager::REPEATER,
				'fields' => $repeater->get_controls(),
                'title_field' => '{{{ list_item }}}',
			]
		);

        $repeater = new \Elementor\Repeater();
        $repeater->add_control(
			'is_populer',
			[
				'label' => esc_html__( 'Is Populer', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => esc_html__( 'YES', 'ximsa' ),
				'label_off' => esc_html__( 'NO', 'ximsa' ),
				'return_value' => 'yes',
				'default' => 'no',
			]
		);
        $repeater->add_control(
			'populer_badge',
			[
				'label' => esc_html__( 'Populer badge', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
                'label_block' => true,
                'condition' => ['is_populer' => 'yes'],
			]
		);
        $repeater->add_control(
			'title',
			[
				'label' => esc_html__( 'List Item', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => esc_html__( 'Pricing Title', 'ximsa' ),
                'label_block' => true,
			]
		);
        $repeater->add_control(
			'm_price',
			[
				'label' => esc_html__( 'Monthly Price', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => esc_html__( 'Price Monthly Type ', 'ximsa' ),
			]
		);
        $repeater->add_control(
			'yr_price',
			[
				'label' => esc_html__( 'Yearly Price', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => esc_html__( 'Price Yearly Type ', 'ximsa' ),
			]
		);
        $repeater->add_control(
			'currency',
			[
				'label' => esc_html__( 'currency', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => esc_html__( 'Currency Type ', 'ximsa' ),
			]
		);
        $repeater->add_control(
			'pricing_list',
			[
				'label' => esc_html__( 'Pricing List item', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::WYSIWYG,
				'placeholder' => esc_html__( 'Currency Type ', 'ximsa' ),
			]
		);
        $repeater->add_control(
			'pricing_btn',
			[
				'label' => esc_html__( 'Pricing Button', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'placeholder' => esc_html__( 'Type Pricing BUtton ', 'ximsa' ),
			]
		);
        $repeater->add_control(
			'btn_link',
			[
				'label' => esc_html__( 'Button Link', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::URL,
			]
		);
        $this->add_control(
			'pricings_items',
			[
				'label' => esc_html__( 'Add Pricing Item', 'ximsa' ),
				'type' => Controls_Manager::REPEATER,
				'fields' => $repeater->get_controls(),
                'title_field' => '{{{ title }}}',
			]
		);
        
		$this->end_controls_section();
        
        $this->start_controls_section(
            'section_title_style',
            [
                'label' => __( 'Section Title Settings', 'ximsa' ),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name' => 'shadown-bgbackground',
				'label' => esc_html__( 'Background', 'ximsa' ),
				'types' => [ 'classic' ],
				'exlcude' => [ 'color' ],
				'selector' => '{{WRAPPER}} .xis-dm-pricing-area:before',
			]
		);
        $this->add_control(
			'container_width',
			[
				'label' => esc_html__( 'Container Width', 'ximsa' ),
				'type' => \Elementor\Controls_Manager::SLIDER,
				'size_units' => [ 'px', '%' ],
				'range' => [
					'px' => [
						'min' => 0,
						'max' => 2000,
					],
					'%' => [
						'min' => 0,
						'max' => 100,
					],
				],
				
				'selectors' => [
					'{{WRAPPER}} .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl' => 'max-width: {{SIZE}}{{UNIT}};',
				],
			]
		);
        $this->add_control(
            'se__sub_title_style',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Sub Title Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );        
        $this->add_control(
            'sub_h_bg_cl',
            [
                'label'     => esc_html__( 'Sub Heading BG Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-section-title span' => 'background-color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_control(
            'se_sub_h_color',
            [
                'label'     => esc_html__( 'Sub Heading Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-section-title span' => 'color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'se_sth_typography',
                'label'          => esc_html__( 'Sub Typography', 'ximsa' ),
                'selector'       => '{{WRAPPER}} .xis-dm-section-title span',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        $this->add_control(
            'se_title_style',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Title Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'main_title_color',
            [
                'label'     => esc_html__( 'Heading Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-section-title h2' => 'color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'main_title_typography',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '{{WRAPPER}} .xis-dm-section-title h2',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        $this->add_control(
            'se_desc_style',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Desc Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'desc_title_color',
            [
                'label'     => esc_html__( 'Description Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-section-title p' => 'color: {{VALUE}} ',
                ],
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'desc_clo_typography',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '{{WRAPPER}} .xis-dm-section-title p',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        
        $this->end_controls_section();
        $this->start_controls_section(
            'pricing_settings_style',
            [
                'label' => __( 'Pricing Settings', 'ximsa' ),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_control(
            'pricing_title_stl',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Pricing Title Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'tm_ttl_color',
            [
                'label'     => esc_html__( 'Pricing Title Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-pricing-head h3' => 'color: {{VALUE}} ',
                ],
            ]
        );
        
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'tm_ttl_typography',
                'label'          => esc_html__( 'Pricing Title Typography', 'ximsa' ),
                'selector'       => '
                {{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-pricing-head h3
                ',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        $this->add_control(
            'price_cl',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Price Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'pricing_price_color',
            [
                'label'     => esc_html__( 'Price Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-pricing-head h4' => 'color: {{VALUE}} ',
                ],
            ]
        );
        
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'price_typography',
                'label'          => esc_html__( 'Price Typography', 'ximsa' ),
                'selector'       => '
                {{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-pricing-head h4
                ',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        $this->add_control(
            'list_item_st',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Price Item Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'price_item_color',
            [
                'label'     => esc_html__( 'Price Item Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-pricing-feature li' => 'color: {{VALUE}} ',
                ],
            ]
        );
        
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'price_itm_typography',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '
                {{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-pricing-feature li
                ',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );

        $this->add_control(
            'price_list_info',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Price List Info Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'price_list_info_cl',
            [
                'label'     => esc_html__( 'Price List Info Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-pricing-list li' => 'color: {{VALUE}} ',
                ],
            ]
        );
        
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'price_list_info_tp',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '
                {{WRAPPER}} .xis-dm-pricing-list li
                ',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );  
        $this->add_control(
            'pricin_tab_st',
            [
                'type'      => Controls_Manager::HEADING,
                'label'     => esc_html__( 'Pricing Tab Style', 'ximsa' ),
                'separator' => 'before',
            ]
        );
        $this->add_control(
            'pri_tab_color',
            [
                'label'     => esc_html__( 'Tab Item Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .pricing-tab-btn li' => 'color: {{VALUE}} !important',
                ],
            ]
        );
        $this->add_control(
            'pri_tab_act_color',
            [
                'label'     => esc_html__( 'Tab Item Active Color', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .pricing-tab-btn li .active' => 'color: {{VALUE}}!important ',
                ],
            ]
        );
        $this->add_control(
            'pri_tab_act_bg',
            [
                'label'     => esc_html__( 'Tab Item Active BG', 'ximsa' ),
                'type'      => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .pricing-tab-btn li .active' => 'background-color: {{VALUE}}!important ',
                ],
            ]
        );
        
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name'           => 'tb_item_typo',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '
                {{WRAPPER}} .pricing-tab-btn li
                ',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );  
             
        $this->end_controls_section();
        $this->start_controls_section(
            'button__content',
            [
                'label' => __( 'Button Style', 'ximsa' ),
                'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name'           => 'btn_typography',
                'label'          => esc_html__( 'Typography', 'ximsa' ),
                'selector'       => '
                    {{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn
                ',
                'fields_options' => [
                    'typography' => [
                        'default' => 'custom',
                    ],
                ],
            ]
        );
        $this->add_control(
			'btnwidth',
			[
				'label' => esc_html__( 'Width', 'ximsa' ),
				'type' => Controls_Manager::SLIDER,
				'size_units' => [ 'px', '%' ],
				'range' => [
					'px' => [
						'min' => 0,
						'max' => 1000,
						'step' => 5,
					],
					'%' => [
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn' => 'width: {{SIZE}}{{UNIT}};',
				],
			]
		);
        $this->add_control(
			'btnheight',
			[
				'label' => esc_html__( 'Height', 'ximsa' ),
				'type' => Controls_Manager::SLIDER,
				'size_units' => [ 'px', '%' ],
				'range' => [
					'px' => [
						'min' => 0,
						'max' => 1000,
						'step' => 5,
					],
					'%' => [
						'min' => 0,
						'max' => 100,
					],
				],
				'selectors' => [
					'{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn' => 'height: {{SIZE}}{{UNIT}};',
				],
			]
		);
        $this->start_controls_tabs( '_banner_button_1' );
        $this->start_controls_tab(
            '_glow-extension_btn__banner_normal',
            [
                'label' => esc_html__( 'Normal', 'ximsa' ),
            ]
        );
        $this->add_control(
            'btn__color',
            [
                'label'     => esc_html__( 'Color', 'ximsa' ),
                'type'      => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name'     => 'btn_bg_color',
                'label'    => __( 'Background', 'ximsa' ),
                'types'    => ['classic', 'gradient'],
                'exclude'  => ['image'],
                'selector' => '
                    {{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn
                ',
            ]
        );
        $this->add_group_control(
			\Elementor\Group_Control_Border::get_type(),
			[
				'name' => 'btn_border',
				'label' => esc_html__( 'Border', 'plugin-name' ),
				'selector' => '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn',
			]
		);
        $this->add_responsive_control(
            'btn_border_radious',
            [
                'label'      => esc_html__( 'Border Radius', 'ximsa' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px', '%'],
                'selectors'  => [
                    '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        
        $this->end_controls_tab();
        $this->start_controls_tab(
            '_glow-extension_btn_hover',
            [
                'label' => esc_html__( 'Hover', 'ximsa' ),
            ]
        );
        $this->add_control(
            'btn__hover_color',
            [
                'label'     => esc_html__( 'Color', 'ximsa' ),
                'type'      => \Elementor\Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn:hover' => 'color: {{VALUE}}',
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Background::get_type(),
            [
                'name'     => 'btn_hover_bg_color',
                'label'    => __( 'Background', 'ximsa' ),
                'types'    => ['classic', 'gradient'],
                'exclude'  => ['image'],
                'selector' => '
                    {{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn:hover
                ',
            ]
        );
        $this->add_group_control(
			\Elementor\Group_Control_Border::get_type(),
			[
				'name' => 'btn_hover_border',
				'label' => esc_html__( 'Border', 'plugin-name' ),
				'selector' => '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn:hover',
			]
		);
        $this->add_responsive_control(
            'btn_hover_border_radious',
            [
                'label'      => esc_html__( 'Border Radius', 'ximsa' ),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px', '%'],
                'selectors'  => [
                    '{{WRAPPER}} .xis-dm-pricing-inner-item .xis-dm-price-btn:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',                    
                ],
            ]
        );
        $this->end_controls_tab();
        $this->end_controls_tabs();
        $this->end_controls_section();
	}
		


	protected function render() {
		
		
		$settings = $this->get_settings_for_display();?>
		<!-- Start of Pricing section
        ============================================= -->
        <section id="xis-dm-pricing" class="xis-dm-pricing-section">
            <div class="container">
                <div class="xis-dm-section-title xis-dm-headline pera-content text-center">
                    <span><?php echo esc_html($settings['tm_subtitle']);?></span>
                    <h2><?php echo esc_html($settings['tm_title']);?></h2>
                    <p><?php echo esc_html($settings['description']);?></p>
                </div>
                <div class="xis-dm-pricing-content">
                    <div class="row">
                        <div class="col-lg-3  no-padding">
                            <div class="xis-dm-pricing-tab-btn-feature">
                                <div class="pricing-tab-btn">
                                    <ul class="nav nav-tabs" id="myTab" role="tablist">
                                        <li class="nav-item" role="presentation">
                                            <div class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" role="tab"  aria-selected="true">
                                                <?php echo esc_html($settings['tab_title']);?>
                                            </div>
                                        </li>
                                        <li class="nav-item" role="presentation">
                                            <div class="nav-link" id="home-tab" data-bs-toggle="tab" data-bs-target="#home2" role="tab"  aria-selected="true">
                                            <?php echo esc_html($settings['tab_mont_title']);?>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                                <div class="xis-dm-pricing-list ul-li-block">
                                    <ul>
                                        <?php foreach($settings['listitems'] as $lst):?>
                                        <li><?php echo esc_html($lst['list_item']);?></li>
                                        <?php endforeach;?>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-9 no-padding">
                            <div class="tab-content" id="myTabContent">
                                <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
                                    <div class="row xis-dm-pricing-area position-relative">
                                        <?php foreach($settings['pricings_items'] as $item):?>
                                            
                                        <div class="col-lg-4 no-padding">
                                            <div class="xis-dm-pricing-inner-item position-relative">
                                            <?php if($item['is_populer'] == 'yes'):?>
                                            <span class="xis-dm-price-badge position-absolute"><img src="<?php echo esc_url($item['populer_badge']['url']);?>"></span>
                                            <?php endif;?>
                                                <div class="xis-dm-pricing-head xis-dm-headline text-center">
                                                    <h3><?php echo esc_html($item['title']);?></h3>
                                                    <h4><?php echo esc_html($item['currency']);?><?php 
                                                        echo esc_html($item['yr_price']);
                                                    ?></h4>
                                                </div>
                                                <div class="xis-dm-pricing-feature ul-li-block text-center">
                                                    <?php echo wp_kses( $item['pricing_list'], true );?>
                                                    <a class="xis-dm-price-btn d-flex align-items-center justify-content-center" href="<?php echo esc_url($item['btn_link']['url']);?>"><?php echo esc_html($item['pricing_btn']);?></a>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach;?>
                                    </div>
                                </div>
                                <div class="tab-pane fade" id="home2" role="tabpanel" aria-labelledby="home-tab">
                                    <div class="row xis-dm-pricing-area position-relative">
                                    <?php foreach($settings['pricings_items'] as $item):?>
                                        <div class="col-lg-4 no-padding">
                                            <div class="xis-dm-pricing-inner-item position-relative">
                                                <?php if($item['is_populer'] == 'yes'):?>
                                                <span class="xis-dm-price-badge position-absolute"><img src="<?php echo esc_url($item['populer_badge']['url']);?>"></span>
                                                <?php endif;?>
                                                <div class="xis-dm-pricing-head xis-dm-headline text-center">
                                                    <h3><?php echo esc_html($item['title']);?></h3>
                                                    <h4><?php echo esc_html($item['currency']);?><?php 
                                                        echo esc_html($item['m_price']);
                                                    ?></h4>
                                                </div>
                                                <div class="xis-dm-pricing-feature ul-li-block text-center">
                                                    <ul><?php echo __( $item['pricing_list'] );?></ul>
                                                    <a class="xis-dm-price-btn d-flex align-items-center justify-content-center" href="<?php echo esc_url($item['btn_link']['url']);?>"><?php echo esc_html($item['pricing_btn']);?></a>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach;?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>		
    <!-- End of Pricing section
        ============================================= -->	

    <?php     
      }
	
}

