<?php
namespace dpcdCategoryDesign;

/**
 * The admin-specific functionality of the plugin.
 *
 * @link       https://dynamicweblab.com/
 * @since      1.0.0
 *
 * @package Woocommerce Product Categories Design
 */

/**
 * GetHelp Singleton class
 */
class GetHelp {

    /**
     * Holds the single instance of the class
     *
     * @var GetHelp
     */
    private static $instance = null;

    /**
     * Private constructor to prevent direct object creation
     */
    private function __construct() {
        $this->init();
    }

    /**
     * Prevent object cloning
     */
    private function __clone() {}

    /**
     * Prevent object unserialization
     */
    public function __wakeup() {}
    /**
     * Get the singleton instance of the class
     *
     * @return GetHelp
     */
    public static function get_instance() {
        if ( self::$instance === null ) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    /**
     * Initialize the class functionality
     */
    protected function init() {
       \add_action( 'admin_menu', array( $this, 'create_menu' ) );
       
    }

    /**
     * Create plugin settings menu
     *
     * @since 1.0
     */
    public function create_menu() {
        $tm_settings_menu = add_submenu_page( 
            'edit.php?post_type=dpcd_category_design', 
            __('Get Help', 'dynamic-product-categories-design'), 
            __('Get Help', 'dynamic-product-categories-design'), 
            'manage_options', 
            'dpcd_get_help', 
            [ $this, 'setting_function_callback' ] 
        );

        add_action( "admin_print_styles-{$tm_settings_menu}", array( $this, 'add_admin_script' ) );
    }

    /**
     * Add admin script
     */
    public function add_admin_script() {
        wp_enqueue_style('dpcd-category-help-admin');
    }

    /**
     * Register settings function
     *
     * @since 1.0
     */
    public function setting_function_callback() {

        ?>
            <section class="wp-dpcd-get-help wp-dpcd-header">
                <div class="wp-dpcd-header-area">
                    <div class="wp-dpcd-container">
                        <div class="wp-dpcd-header-logo">
                            <h2><?php esc_html_e( 'Dynamic Product Category Grid, Slider for WooCommerce', 'dynamic-product-categories-design' ); ?> <span>v<?php echo esc_html( defined( 'DPCD_VERSION' ) ? DPCD_VERSION : '1.0.0' ); ?></span></h2>
                            
                        </div>
                    </div>
                    <div class="wp-dpcd-header-logo-shape"></div>
                </div>
            </section>

            <section class="wp-dpcd-document-wrap">

            <div class="wp-dpcd-document-box">
                <h2><?php esc_html_e( 'Explore the standout features of our plugin designed to enhance your WooCommerce store’s functionality and user experience.', 'dynamic-product-categories-design' )?></h2>
                <img src="<?php echo esc_url( DPCD_ASSETS .  '/images/help-banner.png' ); ?>" alt="Explore">
                </div>
             </section>
            

            <section class="wp-dpcd-document-wrap">
                <div class="wp-dpcd-card-section" style="margin-bottom: 20px;">
                    <div class="wp-dpcd-document-box wp-dpcd-document-box-card">
                        <div class="wp-dpcd-box-icon">
                            <i class="dashicons dashicons-media-document"></i>
                            <h3 class="wp-dpcd-box-title"><?php esc_html_e( 'Documentation', 'dynamic-product-categories-design' )?></h3>
                        </div>

                        <div class="wp-dpcd-box-content">
                                <p><?php esc_html_e( 'Get started by spending some time with the documentation we included step by step process with screenshots with video.', 'dynamic-product-categories-design' )?></p>
                                <a href="<?php echo esc_url( 'https://demo.dynamicweblab.com/docs/dynamic-product-category-grid-slider-for-woocommerce/' )?>" target="_blank" class="wp-dpcd-admin-btn"><?php esc_html_e( 'Documentation', 'dynamic-product-categories-design' )?></a>
                        </div>
                    </div>

                    <div class="wp-dpcd-document-box wp-dpcd-document-box-card">
                        <div class="wp-dpcd-box-icon">
                            <i class="dashicons dashicons-sos"></i>
                            <h3 class="wp-dpcd-box-title"><?php esc_html_e( 'Need Help?', 'dynamic-product-categories-design' )?></h3>
                        </div>

                        <div class="wp-dpcd-box-content">
                            <p><?php esc_html_e( 'Stuck with something? Please create a ticket here', 'dynamic-product-categories-design' )?></p>
                            <a href="<?php echo esc_url( 'https://dynamicweblab.com/submit-a-request/' )?>" target="_blank" class="wp-dpcd-admin-btn"><?php esc_html_e( 'Get Support', 'dynamic-product-categories-design' )?></a>
                        </div>
                    </div>

                    <div class="wp-dpcd-document-box wp-dpcd-document-box-card">
                        <div class="wp-dpcd-box-icon">
                            <i class="dashicons dashicons-smiley"></i>
                            <h3 class="wp-dpcd-box-title"><?php esc_html_e( 'Happy Our Work?', 'dynamic-product-categories-design' )?></h3>
                        </div>
                        <div class="wp-dpcd-box-content">
                            <p><?php esc_html_e( 'If you happy with', 'dynamic-product-categories-design' )?> <strong><?php esc_html_e( 'Dynamic Product Category', 'dynamic-product-categories-design' )?></strong> <?php esc_html_e( 'plugin, please add a rating. It would be glad to us.', 'dynamic-product-categories-design' )?></p>
                            <a href="<?php echo esc_url( 'https://wordpress.org/support/plugin/dynamic-product-categories-design/reviews/#new-post' )?>" class="wp-dpcd-admin-btn" target="_blank"><?php esc_html_e( 'Post Review', 'dynamic-product-categories-design' )?></a>
                        </div>
                    </div>
                </div>
            </section>

            
        <?php 
    } 

}

// Instantiate the class
GetHelp::get_instance();