<?php

global $backpack;

?>

<div class="wrap">
    <h1>BackPack</h1>

    <?php if ($backpack->isCronEnabled()) : ?>
        <div class="notice notice-error">
            <p>Cron events are set up to run via WordPress which is less reliable than server-driven cron events. You should strongly consider moving your cron events to the server. <a href="https://maxwebsolutions.co.uk/blog/moving-your-wordpress-cron-events-to-the-server" target="_blank">Read more about this here.</a></p>
        </div>
    <?php endif; ?>

    <h2 class="nav-tab-wrapper">
        <a href="?page=mws-backpack&tab=dashboard" class="nav-tab <?php echo (isset($_GET['tab']) && $_GET['tab'] === 'dashboard') ? 'nav-tab-active' : ''; ?>">
            Dashboard
        </a>

        <a href="?page=mws-backpack&tab=schedule" class="nav-tab <?php echo (isset($_GET['tab']) && $_GET['tab'] === 'schedule') ? 'nav-tab-active' : ''; ?>">
            Schedule
        </a>

        <a href="?page=mws-backpack&tab=history" class="nav-tab <?php echo (isset($_GET['tab']) && $_GET['tab'] === 'history') ? 'nav-tab-active' : ''; ?>">
            History
        </a>

        <a href="?page=mws-backpack&tab=log" class="nav-tab <?php echo (isset($_GET['tab']) && $_GET['tab'] === 'log') ? 'nav-tab-active' : ''; ?>">
            Log
        </a>

        <a href="?page=mws-backpack&tab=settings" class="nav-tab <?php echo (isset($_GET['tab']) && $_GET['tab'] === 'settings') ? 'nav-tab-active' : ''; ?>">
            Settings
        </a>
    </h2>

    <div class="tab-content">
        <?= $content ?>
    </div>
</div>