<!doctype html>
<html data-layout="horizontal" data-topbar="dark" data-sidebar-size="" data-sidebar="light" data-sidebar-image="none"
      data-preloader="disable" data-layout-width="fluid">

<head>

    <meta charset="utf-8">
    <title>VebuSoft | <?= lang('title', [], 'Yönetim Paneli') ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="<?=lang('header.meta.description', [], 'Admin Panel')?>" name="description"/>
    <meta content="VebuSoft" name="author"/>
    <!-- App favicon -->
    <link rel="shortcut icon" href="<?= ADMIN_THEME_URL ?>/assets/images/vebuicon.svg">
    <link href="<?= ADMIN_FOLDER ?>/editor/libs/media/media.css" rel="stylesheet">

    <link href="<?= ADMIN_THEME_URL ?>/assets/libs/sweetalert2/sweetalert2.min.css" rel="stylesheet" type="text/css">
    <!-- Layout config Js -->
    <script src="<?= ADMIN_THEME_URL ?>/assets/js/layout.js"></script>
    <!-- Bootstrap Css -->
    <link href="<?= ADMIN_THEME_URL ?>/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <!-- Icons Css -->
    <link href="<?= ADMIN_THEME_URL ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css">

    <link href="<?= ADMIN_THEME_URL ?>/assets/css/app.min.css" rel="stylesheet" type="text/css">

    <link href="<?= ADMIN_THEME_URL ?>/assets/css/custom.min.css?v=<?= time() ?>" rel="stylesheet" type="text/css">
    <link rel="stylesheet"
          href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.15.2/css/selectize.default.min.css"/>

