<?php if ( ! defined( 'ABSPATH' ) ) {
	exit;
} // Exit if accessed directly               ?>

<style type="text/css">
    .xl_dashboard_tab_content #support-request {
        margin-left: 10px;
    }
</style>
<div class="xl_plugins_wrap">
    <h1><?php _e( 'Request Support', 'xlplugins' ); ?></h1>
	<?php if ( $model ) { ?>
    <div class="wp-filter">
        <ul class="filter-links xl_plugins_license_links">
			<?php
			$licenses = XL_licenses::get_instance();
			$licenses->get_plugins_list();
			if ( ! empty( $licenses->plugins_list ) ) {
				?>
                <li class="plugin-install-featured <?php echo ( isset( $model->current_tab ) && $model->current_tab == 'licenses' ) ? 'current' : ''; ?>">
                    <a href="<?php echo esc_url( admin_url( 'admin.php?page=' . ( isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '' ) . '&tab=licenses' ) ); ?>"><?php _e( 'Licenses', 'xlplugins' ); ?></a>
                </li>
			<?php } ?>
            <li class="plugin-install-popular <?php echo ( isset( $model->current_tab ) && $model->current_tab == 'support' ) ? 'current' : ''; ?>">
                <a href="<?php echo esc_url( admin_url( 'admin.php?page=' . ( isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '' ) . '&tab=support' ) ); ?>"
                   class=""><?php _e( 'Support', 'xlplugins' ); ?></a></li>
			<?php if ( isset( $model->additional_tabs ) && is_array( $model->additional_tabs ) && count( $model->additional_tabs ) > 0 ): ?>
				<?php foreach ( $model->additional_tabs as $tab ): ?>
                    <li class="<?php echo ( isset( $model->current_tab ) && $model->current_tab == $tab['slug'] ) ? "current" : "" ?>">
                        <a href="<?php echo esc_url( admin_url( 'admin.php?page=' . ( isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '' ) . '&tab=' . esc_attr( $tab['slug'] ) ) ) ?>"><?php echo esc_html( $tab['label'] ); ?></a>
                    </li>
				<?php endforeach; ?>
			<?php endif; ?>
        </ul>
    </div>
    <br class="clear">
    <div id="col-container" class="about-wrap">
        <div class="xl_dashboard_tab_content" id="support">
            <div id="support-request">
				<?php
				$doc_link     = add_query_arg( array(
					'utm_source'   => 'xl-tools',
					'utm_campaign' => 'xl-support',
					'utm_medium'   => 'support-tab',
					'utm_term'     => 'documentation',
				), 'https://xlplugins.com/documentation/' );
				$support_link = add_query_arg( array(
					'utm_source'   => 'xl-tools',
					'utm_campaign' => 'xl-support',
					'utm_medium'   => 'support-tab',
					'utm_term'     => 'support',
				), 'https://xlplugins.com/support/' );
				$contact_link = add_query_arg( array(
					'utm_source'   => 'xl-tools',
					'utm_campaign' => 'xl-support',
					'utm_medium'   => 'support-tab',
					'utm_term'     => 'contact',
				), 'https://xlplugins.com/contact/' );
				echo __( '<p>Do you need support? We are happy to help :)</p><p> Please go through extensive documentation', 'xlplugins' ) . ' <a target="_blank" href="' . esc_url( $doc_link ) . '">https://xlplugins.com/documentation/</a>.</p>';
				echo __( '<p>If you are unable to find the answers, feel free to', 'xlplugins' ) . ' <a target="_blank" href="' . esc_url( $support_link ) . '">Raise the Ticket</a>.</p>';
				echo __( '<p>For any pre-sales questions, please fill out the', 'xlplugins' ) . ' <a target="_blank" href="' . esc_url( $contact_link ) . '">Contact Form</a>.</p>';
				?>
            </div>
			<?php do_action( 'xl_support_after_content' ); ?>
        </div>

        <div class="xl-area-right"> <?php do_action( 'xl_support_right_area' ); ?> </div>
		<?php } else { ?>
            <div
                class="xl_cannot_connect"> <?php echo wp_kses_post( apply_filters( 'xl_no_data_support', __( 'Could not connect to server.', 'xlplugins' ) ) ); ?></div><?php } ?>
    </div>
