<?php

$current =
basename($_SERVER['PHP_SELF']);

$role =
$_SESSION['role'] ?? '';

?>

<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<link rel="stylesheet"
href="/SEAT/assets/css/templates/layout.css">

<?php

/* DEFAULT */

$unread_count  = 0;
$notifications = [];

/* COUNT UNREAD */

foreach($notifications as $n){

    if($n['is_read'] == 0){

        $unread_count++;
    }
}

?>

<!-- ======================================================
   TOPBAR
====================================================== -->

<div class="topbar">

    <!-- LEFT -->

    <div class="leftArea">

        <button
        class="toggleBtn"
        onclick="toggleSidebar()"
        >

            <i class="fa fa-bars"></i>

        </button>

        <div class="logo">

            Smart Event Automated Ticketing System (SEAT)

        </div>

    </div>

    <!-- RIGHT -->

    <div class="topRight">

        <!-- ======================================================
           NOTIFICATION
           HIDE FOR ADMIN
        ======================================================= -->

        <?php if($role != "admin"){ ?>

            <?php
            include(
            $_SERVER['DOCUMENT_ROOT'].
            "/SEAT/modules/Notification/notification.php"
            );
            ?>

        <?php } ?>

        <!-- ======================================================
           LOGOUT
        ======================================================= -->

        <form
        action="/SEAT/logout.php"
        method="post"
        >

            <button
            type="submit"
            class="logoutBtn"
            >

                <i class="fa fa-right-from-bracket"></i>

                Logout

            </button>

        </form>

    </div>

</div>