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

use iwbvel\classes\helpers\Sanitizer;

include IWBVEL_VIEWS_DIR . "layouts/header.php"; ?>

<div id="iwbvel-body">
    <div class="iwbvel-tabs iwbvel-tabs-main">
        <div class="iwbvel-tabs-navigation">
            <nav class="iwbvel-tabs-navbar">
                <ul class="iwbvel-tabs-list" data-type="url" data-content-id="iwbvel-main-tabs-contents">
                    <?php echo wp_kses(apply_filters('iwbvel_top_navigation_buttons', ''), Sanitizer::allowed_html()); ?>
                </ul>
            </nav>

            <div class="iwbvel-top-nav-filters-per-page">
                <select id="iwbvel-quick-per-page" title="The number of products per page">
                    <?php
                    if (!empty($count_per_page_items)) :
                        $iwbvel_current_value = (!empty($current_settings['count_per_page'])) ? $current_settings['count_per_page'] : $settings['count_per_page'];
                        foreach ($count_per_page_items as $iwbvel_count_per_page_item) :
                    ?>
                            <option value="<?php echo intval($iwbvel_count_per_page_item); ?>" <?php echo ($settings['count_per_page'] == intval($iwbvel_count_per_page_item)) ? 'selected' : ''; ?>>
                                <?php echo esc_html($iwbvel_count_per_page_item); ?>
                            </option>
                    <?php
                        endforeach;
                    endif;
                    ?>
                </select>
            </div>

            <div class="iwbvel-top-nav-filters-go-to-page">
                <input type="number" id="iwbvel-top-nav-filters-go-to-page" title="Go to page" min="1" max="" placeholder="Page">
            </div>

            <div class="iwbvel-items-pagination"></div>
        </div>

        <div class="iwbvel-tabs-contents" id="iwbvel-main-tabs-contents">
            <div class="iwbvel-wrap">
                <div class="iwbvel-tab-middle-content">
                    <div class="iwbvel-table" id="iwbvel-items-table">
                        <?php
                        if (!empty($table) && file_exists($table)) :
                            include $table;
                        else :
                        ?>
                            <p style="width: 100%; text-align: center; padding: 10px 0;"><img src="<?php echo esc_url(IWBVEL_IMAGES_URL . 'loading.gif'); ?>" width="30" height="30"></p>
                        <?php endif; ?>
                    </div>
                    <div class="iwbvel-items-count"></div>
                </div>
            </div>
        </div>
        <div class="iwbvel-table-loading">
            <img src="<?php echo esc_url(IWBVEL_IMAGES_URL . 'loading-2.gif'); ?>" width="18" height="18">
        </div>
        <div class="iwbvel-created-by">
            <a href="https://ithemelandco.com" target="_blank">Created by iThemelandCo</a>
        </div>
    </div>
</div>

<?php include_once IWBVEL_VIEWS_DIR . "layouts/footer.php"; ?>