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

<div class="iwbvel-float-side-modal" id="iwbvel-float-side-modal-column-profiles">
    <div class="iwbvel-float-side-modal-container">
        <div class="iwbvel-float-side-modal-box">
            <div class="iwbvel-float-side-modal-content">
                <div class="iwbvel-float-side-modal-title">
                    <h2><?php esc_html_e('Column Profiles', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></h2>
                    <button type="button" class="iwbvel-float-side-modal-close" data-toggle="float-side-modal-close">
                        <i class="iwbvel-icon-x"></i>
                    </button>
                </div>
                <form action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post" style="float: left; width: 100%; height: 100%;">
                    <?php wp_nonce_field('iwbvel_post_nonce'); ?>
                    <input type="hidden" name="action" value="iwbvel_load_column_profile">
                    <div class="iwbvel-float-side-modal-body">
                        <div class="iwbvel-wrap">
                            <div class="iwbvel-alert iwbvel-alert-default">
                                <span><?php esc_html_e('You can load saved column profile presets through Column Manager. You can change the columns and save your changes too.', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></span>
                            </div>
                            <div class="iwbvel-column-profiles-choose">
                                <label for="iwbvel-column-profiles-choose"><?php esc_html_e('Choose Preset', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></label>
                                <select id="iwbvel-column-profiles-choose" name="preset_key">

                                </select>
                                <label class="iwbvel-column-profile-select-all">
                                    <input type="checkbox" id="iwbvel-column-profile-select-all" data-profile-name="<?php echo (!empty($active_columns_key)) ? esc_attr($active_columns_key) : ''; ?>">
                                    <span><?php esc_html_e('Select All', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?></span>
                                </label>
                            </div>
                            <div class="iwbvel-column-profile-search">
                                <label for="iwbvel-column-profile-search"><?php esc_html_e('Search', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?> </label>
                                <input type="text" id="iwbvel-column-profile-search" placeholder="<?php esc_attr_e('Search Column ...', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>">
                            </div>
                            <div class="iwbvel-column-profiles-fields">
                                <div style="width:100%; text-align: center;">
                                    <img src="<?php echo esc_url(IWBVEL_IMAGES_URL . 'loading-2.gif'); ?>" alt="Loading ..." width="22" height="22">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="iwbvel-float-side-modal-footer">
                        <button type="submit" class="iwbvel-button iwbvel-button-blue iwbvel-float-left" id="iwbvel-column-profiles-apply" data-preset-key="default">
                            <?php esc_html_e('Apply To Table', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>
                        </button>
                        <div class="iwbvel-column-profile-save-dropdown" style="display: none">
                            <span>
                                <?php esc_html_e('Save Changes', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>
                                <i class="iwbvel-icon-chevron-down"></i>
                            </span>
                            <div class="iwbvel-column-profile-save-dropdown-buttons">
                                <ul>
                                    <li id="iwbvel-column-profiles-update-changes" <?php echo (!empty($active_columns_key) && !empty($default_columns_name) && in_array($active_columns_key, $default_columns_name)) ? 'style="display:none;"' : ''; ?>>
                                        <?php esc_html_e('Update selected preset', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>
                                    </li>
                                    <li id="iwbvel-column-profiles-save-as-new-preset">
                                        <?php esc_html_e('Save as new preset', 'ithemeland-bulk-variation-editing-for-woocommerce'); ?>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>