<?php
/**
 * Admin: "Dashboard" page
 *
 *
 */
if (!defined('ABSPATH')) {
    exit;
}
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$active_tab = isset($_GET['tab']) ? sanitize_text_field( wp_unslash($_GET['tab'])) : 'stripe';
?>
<div class="wrap">

 <h2 class="nav-tab-wrapper">
        <a href="?page=chama-settings&tab=stripe" class="nav-tab <?php echo $active_tab == 'stripe' ? 'nav-tab-active' : ''; ?>">Stripe</a>
        <a href="?page=chama-settings&tab=recaptcha" class="nav-tab <?php echo $active_tab == 'recaptcha' ? 'nav-tab-active' : ''; ?>">Google reCAPTCHA</a>
        <a href="?page=chama-settings&tab=users" class="nav-tab <?php echo $active_tab == 'users' ? 'nav-tab-active' : ''; ?>">Users</a>
        <a href="?page=chama-settings&tab=pages" class="nav-tab <?php echo $active_tab == 'pages' ? 'nav-tab-active' : ''; ?>">Pages</a>
        <a href="?page=chama-settings&tab=content" class="nav-tab <?php echo $active_tab == 'content' ? 'nav-tab-active' : ''; ?>">Content</a>
        <a href="?page=chama-settings&tab=protection" class="nav-tab <?php echo $active_tab == 'protection' ? 'nav-tab-active' : ''; ?>">Protection</a>
        <a href="?page=chama-settings&tab=display" class="nav-tab <?php echo $active_tab == 'display' ? 'nav-tab-active' : ''; ?>">Display</a>
        <a href="?page=chama-settings&tab=branding" class="nav-tab <?php echo $active_tab == 'branding' ? 'nav-tab-active' : ''; ?>">Branding</a>
        <a href="?page=chama-settings&tab=limits" class="nav-tab <?php echo $active_tab == 'limits' ? 'nav-tab-active' : ''; ?>">Payment Limits</a>
        <a href="?page=chama-settings&tab=email-settings" class="nav-tab <?php echo $active_tab == 'email-settings' ? 'nav-tab-active' : ''; ?>">Email Settings</a>
        <a href="?page=chama-settings&tab=email-templates" class="nav-tab <?php echo $active_tab == 'email-templates' ? 'nav-tab-active' : ''; ?>">Email Templates</a>
        <a href="?page=chama-settings&tab=newsletter" class="nav-tab <?php echo $active_tab == 'newsletter' ? 'nav-tab-active' : ''; ?>">Newsletter</a>
        <a href="?page=chama-settings&tab=miscellaneous" class="nav-tab <?php echo $active_tab == 'miscellaneous' ? 'nav-tab-active' : ''; ?>">Miscellaneous</a>
        <a href="?page=chama-settings&tab=analytics" class="nav-tab <?php echo $active_tab == 'analytics' ? 'nav-tab-active' : ''; ?>">Analytics</a>

        </h2>





<?php
switch ($active_tab) {
    case 'stripe':
        include_once CHAMA_PATH . 'controllers/admin-settings-stripe.php'; // @phpstan-ignore-line
        include_once CHAMA_PATH . 'views/admin-settings-stripe.php';       // @phpstan-ignore-line
        break;
    case 'users':
        include_once CHAMA_PATH . 'views/admin-settings-users.php'; // @phpstan-ignore-line
        break;
    case 'recaptcha':
        include_once CHAMA_PATH . 'views/admin-settings-recaptcha.php'; // @phpstan-ignore-line
        break;
    case 'pages':
        include_once CHAMA_PATH . 'controllers/admin-settings-pages.php'; // @phpstan-ignore-line
        include_once CHAMA_PATH . 'views/admin-settings-pages.php';       // @phpstan-ignore-line
        break;
    case 'content':
        include_once CHAMA_PATH . 'views/admin-settings-content.php'; // @phpstan-ignore-line
        break;
    case 'protection':
        include_once CHAMA_PATH . 'views/admin-settings-protection.php'; // @phpstan-ignore-line
        break;
    case 'display':
        include_once CHAMA_PATH . 'views/admin-settings-display.php'; // @phpstan-ignore-line
        break;
    case 'branding':
        include_once CHAMA_PATH . 'views/admin-settings-branding.php'; // @phpstan-ignore-line
        break;
    case 'limits':
        include_once CHAMA_PATH . 'views/admin-settings-limits.php'; // @phpstan-ignore-line
        break;
    case 'email-settings':
        include_once CHAMA_PATH . 'views/admin-settings-emails.php'; // @phpstan-ignore-line
        break;
    case 'email-templates':
        include_once CHAMA_PATH . 'views/admin-settings-templates.php'; // @phpstan-ignore-line
        break;
    case 'newsletter':
        include_once CHAMA_PATH . 'views/admin-settings-newsletter.php'; // @phpstan-ignore-line
        break;
    case 'analytics':
        include_once CHAMA_PATH . 'views/admin-settings-analytics.php'; // @phpstan-ignore-line
        break;
    case 'miscellaneous':
        include_once CHAMA_PATH . 'views/admin-settings-miscellaneous.php'; // @phpstan-ignore-line
        break;

}
?>

</div>
<?php
