<?php
if (!isset($__DATABASE)) {
    header("Location: ../../../views/auth/403.php");
}
$fileName = basename($_SERVER['PHP_SELF']);
?>
<aside id="side_bar">
    <ul>
        <li style="display: flex; justify-content: end;">
            <img src="../../public/icons/close.svg" class="cursor-pointer ml-3 mt-4" alt="close menu icon" onclick="toggleSidebar()">
        </li>
        <li>
            <a class="flex justify-start items-center gap-2 p-4 hover:bg-gray-200 text-sm font-semibold <?= $fileName == '404.php' ? 'bg-gray-400' : '' ?>" href="../admin/index.php">
                <img src="../../public/icons/main.svg" alt="save icon">
                صفحه اصلی
            </a>
        </li>
        <li>
            <a class="flex justify-start items-center gap-2 p-4 hover:bg-gray-200 text-sm font-semibold <?= $fileName == '404.php' ? 'bg-gray-400' : '' ?>" href="../common/prices.php">
                <img src="../../public/icons/price.svg" alt="save icon">
                دریافت قیمت اجناس
            </a>
        </li>
        <?php if (isAdmin()): ?>
            <li>
                <a class="flex justify-start items-center gap-2 p-4 hover:bg-gray-200 text-sm font-semibold <?= $fileName == '404.php' ? 'bg-gray-400' : '' ?>" href="../admin/usersManagement.php">
                    <img src="../../public/icons/users.svg" alt="save icon">
                    مدیریت کاربران
                </a>
            </li>
        <?php endif; ?>
    </ul>
    <ul>
        <li>
            <a class="flex justify-start items-center gap-2 p-4 hover:bg-gray-200 text-sm font-semibold" href="../auth/logout.php">
                <img src="../../public/icons/power.svg" alt="save icon">
                خروج از حساب کاربری
            </a>
        </li>
    </ul>
</aside>