</head>
<body>
<div id="layout-wrapper">

    <header id="page-topbar">
        <div class="layout-width">
            <div class="navbar-header">
                <div class="d-flex">
                    <!-- LOGO -->
                    <div class="navbar-brand-box horizontal-logo">
                        <a href="<?= ADMIN_URL ?>" class="logo logo-dark">
                        <span class="logo-sm">
                            <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="22">
                        </span>
                            <span class="logo-lg">
                            <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="33">
                        </span>
                        </a>

                        <a href="<?= ADMIN_URL ?>" class="logo logo-light">
                        <span class="logo-sm">
                            <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="22">
                        </span>
                            <span class="logo-lg">
                            <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="33">
                        </span>
                        </a>
                    </div>

                    <button type="button" class="btn btn-sm px-3 fs-16 header-item vertical-menu-btn topnav-hamburger"
                            id="topnav-hamburger-icon">
                    <span class="hamburger-icon">
                        <span></span>
                        <span></span>
                        <span></span>
                    </span>
                    </button>

                    <!--                    <form class="app-search d-none d-md-block">-->
                    <!--                        <div class="position-relative">-->
                    <!--                            <input type="text" class="form-control" placeholder="Arama..." autocomplete="off" id="search-options" value="">-->
                    <!--                            <span class="mdi mdi-magnify search-widget-icon"></span>-->
                    <!--                            <span class="mdi mdi-close-circle search-widget-icon search-widget-icon-close d-none" id="search-close-options"></span>-->
                    <!--                        </div>-->
                    <!--                    </form>-->
                </div>

                <div class="d-flex align-items-center">

                    <div class="dropdown d-md-none topbar-head-dropdown header-item">
                        <button type="button" class="btn btn-icon btn-topbar btn-ghost-secondary rounded-circle"
                                id="page-header-search-dropdown" data-bs-toggle="dropdown" aria-haspopup="true"
                                aria-expanded="false">
                            <i class="bx bx-search fs-22"></i>
                        </button>
                        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-end p-0"
                             aria-labelledby="page-header-search-dropdown">
                            <form class="p-3">
                                <div class="form-group m-0">
                                    <div class="input-group">
                                        <input type="text" class="form-control" placeholder="<?=lang('header.search.placeholder')?>"
                                               aria-label="Recipient's username">
                                        <button class="btn btn-primary" type="submit"><i class="mdi mdi-magnify"></i>
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="ms-1 header-item d-none d-sm-flex">
                        <a class="btn viewwebsite" type="button" href="<?= DOMAIN ?>" target="_blank">
                            <svg class="icon icon-left" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                 viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
                                 stroke-linecap="round" stroke-linejoin="round">
                                <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                                <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"></path>
                                <path d="M3.6 9h16.8"></path>
                                <path d="M3.6 15h16.8"></path>
                                <path d="M11.5 3a17 17 0 0 0 0 18"></path>
                                <path d="M12.5 3a17 17 0 0 1 0 18"></path>
                            </svg>
                            <?= lang('viewwebsite', [], 'Siteyi Görüntüle') ?>

                        </a>
                    </div>
                    <div class="ms-1 header-item d-none d-sm-flex">
                        <button type="button"
                                class="btn btn-icon btn-topbar material-shadow-none btn-ghost-secondary rounded-circle"
                                data-toggle="fullscreen">
                            <i class="bx bx-fullscreen fs-22"></i>
                        </button>
                    </div>

                    <div class="dropdown ms-1 topbar-head-dropdown header-item">
                        <button type="button" class="btn btn-icon btn-topbar btn-ghost-secondary rounded-circle"
                                data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <img id="header-lang-imgs"
                                 src="<?= ADMIN_THEME_URL ?>/assets/images/flags/<?= m_get_session('admin_lang') ?>.svg"
                                 alt="<?= m_get_session('admin_lang') ?>" height="20" class="rounded">
                        </button>
                        <div class="dropdown-menu dropdown-menu-end">

                            <?php
                            foreach (ADMIN_LANGS as $admin_lang) {
                                if ($admin_lang == 'tr') {
                                    $title = 'Türkçe';
                                } elseif ($admin_lang == 'en') {
                                    $title = 'English';
                                }
                                ?>
                                <a href="<?= ADMIN_URL ?>/?admin_lang=<?= $admin_lang ?>"
                                   class="dropdown-item notify-item language py-2" data-lang="<?= $admin_lang ?>"
                                   title="<?= $title ?>">
                                    <img src="<?= ADMIN_THEME_URL ?>/assets/images/flags/<?= $admin_lang ?>.svg"
                                         alt="<?= $title ?>" class="me-2 rounded" height="18">
                                    <span class="align-middle"><?= $title ?></span>
                                </a>
                            <?php } ?>
                        </div>
                    </div>


                    <?php
                    // Basit bildirim kaynağı: request_demo ve feedback son kayıtlar
                    try {
                        $lang = lang_is_default('lang_code');
                        $req = posts('data', 'request_demo', $lang);
                        $fbk = posts('data', 'feedback', $lang);
                        $notifications = array_merge(is_array($req)?$req:[], is_array($fbk)?$fbk:[]);
                        usort($notifications, function($a,$b){
                            $ad = strtotime($a['created_at'] ?? '');
                            $bd = strtotime($b['created_at'] ?? '');
                            if ($ad === $bd) { return (int)($b['id']??0) <=> (int)($a['id']??0); }
                            return $bd <=> $ad;
                        });
                        $unreadCount = 0;
                        foreach ($notifications as $n) {
                            $fd = json_decode($n['features'] ?? '[]', true);
                            if (empty($fd['is_read'])) { $unreadCount++; }
                        }
                    } catch (Exception $e) {
                        $notifications = [];
                        $unreadCount = 0;
                    }
                    ?>
                    <div class="dropdown topbar-head-dropdown ms-1 header-item" id="notificationDropdown">
                        <button type="button" class="btn btn-icon btn-topbar btn-ghost-secondary rounded-circle"
                                id="page-header-notifications-dropdown" data-bs-toggle="dropdown"
                                data-bs-auto-close="outside" aria-haspopup="true" aria-expanded="false">
                            <i class='bx bx-bell fs-22'></i>
                            <span class="position-absolute topbar-badge fs-10 translate-middle badge rounded-pill bg-danger"><?=(int)$unreadCount?><span
                                        class="visually-hidden"><?=lang('header.notifications.unread')?></span></span>
                        </button>
                        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-end p-0"
                             aria-labelledby="page-header-notifications-dropdown">

                            <div class="dropdown-head bg-primary bg-pattern rounded-top">
                                <div class="p-3">
                                    <div class="row align-items-center">
                                        <div class="col">
                                            <h6 class="m-0 fs-16 fw-semibold text-white"> <?=lang('header.notifications.title')?> </h6>
                                        </div>
                                        <div class="col-auto dropdown-tabs">
                                            <span class="badge bg-light-subtle text-body fs-13"> <?=(int)$unreadCount?> <?=lang('header.notifications.new')?> </span>
                                        </div>
                                    </div>
                                </div>

                                <div class="px-2 pt-2">
                                    <ul class="nav nav-tabs dropdown-tabs nav-tabs-custom" data-dropdown-tabs="true"
                                        id="notificationItemsTab" role="tablist">
                                        <li class="nav-item waves-effect waves-light">
                                            <a class="nav-link active" data-bs-toggle="tab" href="#all-noti-tab"
                                               role="tab" aria-selected="true">
                                                <?=lang('header.notifications.all')?> (<?=(int)$unreadCount?>)
                                            </a>
                                        </li>
                                        <?php $msgCount=0; $alertCount=0; foreach ($notifications as $n){ if(($n['module_type']??'')==='feedback'){ $msgCount++; } elseif(($n['module_type']??'')==='request_demo'){ $alertCount++; } } ?>
                                        <li class="nav-item waves-effect waves-light">
                                            <a class="nav-link" data-bs-toggle="tab" href="#messages-tab" role="tab" aria-selected="false">
                                                <?=lang('header.notifications.messages')?> (<?=$msgCount?>)
                                            </a>
                                        </li>
                                        <li class="nav-item waves-effect waves-light">
                                            <a class="nav-link" data-bs-toggle="tab" href="#alerts-tab" role="tab" aria-selected="false">
                                                <?=lang('header.notifications.alerts')?> (<?=$alertCount?>)
                                            </a>
                                        </li>
                                    </ul>
                                </div>

                            </div>

                            <div class="tab-content position-relative" id="notificationItemsTabContent">
                                <div class="tab-pane fade show active py-2 ps-2" id="all-noti-tab" role="tabpanel">
                                    <div data-simplebar="" style="max-height: 300px;" class="pe-2">
                                        <?php $shown = 0; foreach ($notifications as $n): if ($shown++ >= 5) break; 
                                            $fd = json_decode($n['features'] ?? '[]', true) ?: [];
                                            $name = isset($fd['name']) ? trim((string)$fd['name']) : '';
                                            $prefix = ($n['module_type'] === 'request_demo') ? lang('request_demo.prefix', [], 'Demo Talebi') : lang('feedback.prefix', [], 'Geri Bildirim');
                        $title = $name !== '' ? ($prefix.' – '.htmlspecialchars($name, ENT_QUOTES, 'UTF-8')) : htmlspecialchars($n['title'] ?? '', ENT_QUOTES, 'UTF-8');
                        $created = htmlspecialchars(date('d.m.Y H:i', strtotime($n['created_at'] ?? 'now')), ENT_QUOTES, 'UTF-8');
                                            $icon = ($n['module_type'] === 'request_demo') ? 'bx-user-voice' : 'bx-message-dots';
                                            $link = ADMIN_URL . '/' . $n['module_type'] . '/edit/' . (int)$n['id'];
                                        ?>
                                        <div class="text-reset notification-item d-block dropdown-item position-relative">
                                            <div class="d-flex">
                                                <div class="avatar-xs me-3 flex-shrink-0">
                                                <span class="avatar-title bg-info-subtle text-info rounded-circle fs-16">
                                                    <i class="bx <?=$icon?>"></i>
                                                </span>
                                                </div>
                                                <div class="flex-grow-1">
                                                    <a href="<?=$link?>" class="stretched-link">
                                                        <h6 class="mt-0 mb-2 lh-base"><?=$title?></h6>
                                                    </a>
                                                    <p class="mb-0 fs-11 fw-medium text-uppercase text-muted">
                                                        <span><i class="mdi mdi-clock-outline"></i> <?=$created?></span>
                                                    </p>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach; ?>

                                        <div class="my-3 text-center view-all">
                                            <a href="<?= ADMIN_URL ?>/request_demo/lists" class="btn btn-soft-success waves-effect waves-light">
                                                <?=lang('header.notifications.view_all')?> <i class="ri-arrow-right-line align-middle"></i>
                                            </a>
                                        </div>
                                    </div>

                                </div>

                                <div class="tab-pane fade py-2 ps-2" id="messages-tab" role="tabpanel"
                                     aria-labelledby="messages-tab">
                                    <div data-simplebar="" style="max-height: 300px;" class="pe-2">
                                        <?php $msgShown=0; foreach ($notifications as $n): if (($n['module_type'] ?? '') !== 'feedback') continue; if ($msgShown++ >= 5) break;
                                            $fd = json_decode($n['features'] ?? '[]', true) ?: [];
                                            $name = isset($fd['name']) ? trim((string)$fd['name']) : '';
                                            $title = $name!=='' ? (lang('feedback.prefix', [], 'Geri Bildirim').' – '.htmlspecialchars($name, ENT_QUOTES, 'UTF-8')) : htmlspecialchars($n['title'] ?? '', ENT_QUOTES, 'UTF-8');
                                            $created = htmlspecialchars(date('d.m.Y H:i', strtotime($n['created_at'] ?? 'now')), ENT_QUOTES, 'UTF-8');
                                            $link = ADMIN_URL . '/feedback/edit/' . (int)$n['id'];
                                        ?>
                                        <div class="text-reset notification-item d-block dropdown-item position-relative">
                                            <div class="d-flex">
                                                <div class="avatar-xs me-3 flex-shrink-0"><span class="avatar-title bg-info-subtle text-info rounded-circle fs-16"><i class="bx bx-message-dots"></i></span></div>
                                                <div class="flex-grow-1">
                                                    <a href="<?=$link?>" class="stretched-link"><h6 class="mt-0 mb-2 lh-base"><?=$title?></h6></a>
                                                    <p class="mb-0 fs-11 fw-medium text-uppercase text-muted"><span><i class="mdi mdi-clock-outline"></i> <?=$created?></span></p>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach; ?>
                                        <div class="my-3 text-center view-all">
                                            <a href="<?= ADMIN_URL ?>/feedback/lists" class="btn btn-soft-success waves-effect waves-light"><?=lang('header.notifications.view_all')?> <i class="ri-arrow-right-line align-middle"></i></a>
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane fade py-2 ps-2" id="alerts-tab" role="tabpanel"
                                     aria-labelledby="alerts-tab">
                                    <div data-simplebar style="max-height: 300px;" class="pe-2">
                                        <?php $alShown=0; foreach ($notifications as $n): if (($n['module_type'] ?? '') !== 'request_demo') continue; if ($alShown++ >= 5) break;
                                            $fd = json_decode($n['features'] ?? '[]', true) ?: [];
                                            $name = isset($fd['name']) ? trim((string)$fd['name']) : '';
                                            $title = $name!=='' ? (lang('request_demo.prefix', [], 'Demo Talebi').' – '.htmlspecialchars($name, ENT_QUOTES, 'UTF-8')) : htmlspecialchars($n['title'] ?? '', ENT_QUOTES, 'UTF-8');
                                            $created = htmlspecialchars(date('d.m.Y H:i', strtotime($n['created_at'] ?? 'now')), ENT_QUOTES, 'UTF-8');
                                            $link = ADMIN_URL . '/request_demo/edit/' . (int)$n['id'];
                                        ?>
                                        <div class="text-reset notification-item d-block dropdown-item position-relative">
                                            <div class="d-flex">
                                                <div class="avatar-xs me-3 flex-shrink-0"><span class="avatar-title bg-info-subtle text-info rounded-circle fs-16"><i class="bx bx-user-voice"></i></span></div>
                                                <div class="flex-grow-1">
                                                    <a href="<?=$link?>" class="stretched-link"><h6 class="mt-0 mb-2 lh-base"><?=$title?></h6></a>
                                                    <p class="mb-0 fs-11 fw-medium text-uppercase text-muted"><span><i class="mdi mdi-clock-outline"></i> <?=$created?></span></p>
                                                </div>
                                            </div>
                                        </div>
                                        <?php endforeach; ?>
                                        <div class="my-3 text-center view-all"><a href="<?= ADMIN_URL ?>/request_demo/lists" class="btn btn-soft-success waves-effect waves-light"><?=lang('header.notifications.view_all')?> <i class="ri-arrow-right-line align-middle"></i></a></div>
                                    </div>
                                </div>

                                <div class="notification-actions" id="notification-actions">
                                    <div class="d-flex text-muted justify-content-center">
                                        <?=lang('header.notifications.select')?>
                                        <div id="select-content" class="text-body fw-semibold px-1">0</div>
                                        <?=lang('header.notifications.result')?>
                                        <button type="button" class="btn btn-link link-danger p-0 ms-3"
                                                data-bs-toggle="modal" data-bs-target="#removeNotificationModal"><?=lang('header.notifications.remove')?>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="dropdown ms-sm-3 header-item topbar-user">
                        <button type="button" class="btn" id="page-header-user-dropdown" data-bs-toggle="dropdown"
                                aria-haspopup="true" aria-expanded="false">
                        <span class="d-flex align-items-center">
                            <img class="rounded-circle header-profile-user"
                                 src="<?= ADMIN_THEME_URL ?>/assets/images/users/avatar-1.jpg" alt="Header Avatar">
                            <span class="text-start ms-xl-2">
                                <?php
                                $admin_id = m_get_session('m_admin');
                                $admin_data = $db->table('admins')->where('id', '=', $admin_id)->get();
                                $admin = $admin_data['data'][0] ?? null;
                                $display_name = '';
                                if ($admin) {
                                    if (!empty($admin['name']) && !empty($admin['lastname'])) {
                                        $display_name = $admin['name'] . ' ' . $admin['lastname'];
                                    } elseif (!empty($admin['name'])) {
                                        $display_name = $admin['name'];
                                    } else {
                                        $display_name = $admin['email'];
                                    }
                                } else {
                                    $display_name = 'Admin';
                                }
                                ?>
                                <span class="d-none d-xl-inline-block ms-1 fw-medium user-name-text"><?= htmlspecialchars($display_name) ?></span>
                                <span class="d-none d-xl-block ms-1 fs-12 user-name-sub-text">Administrator</span>
                            </span>
                        </span>
                        </button>
                        <div class="dropdown-menu dropdown-menu-end">
                            <!-- item-->
                            <h6 class="dropdown-header"><?=lang('header.user.welcome',['name'=>htmlspecialchars($display_name)])?></h6>
                            <a class="dropdown-item" href="<?= ADMIN_URL ?>/profile"><i
                                        class="mdi mdi-account text-muted fs-16 align-middle me-1"></i> <span
                                        class="align-middle" data-key="t-profile"><?=lang('profile.title', [], 'Profil')?></span></a>
                            <a class="dropdown-item" href="<?= ADMIN_URL ?>/logout"><i
                                        class="mdi mdi-logout text-muted fs-16 align-middle me-1"></i> <span
                                        class="align-middle" data-key="t-logout"><?=lang('header.user.logout')?></span></a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- removeNotificationModal -->
    <div id="removeNotificationModal" class="modal fade zoomIn" tabindex="-1" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
                            id="NotificationModalbtn-close"></button>
                </div>
                <div class="modal-body">
                    <div class="mt-2 text-center">
                        <lord-icon src="https://cdn.lordicon.com/gsqxdxog.json" trigger="loop"
                                   colors="primary:#f7b84b,secondary:#f06548"
                                   style="width:100px;height:100px"></lord-icon>
                        <div class="mt-4 pt-2 fs-15 mx-4 mx-sm-5">
                            <h4><?=lang('header.modal.are_you_sure')?></h4>
                            <p class="text-muted mx-4 mb-0"><?=lang('header.modal.remove_notification_question')?></p>
                        </div>
                    </div>
                    <div class="d-flex gap-2 justify-content-center mt-4 mb-2">
                        <button type="button" class="btn w-sm btn-light" data-bs-dismiss="modal"><?=lang('header.modal.close')?></button>
                        <button type="button" class="btn w-sm btn-danger" id="delete-notification"><?=lang('header.modal.yes_delete')?>
                        </button>
                    </div>
                </div>

            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <!-- ========== App Menu ========== -->

    <div class="app-menu navbar-menu">
        <!-- LOGO -->
        <div class="navbar-brand-box">
            <!-- Dark Logo-->
            <a href="index.html" class="logo logo-dark">
                    <span class="logo-sm">
                        <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="22">
                    </span>
                <span class="logo-lg">
                        <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="33">
                    </span>
            </a>
            <!-- Light Logo-->
            <a href="index.html" class="logo logo-light">
                    <span class="logo-sm">
                        <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="22">
                    </span>
                <span class="logo-lg">
                        <img src="<?= ADMIN_THEME_URL ?>/assets/images/vebusoft-logo-beyaz.svg" alt="" height="33">
                    </span>
            </a>
            <button type="button" class="btn btn-sm p-0 fs-20 header-item float-end btn-vertical-sm-hover"
                    id="vertical-hover">
                <i class="ri-record-circle-line"></i>
            </button>
        </div>

        <div id="scrollbar">
            <div class="container-fluid">

                <div id="two-column-menu">
                </div>
                <ul class="navbar-nav" id="navbar-nav">
                    <li class="menu-title"><span data-key="t-menu"><?=lang('header.menu')?></span></li>
                    <li class="nav-item">
                        <a class="nav-link menu-link" href="<?= ADMIN_URL ?>">
                            <i class="bx bxs-dashboard"></i> <span data-key="t-dashboards"><?= lang('menu_dashboard') ?></span>
                        </a>
                    </li> <!-- end Dashboard Menu -->

                    <?php if (function_exists('module_is_enabled') ? module_is_enabled('pages') : true): ?>
                    <li class="nav-item">
                        <a class="nav-link menu-link" href="<?= ADMIN_URL ?>/pages/lists">
                            <i class="bx bx-file"></i> <span><?= lang('menu_pages') ?></span>
                        </a>

                    </li>
                    <?php endif; ?>
                    <?php if (function_exists('module_is_enabled') ? module_is_enabled('posts') : true): ?>
                    <li class="nav-item">

                        <a class="nav-link menu-link" href="#posts" data-bs-toggle="collapse" role="button"
                           aria-expanded="false" aria-controls="settings">
                            <i class="ri-pages-line"></i> <span data-key="posts"><?= lang('menu_posts') ?></span>
                        </a>
                        <div class="collapse menu-dropdown" id="posts">
                            <ul class="nav nav-sm flex-column">
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/posts/lists" class="nav-link" data-key="posts"><i
                                                class="ri-pages-line">
                                        </i> <?= lang('menu_posts') ?> </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/post_categories/lists" class="nav-link"
                                       data-key="posts"><i class="ri-list-indefinite">
                                        </i> <?= lang('page_title_post_categories') ?> </a>
                                </li>

                            </ul>
                        </div>
                    </li>
                    <?php endif; ?>
                    <?php if (function_exists('module_is_enabled') ? module_is_enabled('services') : true): ?>
                    <li class="nav-item">

                        <a class="nav-link menu-link" href="#services" data-bs-toggle="collapse" role="button"
                           aria-expanded="false" aria-controls="settings">
                            <i class="ri-pages-line"></i> <span data-key="services"><?= lang('menu_services') ?></span>
                        </a>
                        <div class="collapse menu-dropdown" id="services">
                            <ul class="nav nav-sm flex-column">
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/services/lists" class="nav-link" data-key="services"><i
                                                class="ri-pages-line">
                                        </i> <?= lang('menu_services') ?> </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/service_categories/lists" class="nav-link"
                                       data-key="services"><i class="ri-list-indefinite">
                                        </i> <?= lang('page_title_service_categories') ?> </a>
                                </li>

                            </ul>
                        </div>
                    </li>
                    <?php endif; ?>
                    <?php if (function_exists('module_is_enabled') ? module_is_enabled('teams') : true): ?>
                    <li class="nav-item">

                        <a class="nav-link menu-link" href="#teams" data-bs-toggle="collapse" role="button"
                           aria-expanded="false" aria-controls="settings">
                            <i class="ri-pages-line"></i> <span data-key="teams"><?= lang('menu_teams') ?></span>
                        </a>
                        <div class="collapse menu-dropdown" id="teams">
                            <ul class="nav nav-sm flex-column">
                                <li class="nav-item">
                                    <a class="nav-link menu-link" href="<?= ADMIN_URL ?>/teams/lists">
                                        <i class="bx bx-file"></i> <span><?= lang('menu_teams') ?></span></span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/team_categories/lists" class="nav-link"
                                       data-key="teams"><i class="ri-list-indefinite">
                                        </i> <?= lang('page_title_teams_categories') ?> </a>
                                </li>

                            </ul>
                        </div>
                    </li>
                    <?php endif; ?>
                    <?php if (function_exists('module_is_enabled') ? module_is_enabled('projects') : true): ?>
                    <li class="nav-item">

                        <a class="nav-link menu-link" href="#projects" data-bs-toggle="collapse" role="button"
                           aria-expanded="false" aria-controls="settings">
                            <i class="ri-pages-line"></i> <span data-key="projects"><?= lang('menu_projects') ?></span>
                        </a>
                        <div class="collapse menu-dropdown" id="projects">
                            <ul class="nav nav-sm flex-column">
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/projects/lists" class="nav-link" data-key="projects"><i
                                                class="ri-pages-line">
                                        </i> <?= lang('menu_projects') ?> </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/project_categories/lists" class="nav-link"
                                       data-key="projects"><i class="ri-list-indefinite">
                                        </i> <?= lang('page_title_project_categories') ?> </a>
                                </li>

                            </ul>
                        </div>
                    </li>
                    <?php endif; ?>
                    <?php if (function_exists('module_is_enabled') ? (module_is_enabled('testimonials') || module_is_enabled('request_demo')) : true): ?>
                    <li class="nav-item">

                        <a class="nav-link menu-link" href="#from_user" data-bs-toggle="collapse" role="button"
                           aria-expanded="false" aria-controls="settings">
                            <i class="ri-mail-fill"></i> <span data-key="from_user"><?= lang('menu_from_user') ?></span>
                        </a>
                        <div class="collapse menu-dropdown" id="from_user">
                            <ul class="nav nav-sm flex-column">
                                <?php if (function_exists('module_is_enabled') ? module_is_enabled('testimonials') : true): ?>
                                <li class="nav-item">
                                    <a class="nav-link menu-link" href="<?= ADMIN_URL ?>/testimonials/lists">
                                        <i class="bx bx-user-voice"></i> <span><?= lang('testimonial') ?></span>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if (function_exists('module_is_enabled') ? module_is_enabled('feedback') : true): ?>
                                <li class="nav-item">
                                    <a class="nav-link menu-link" href="<?= ADMIN_URL ?>/feedback/lists">
                                        <i class="bx bx-message-dots"></i> <span><?= lang('page_title_feedback') ?></span>
                                    </a>
                                </li>
                                <?php endif; ?>
                                <?php if (function_exists('module_is_enabled') ? module_is_enabled('request_demo') : true): ?>
                                <li class="nav-item">
                                    <a class="nav-link menu-link" href="<?= ADMIN_URL ?>/request_demo/lists">
                                        <i class="bx bx-user-voice"></i> <span><?= lang('page_title_request_demo') ?></span>
                                    </a>
                                </li>
                                <?php endif; ?>

                            </ul>
                        </div>
                    </li>
                    <?php endif; ?>

                    <li class="nav-item">
                        <a class="nav-link menu-link" href="#appearance" data-bs-toggle="collapse" role="button"
                           aria-expanded="false" aria-controls="appearance">
                            <i class="bx bxs-brush"></i> <span data-key="appearance"><?= lang('menu_theme_options') ?></span>
                        </a>
                        <div class="collapse menu-dropdown" id="appearance">
                            <ul class="nav nav-sm flex-column">
                                <?php if (function_exists('module_is_enabled') ? module_is_enabled('menu') : true): ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/menu/lists" class="nav-link" data-key="appearance"><i
                                                class="bx bx-list-plus"></i> <?= lang('page_title_menus') ?> </a>
                                </li>
                                <?php endif; ?>
                                <?php if (function_exists('module_is_enabled') ? module_is_enabled('sliders') : true): ?>
                                <li class="nav-item">
                                    <a class="nav-link menu-link" href="<?= ADMIN_URL ?>/sliders/lists">
                                        <span class="icon-tabler-wrapper">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-slideshow"
                                                 width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"
                                                 fill="none" stroke-linecap="round" stroke-linejoin="round">
                                              <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                                              <path d="M15 6l.01 0"></path>
                                              <path d="M3 3m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path>
                                              <path d="M3 13l4 -4a3 5 0 0 1 3 0l4 4"></path>
                                              <path d="M13 12l2 -2a3 5 0 0 1 3 0l3 3"></path>
                                              <path d="M8 21l.01 0"></path>
                                              <path d="M12 21l.01 0"></path>
                                              <path d="M16 21l.01 0"></path>
                                            </svg>
                                        </span>
                                        <span><?= lang('menu_sliders') ?></span>
                                    </a>

                                </li>
                                <?php endif; ?>
                                <?php if ((function_exists('module_is_enabled') ? module_is_enabled('theme_options') : true) && (!function_exists('can') || can('view','theme_options'))): ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/theme_options/lists" class="nav-link"
                                       data-key="appearance"><i
                                                class="bx bx-slider-alt"></i> <?= lang('page_title_theme_options') ?> </a>
                                </li>
                                <?php endif; ?>
                                <?php if ((function_exists('module_is_enabled') ? module_is_enabled('themes') : true) && (function_exists('is_super_admin') && is_super_admin())): ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/themes/lists" class="nav-link"
                                       data-key="themes"><i
                                                class="bx bx-palette"></i> <?=lang('header.themes')?> </a>
                                </li>
                                <?php endif; ?>

                            </ul>
                        </div>
                    </li> <!-- end Dashboard Menu -->
                    <li class="nav-item">

                        <a class="nav-link menu-link" href="#settings" data-bs-toggle="collapse" role="button"
                           aria-expanded="false" aria-controls="settings">
                            <i class="bx bxs-cog"></i> <span data-key="settings"><?= lang('menu_settings') ?></span>
                        </a>
                        <div class="collapse menu-dropdown" id="settings">
                            <ul class="nav nav-sm flex-column">
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/settings/lists" class="nav-link" data-key="settings"><i
                                                class="bx bxs-cog"></i> <?=lang('header.general_settings')?> </a>
                                </li>
                                <?php if ((function_exists('is_super_admin') && is_super_admin()) || (function_exists('can') && can('view','admins'))): ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/admins/lists" class="nav-link" data-key="settings"><i
                                                class="bx bx-user"></i> <?= lang('admins.title', [], 'Yöneticiler') ?> </a>
                                </li>
                                <?php endif; ?>
                                <?php if ((function_exists('is_super_admin') && is_super_admin()) || (function_exists('can') && can('view','roles'))): ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/roles/lists" class="nav-link" data-key="settings"><i
                                                class="bx bx-shield-quarter"></i> <?= lang('roles.title', [], 'Roller & İzinler') ?> </a>
                                </li>
                                <?php endif; ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/updates/lists" class="nav-link" data-key="settings"><i
                                                class="bx bx-refresh"></i> <?=lang('menu_updates')?> </a>
                                </li>
                                <?php if (function_exists('is_super_admin') ? is_super_admin() : true): ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/modules/lists" class="nav-link" data-key="settings"><i
                                                class="bx bx-plug"></i> <?= lang('modules.title', [], 'Modül Yönetimi') ?> </a>
                                </li>
                                <?php endif; ?>
                                <li class="nav-item">
                                    <a href="<?= ADMIN_URL ?>/languages/lists" class="nav-link" data-key="settings"><i
                                                class="bx">
                                            <svg xmlns="http://www.w3.org/2000/svg"
                                                 class="icon icon-tabler icon-tabler-language" width="24" height="24"
                                                 viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
                                                 stroke-linecap="round" stroke-linejoin="round">
                                                <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
                                                <path d="M4 5h7"></path>
                                                <path d="M9 3v2c0 4.418 -2.239 8 -5 8"></path>
                                                <path d="M5 9c0 2.144 2.952 3.908 6.7 4"></path>
                                                <path d="M12 20l4 -9l4 9"></path>
                                                <path d="M19.1 18h-6.2"></path>
                                            </svg>
                                        </i> <?= lang('page_title_languages') ?> </a>
                                </li>

                            </ul>
                        </div>
                    </li> <!-- end Dashboard Menu -->


                </ul>
            </div>
            <!-- Sidebar -->
        </div>

        <div class="sidebar-background"></div>
    </div>
    <!-- Left Sidebar End -->
    <!-- Vertical Overlay-->
    <div class="vertical-overlay"></div>

    <!-- ============================================================== -->
    <!-- Start right Content here -->
    <!-- ============================================================== -->
    <div class="main-content">

        <div class="page-content">
            <div class="container-fluid">