/home/lnzliplg/www/wp-content/themes/flex-ecommerce-store/inc/dashboard/tabs/start-dashboard.php
<?php
/**
 * Start Elementor.
 *
 */

$flex_ecommerce_store_theme = wp_get_theme();

?>
<!-- Start Elementor -->
<div id="flex-ecommerce-store-importer" class="tabcontent open">
    <div class="tab-outer-box-container tab-outer-box">
        <div class="flex-main-container">
            <div class="flex-inner-contain">
                <h3><?php esc_html_e('🎉 Thank you for activating the ', 'flex-ecommerce-store'); ?><span><?php echo esc_html( wp_get_theme()->get( 'Name' ) ); ?></span></h3>
                <p class="start-text"><?php esc_html_e('Get started quickly by importing the demo content or explore more powerful options below.', 'flex-ecommerce-store'); ?></p>
                <div class="info-link">
                    <a href="javascript:void(0);" id="install-activate-button" class="button admin-button info-button">
                        <?php esc_html_e('Import Demo', 'flex-ecommerce-store'); ?>
                    </a>
                    <a href="<?php echo esc_url( FLEX_ECOMMERCE_STORE_BUY_NOW ); ?>" class="button info-button" target="_blank">
                        <?php esc_html_e('Upgrade Pro', 'flex-ecommerce-store'); ?>
                    </a>
                    <a href="<?php echo esc_url( FLEX_ECOMMERCE_STORE_LIVE_DEMO ); ?>" class="button info-button" target="_blank">
                        <?php esc_html_e('Live Demo', 'flex-ecommerce-store'); ?>
                    </a>
                    <a href="<?php echo esc_url( FLEX_ECOMMERCE_STORE_DOCUMENTATION ); ?>" class="button info-button" target="_blank">
                        <?php esc_html_e('Documentation', 'flex-ecommerce-store'); ?>
                    </a>
                    <script type="text/javascript">
                    document.getElementById('install-activate-button').addEventListener('click', function () {
                        const flex_ecommerce_store_button = this;
                        const flex_ecommerce_store_redirectUrl = '<?php echo esc_url(admin_url("admin.php?page=fleximp-template-importer")); ?>';
                        // First, check if plugin is already active
                        jQuery.post(ajaxurl, { action: 'check_flex_import_activation' }, function (response) {
                            if (response.success && response.data.active) {
                                // Plugin already active — just redirect
                                window.location.href = flex_ecommerce_store_redirectUrl;
                            } else {
                                // Show Installing & Activating only if not already active
                                flex_ecommerce_store_button.textContent = 'Installing & Activating...';

                                jQuery.post(ajaxurl, {
                                    action: 'install_and_activate_flex_import_plugin_lite',
                                    nonce: '<?php echo wp_create_nonce("install_activate_nonce"); ?>'
                                }, function (response) {
                                    if (response.success) {
                                        window.location.href = flex_ecommerce_store_redirectUrl;
                                    } else {
                                        alert('Failed to activate the plugin.');
                                        flex_ecommerce_store_button.textContent = 'Try Again';
                                    }
                                });
                            }
                        });
                    });
                    </script>
                </div>
                <div class="flex-inner-info">
                    <div class="flex-inner-box">
                        <img src="<?php echo esc_url(get_theme_file_uri()); ?>/screenshot.png" />
                    </div>
                    <div class="flex-inner-content">
                        <div class="about-text">
                            <?php
                                $description_raw = $flex_ecommerce_store_theme->display( 'Description' );
                                $main_description = explode( 'Official', $description_raw );
                                ?>
                            <?php echo wp_kses_post( $main_description[0] ); ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="flex-bundle-contain">
                <div class="bundle-dashboard-box">
                    <img src="http://localhost/flex-update/wp-content/plugins/flex-import/assets/images/bundle-banner.png" alt="Plugin Logo" style="width:100%; height:100%">
                    <h3 class="bundle-heading"><?php esc_html_e('WordPress Theme Bundle', 'flex-ecommerce-store'); ?></h3>
                    <h3 class="bundle-subheading"><?php esc_html_e('Multiple Templates at Just $69', 'flex-ecommerce-store'); ?></h3>
                    <p class="bundle-para"><?php esc_html_e('Upgrade to the Pro version to unlock exclusive
                        templates, premium features, and advanced customization options.', 'flex-ecommerce-store'); ?></p>
                    <div>
                    <div class="banner-bundle-btn">
                        <a href="https://www.flextheme.net/products/wordpress-theme-bundle" class="btn bundle-btn" target="_blank" rel="noopener">
                            <?php esc_html_e('Get Bundle', 'flex-ecommerce-store'); ?>
                        </a>
                    </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>