<?php

defined( 'ABSPATH' ) or exit;

$this_section = 'offers';

?>
<?php pwlpara_section_opening_tag( $this_section ); ?>
    <?php
        if ( $section == $this_section && $id !== false ) {
            $offer = pwlpar_get_offer( $id );

            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/offer-edit.php' );
        } else {
            ?>
            <div id="pwlpara-section-offers-main">
                <div class="pwlpara-opening-text">
                    <?php esc_html_e( 'Offers are a great way to reward your customers for their loyalty. You can create as many offers as you want and set the number of points required to redeem them.', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?>
                </div>
                <div id="pwlpara-section-offers-actions" class="pwlpara-section-actions">
                    <div>
                        <a href="<?php echo esc_attr( pwlpar_get_offer_edit_url( 0 ) ); ?>" class="button button-primary"><?php esc_html_e( 'Create Offer', 'pw-loyalty-points-and-rewards-for-woocommerce' ); ?></a>
                    </div>
                </div>
                <div id="pwlpara-section-offers-table-container"><?php
                    if ( $section == $this_section ) {
                        require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/offers-table.php' );
                    }
                ?></div>
            </div>
            <?php
        }
    ?>
</div>
<?php
