<?php

defined( 'ABSPATH' ) or exit;

$this_section = 'members';

?>
<?php pwlpara_section_opening_tag( $this_section ); ?>
    <?php
        if ( $section == $this_section && $id !== false ) {
            $member = pwlpar_get_member( $id );
            if ( $member ) {
                require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/member-edit.php' );
            } else {
                ?><div><?php esc_html_e( 'Member not found.', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?></div><?php
            }
        } else {
            ?>
            <div id="pwlpara-section-members-main">
                <div>
                    <?php esc_html_e( 'Members are customers who have signed up for your rewards program. Click the View Details button to see transactions and other information.', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?>
                </div>
                <div id="pwlpara-section-members-actions" class="pwlpara-section-actions">
                    <div>
                        <form id="pwlpara-section-members-search-form">
                            <input type="search" id="pwlpara-members-search-input" name="search" value="">
                            <button class="button"><?php echo esc_attr( 'Search members', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?></button>
                        </form>
                    </div>
                </div>
                <div id="pwlpara-members-table-container"><?php
                    if ( $section == $this_section ) {
                        require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/members-table.php' );
                    }
                ?></div>
            </div>
            <?php
        }
    ?>
</div>
<?php
