<?php
/**
 * Wiaas Linked Packages Editor
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>

<div id="wiaas_documents" class="panel woocommerce_options_panel">
    <div class="options_group">
        <p class="form-field">
            <label style="font-weight: bold;" for="wiaas_addon_packages"><?php esc_html_e( 'Search documents:', 'wiaas' ); ?></label>
            <input
                    type="text"
                    data-target="wiaas_attached_documents"
                    data-search-nonce="<?php echo wp_create_nonce('wiaas_json_search_documents') ?>"
                    data-link-nonce="<?php echo wp_create_nonce('wiaas_link_document') ?>"
                    class="wiaas-search-documents"
            />
        </p>
    </div>
    <div class="options_group">
        <div class="form-field">
            <div style="margin:20px">
                <table id="wiaas_attached_documents" class="widefat wp-list-table">
                    <tbody>
                    <?php
                        foreach ($documents_ids as $id) {
                            require 'html-attached-document.php';
                        }
                    ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
