<?php 

if(!defined('ABSPATH'))
    exit;

global $syrus;

if(!isset($_GET['tab']))
    $_GET['tab'] = "theme-settings";

$layout = isset($_GET['layout']) ? $_GET['layout'] : null;

?>

<section class="section-header-admin">
    <div class="container-fluid">
        <div class="row">
            <div class="col-auto text-end">
                <img src="<?php echo SYRUS_THEME_URI . '/assets/img/main-menu-img.png' ?>" alt=""  height="60" loading="lazy">
            </div>
            <div class="col-auto d-flex flex-column justify-content-center">
                <h2 class="mb-0">Syrus Theme</h1>
                <p class="text-muted mb-0"><i><?php esc_html_e("Theme version",'syrus') ?> <?php echo $syrus->get_theme_version() ?></i></p>
            </div>
            <div class="col-auto ms-auto d-flex flex-column justify-content-center">
                <a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=support') ?>">
                    <button type="button" class="btn btn-sm btn-support"><?php esc_html_e("Support",'syrus') ?></button>
                </a>
            </div>
        </div>
    </div>
</section>

<section class="section-topnav-menu mb-0">
    <nav>
        <li class="<?php echo isset($_GET['tab']) && $_GET['tab'] == 'theme-settings' ? 'active' : '' ?>"><a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=theme-settings') ?>" class=""><i class="bi bi-gear me-2"></i><?php esc_html_e("Settings",'syrus') ?></a></li>
        <li class="<?php echo isset($_GET['tab']) && $_GET['tab'] == 'head-footer-content' ? 'active' : '' ?>"><a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=head-footer-content') ?>" class=""><i class="bi bi-save me-2"></i><?php esc_html_e("Content injection",'syrus') ?></a></li>
        <li class="<?php echo isset($_GET['tab']) && $_GET['tab'] == 'robots-txt-ads-txt' ? 'active' : '' ?>"><a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=robots-txt-ads-txt') ?>" class=""><i class="bi bi-robot me-2"></i><?php esc_html_e("robots.txt | ads.txt",'syrus') ?></a></li>
        <li class="<?php echo isset($_GET['tab']) && $_GET['tab'] == 'rules-upload-media' ? 'active' : '' ?>"><a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=rules-upload-media') ?>" class=""><i class="bi bi-upload me-2"></i><?php esc_html_e("Rules upload media",'syrus') ?></a></li>
        <li class="<?php echo isset($_GET['tab']) && $_GET['tab'] == 'clean-and-optimize' ? 'active' : '' ?>"><a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=clean-and-optimize') ?>" class=""><i class="bi bi-magic me-2"></i><?php esc_html_e("Clean & Optimize",'syrus') ?></a></li>
        <li class="<?php echo isset($_GET['tab']) && $_GET['tab'] == 'whatsapp' ? 'active' : '' ?>"><a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=whatsapp') ?>" class=""><i class="bi bi-whatsapp me-2"></i><?php esc_html_e("WhatsApp",'syrus') ?></a></li>
        <li class="<?php echo isset($_GET['tab']) && $_GET['tab'] == 'layouts' ? 'active' : '' ?>"><a href="<?php echo admin_url('admin.php?page=' . $_GET['page'] . '&tab=coming-soon') ?>" class=""><?php esc_html_e("Layouts",'syrus') ?></a><span class="syrus-coming-soon"><?php esc_html_e("Coming Soon",'syrus') ?></span></li>
    </nav>
</section>

<div class="container-admin-tab">
    <?php $syrus->template_admin_tab($_GET['tab'], $layout); ?>
</div>