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

if (!defined('IWBVE_ACTIVE')):
    include IWBVEL_VIEWS_DIR . 'alerts/warning-active-pro.php';
else:
?>
    <p class="iwbvel-variations-swap-section-label"><?php esc_html_e('From', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>: </p>

    <div class="iwbvel-variations-swap-from-attribute">
        <div class="iwbvel-variations-swap-from-attribute-selector-container">
            <label for="iwbvel-variations-swap-from-attribute-selector"><?php esc_html_e('Select attribute', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
            <select id="iwbvel-variations-swap-from-attribute-selector">
                <option value=""><?php esc_html_e('Select', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></option>
                <?php
                if (!empty($attributes) && is_array($attributes)) :
                    foreach ($attributes as $iwbvel_attribute) :
                ?>
                        <option value="pa_<?php echo esc_attr($iwbvel_attribute->attribute_name); ?>"><?php echo esc_html($iwbvel_attribute->attribute_label); ?></option>
                <?php
                    endforeach;
                endif;
                ?>
            </select>
        </div>
        <div class="iwbvel-variations-term-loading">
            <p><img src="<?php echo esc_url(IWBVEL_IMAGES_URL . 'loading-2.gif'); ?>" width="24"></p>
        </div>
        <div class="iwbvel-variations-swap-from-term-selector-container" style="display: none;">
            <label for="iwbvel-variations-swap-from-term-selector"><?php esc_html_e('Select term', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
            <select id="iwbvel-variations-swap-from-term-selector"></select>
        </div>
    </div>

    <p class="iwbvel-variations-swap-section-label"><?php esc_html_e('Replace with', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>: </p>

    <div class="iwbvel-variations-swap-to-attribute">
        <div class="iwbvel-variations-swap-to-term-selector-container" style="display: none;">
            <label for="iwbvel-variations-swap-to-term-selector"><?php esc_html_e('Select term', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
            <select id="iwbvel-variations-swap-to-term-selector"></select>
        </div>
    </div>

    <div class="iwbvel-variations-swap-container">
        <button type="button" class="iwbvel-button iwbvel-button-blue iwbvel-variations-swap-button"><i class="iwbvel-icon-check"></i> <?php esc_html_e('Swap', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></button>
    </div>
<?php endif; ?>