<?php

defined( 'ABSPATH' ) or exit;

require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/header.php' );

//
// Nonce verification not needed because we only use for string comparison.
//
// phpcs:disable WordPress.Security.NonceVerification
$section = isset( $_GET['section'] ) ? sanitize_text_field( wp_unslash( $_GET['section'] ) ) : false;
$id = isset( $_GET['id'] ) ? absint( $_GET['id'] ) : false;
// phpcs:enable

?>
<div id="pwlpara-main-content" class="woocommerce">
    <?php
        if ( pwlpara_show_setup_wizard() ) {
            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/welcome.php' );
        } else {
            if ( !pwlpar_is_active() ) {
                ?>
                <div class="notice notice-warning" style="max-width: 700px; margin-bottom: 24px; padding: 12px;">
                    <p style="font-size: 1.5em;">
                        <?php
                            esc_html_e( 'The rewards program is currently INACTIVE', 'pw-loyalty-points-and-rewards-for-woocommerce' );
                        ?>
                    </p>
                    <p>
                        <?php
                            printf(
                                /* translators: %s: settings page link */
                                esc_html__( 'Your customers will not be able to earn points, claim offers, or join the program. When you’re ready to go live, go to the %s page to activate your rewards program.', 'pw-loyalty-points-and-rewards-for-woocommerce' ),
                                '<a href="' . esc_attr( pwlpara_admin_url( 'settings' ) ) . '" id="pwlpara-inactive-settings-link">' . esc_html__( 'Settings', 'pw-loyalty-points-and-rewards-for-woocommerce' ) . '</a>'
                            );
                        ?>
                    </p>
                    <p>
                        <span style="font-weight: bold;">
                            <?php
                                esc_html_e( 'Administrators can view everything on the front end for testing purposes.', 'pw-loyalty-points-and-rewards-for-woocommerce' );
                            ?>
                        </span>
                        <?php
                            esc_html_e( 'To see what your customers will experience while the loyalty program is inactive, open a private browsing window, use a different web browser, or simply log out and view your shop.', 'pw-loyalty-points-and-rewards-for-woocommerce' );
                        ?>
                    </p>
                </div>
                <?php
            }

            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/section-buttons.php' );
            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/dashboard.php' );
            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/members.php' );
            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/promos.php' );
            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/offers.php' );
            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/settings.php' );
            require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/sections/help.php' );
        }
    ?>
</div>
<?php

require_once( PWLPAR_PLUGIN_DIR . '/admin/ui/footer.php' );
