<!DOCTYPE html>
<html lang="tr">
    <head>
        <title><?php echo $data['title']; ?></title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="author" content="<?php echo $config->get('site_title'); ?>">
        <meta name="csrf_token" content="<?php echo $data["csrf_token"]; ?>" />
        <link rel="apple-touch-icon" sizes="180x180" href="<?php echo $config->get('site_url'); ?>admin/public/assets/images/favicons/apple-touch-icon.png?v=<?php echo $config->get('version'); ?>">
        <link rel="icon" type="image/png" sizes="32x32" href="<?php echo $config->get('site_url'); ?>admin/public/assets/images/favicons/favicon-32x32.png?v=<?php echo $config->get('version'); ?>">
        <link rel="icon" type="image/png" sizes="16x16" href="<?php echo $config->get('site_url'); ?>admin/public/assets/images/favicons/favicon-16x16.png?v=<?php echo $config->get('version'); ?>">
        <link rel="mask-icon" href="<?php echo $config->get('site_url'); ?>admin/public/assets/images/favicons/safari-pinned-tab.svg?v=<?php echo $config->get('version'); ?>" color="#5bbad5">
        <link rel="shortcut icon" href="<?php echo $config->get('site_url'); ?>admin/public/assets/images/favicons/favicon.ico?v=<?php echo $config->get('version'); ?>">
        <meta name="msapplication-TileColor" content="#da532c">
        <meta name="theme-color" content="#ffffff">
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;400;500&display=swap" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
        <link href="<?php echo $config->get('site_url'); ?>admin/public/assets/css/bootstrap/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $config->get('site_url'); ?>admin/public/assets/css/glightbox/glightbox.min.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $config->get('site_url'); ?>admin/public/assets/css/simplebar/simplebar.min.css" rel="stylesheet" type="text/css"/>
        <link href="https://cdn.jsdelivr.net/npm/choices.js/public/assets/styles/choices.min.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $config->get('site_url'); ?>admin/public/assets/css/styles.css?v=<?php echo $config->get('version'); ?>" rel="stylesheet" type="text/css"/>
        <?php foreach($data['styles'] as $style): ?>
            <link href="<?php echo $style; ?>?v=<?php echo $data['version']; ?>" rel="stylesheet" type="text/css"/>
        <?php endforeach ?>
        <?php foreach($data['header']['scripts'] as $script): ?>
            <script type="text/javascript" src="<?php echo $script; ?>?v=<?php echo $data['version']; ?>"></script>
        <?php endforeach ?>
    </head>
    <body>
        <div class="wrapper">
            <nav id="sidebar" class="sidebar js-sidebar">
                <div class="sidebar-content js-simplebar" data-simplebar>
                    <a class="sidebar-brand" href="<?php echo $config->get('site_url'); ?>/admin">
                        <img src="<?php echo $config->get('site_url'); ?>admin/public/assets/images/logo.jpg" alt="logo">
                    </a>

                    <ul class="sidebar-nav">
                        <li class="sidebar-item <?php echo $menu_selector == 1 ? 'active' : ''; ?>">
                            <a href="/admin" class="sidebar-link">
                                <i class="bi bi-house"></i> <span class="align-middle">Anasayfa</span>
                            </a>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 15 || $menu_selector == 35 || $menu_selector == 16 ? 'active' : ''; ?>">
                            <a data-bs-target="#menu-1" data-bs-toggle="collapse" class="sidebar-link <?php echo $menu_selector == 15 || $menu_selector == 35 || $menu_selector == 16 ? '' : 'collapsed'; ?>" aria-expanded="<?php echo $menu_selector == 15 || $menu_selector == 16 || $menu_selector == 35 ? 'true' : 'false'; ?>">
                                <i class="bi bi-cart2"></i> <span class="align-middle">Siparişler</span>
                            </a>
                            <ul id="menu-1" class="sidebar-dropdown list-unstyled collapse <?php echo $menu_selector == 15 || $menu_selector == 35 || $menu_selector == 16 ? 'show' : ''; ?>" data-bs-parent="#sidebar">
                                <li class="sidebar-item <?php echo $menu_selector == 15 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/orders/list">Tüm Siparişler</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 16 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/orders/new">Bekleyen Siparişler</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 35 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/orders/abandoned">Terk Edilen Siparişler</a>
                                </li>
                            </ul>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 2 || $menu_selector == 3 || $menu_selector == 4 || $menu_selector == 40 || $menu_selector == 96 ? 'active' : ''; ?>">
                            <a data-bs-target="#menu-2" data-bs-toggle="collapse" class="sidebar-link <?php echo $menu_selector == 2 || $menu_selector == 3 || $menu_selector == 4 || $menu_selector == 40 || $menu_selector == 96 ? '' : 'collapsed'; ?>" aria-expanded="<?php echo $menu_selector == 2 || $menu_selector == 3 || $menu_selector == 4 || $menu_selector == 40 || $menu_selector == 96 ? 'true' : 'false'; ?>">
                                <i class="bi bi-tags"></i> <span class="align-middle">Ürünler</span>
                            </a>
                            <ul id="menu-2" class="sidebar-dropdown list-unstyled collapse <?php echo $menu_selector == 2 || $menu_selector == 3 || $menu_selector == 4 || $menu_selector == 40 || $menu_selector == 96 ? 'show' : ''; ?>" data-bs-parent="#sidebar">
                                <li class="sidebar-item <?php echo $menu_selector == 2 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/product/list">Tüm Ürünler</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 4 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/category/list">Kategoriler</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 3 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/brands/list">Markalar</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 96 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/collections/list">Ürün Koleksiyonları</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 40 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/product/reviews">Ürün Yorumları</a>
                                </li>
                            </ul>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 6 ? 'active' : ''; ?>">
                            <a href="/admin/users/list" class="sidebar-link">
                                <i class="bi bi-people"></i> <span class="align-middle">Müşteriler</span>
                            </a>
                        </li>
                        <li class="sidebar-item d-none <?php echo $menu_selector == 12 ? 'active' : ''; ?>">
                            <a href="/admin/coupon-codes/list" class="sidebar-link">
                                <i class="bi bi-megaphone"></i> <span class="align-middle">Kupon Kodları</span>
                            </a>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 22 || $menu_selector == 23 || $menu_selector == 24 ? 'active' : ''; ?>">
                            <a data-bs-target="#menu-content" data-bs-toggle="collapse" class="sidebar-link <?php echo $menu_selector == 22 || $menu_selector == 23 || $menu_selector == 24 ? '' : 'collapsed'; ?>" aria-expanded="<?php echo $menu_selector == 22 || $menu_selector == 23 || $menu_selector == 24 ? 'true' : 'false'; ?>">
                                <i class="bi bi-list-task"></i> <span class="align-middle">İçerik Yönetimi</span>
                            </a>
                            <ul id="menu-content" class="sidebar-dropdown list-unstyled collapse <?php echo $menu_selector == 22 || $menu_selector == 23 || $menu_selector == 24 ? 'show' : ''; ?>" data-bs-parent="#sidebar">
                                <li class="sidebar-item d-none<?php echo $menu_selector == 22 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/blog/list">Blog Yazıları</a>
                                </li>
                                <li class="sidebar-item d-none<?php echo $menu_selector == 23 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/blog-categories/list">Blog Kategorileri</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 24 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/pages/list">Sabit Sayfalar</a>
                                </li>
                            </ul>
                        </li>
                        <li class="sidebar-item d-none <?php echo $menu_selector == 34 ? 'active' : ''; ?>">
                            <a href="/admin/testimonial/list" class="sidebar-link">
                                <i class="bi bi-chat-quote"></i> <span class="align-middle">Kullanıcı Yorumları</span>
                            </a>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 33 ? 'active' : ''; ?>">
                            <a href="/admin/seo/list" class="sidebar-link">
                                <i class="bi bi-link-45deg"></i> <span class="align-middle">Link Yönetimi</span>
                            </a>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 34 ? 'active' : ''; ?>">
                            <a href="/admin/traffic/list" class="sidebar-link">
                                <i class="bi bi-bar-chart"></i> <span class="align-middle">Ziyaretçi Trafiği</span>
                            </a>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 21 ? 'active' : ''; ?>">
                            <a href="/admin/visual-settings" class="sidebar-link">
                                <i class="bi bi-image-alt"></i> <span class="align-middle">Tasarım</span>
                            </a>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 36 ? 'active' : ''; ?>">
                            <a href="/admin/shipping/list" class="sidebar-link">
                                <i class="bi bi-truck"></i> <span class="align-middle">Kargo Yönetimi</span>
                            </a>
                        </li>
                        <li class="sidebar-item <?php echo $menu_selector == 19 || $menu_selector == 20 || $menu_selector == 29 || $menu_selector == 32 || $menu_selector == 37 ? 'active' : ''; ?>">
                            <a data-bs-target="#menu-19" data-bs-toggle="collapse" class="sidebar-link <?php echo $menu_selector == 19 || $menu_selector == 20 || $menu_selector == 29 || $menu_selector == 32 || $menu_selector == 37 ? '' : 'collapsed'; ?>" aria-expanded="<?php echo $menu_selector == 19 || $menu_selector == 20 || $menu_selector == 21 || $menu_selector == 29 || $menu_selector == 37 ? 'true' : 'false'; ?>">
                                <i class="bi bi-gear"></i> <span class="align-middle">Ayarlar</span>
                            </a>
                            <ul id="menu-19" class="sidebar-dropdown list-unstyled collapse <?php echo $menu_selector == 19 || $menu_selector == 20 || $menu_selector == 29 || $menu_selector == 32 || $menu_selector == 37 ? 'show' : ''; ?>" data-bs-parent="#sidebar">
                                <li class="sidebar-item <?php echo $menu_selector == 19 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/system-logs/list">Log Kayıtları</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 20 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/settings">Genel Ayarlar</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 29 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/cron">Zamanlanmış Görevler</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 32 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/admins/list">Sistem Kullanıcıları</a>
                                </li>
                                <li class="sidebar-item <?php echo $menu_selector == 37 ? 'active' : ''; ?>">
                                    <a class="sidebar-link" href="/admin/admin-groups/list">Kullanıcı Grupları</a>
                                </li>
                            </ul>
                        </li>
                        <li class="sidebar-item">
                            <a href="/" class="sidebar-link" target="_blank">
                                <i class="bi bi-globe2"></i><span class="align-middle">Siteye Git</span>
                            </a>
                        </li>
                    </ul>
                </div>
            </nav>

            <div class="main">
                <nav class="navbar navbar-expand navbar-light navbar-bg">
                    <a class="sidebar-toggle js-sidebar-toggle">
                        <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" xml:space="preserve">
                            <path d="M492,236H20c-11.046,0-20,8.954-20,20c0,11.046,8.954,20,20,20h472c11.046,0,20-8.954,20-20S503.046,236,492,236z"></path>
                            <path d="M492,76H20C8.954,76,0,84.954,0,96s8.954,20,20,20h472c11.046,0,20-8.954,20-20S503.046,76,492,76z"></path>
                            <path d="M492,396H20c-11.046,0-20,8.954-20,20c0,11.046,8.954,20,20,20h472c11.046,0,20-8.954,20-20 C512,404.954,503.046,396,492,396z"></path>
                        </svg>
                    </a>

                    <div class="navbar-collapse collapse">
                        <ul class="navbar-nav navbar-align">
                            <li class="nav-item">
                                <a class="nav-icon js-fullscreen d-none d-lg-block" href="#">
                                    <div class="position-relative">
                                        <svg 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" class="feather feather-maximize align-middle"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>
                                    </div>
                                </a>
                            </li>
                            <li class="nav-item dropdown">
                                <a class="nav-icon pe-md-0 dropdown-toggle" data-bs-toggle="dropdown">
                                    <img src="<?php echo $config->get('site_url'); ?>public/assets/images/avatar/<?php echo $session->data["user_avatar"] ?>" class="avatar rounded img-fluid" alt="<?php echo $session->data["user_name"] ?>">
                                </a>
                                <div class="dropdown-menu dropdown-menu-end">
                                    <a class="dropdown-item" href="<?php echo $config->get('site_url'); ?>admin/admins/edit?id=<?php echo $session->data["user_id"] ?>"><svg 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" class="feather feather-user align-middle me-1"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg> Profil</a>
                                    <div class="dropdown-divider"></div>
                                    <a class="dropdown-item" data-action="logout" href="<?php echo $config->get('site_url'); ?>admin/logout">Güvenli Çıkış</a>
                                </div>
                            </li>
                        </ul>
                    </div>
                </nav>
                <nav class="breadcrumb-nav" aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <?php foreach($data["breadcrumbs"] as $breadcrumb): ?>
                            <li class="breadcrumb-item"><a href="<?php echo $breadcrumb["href"]; ?>"><?php echo $breadcrumb["text"]; ?></a></li>
                        <?php endforeach ?>
                    </ol>
                </nav>

                <?php if(isset($data["warning_message"])): ?>
                    <div class="alert alert-danger alert-dismissible flash-message" role="alert">
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                        <div class="alert-message">
                            <?php echo $data["warning_message"]; ?>
                        </div>
                    </div>
                <?php endif; ?>

                <?php if(isset($session->data["message"]) && !empty($session->data["message"])): ?>
                    <?php if($session->data["messageType"] == "success"): ?>
                        <div class="alert alert-success alert-dismissible flash-message" role="alert">
                            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                            <div class="alert-message">
                                <?php echo $session->data["message"]; ?>
                            </div>
                        </div>
                    <?php elseif($session->data["messageType"] == "error"): ?>
                        <div class="alert alert-danger alert-dismissible flash-message" role="alert">
                            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                            <div class="alert-message">
                                <?php echo $session->data["message"]; ?>
                            </div>
                        </div>
                    <?php elseif($session->data["messageType"] == "warning"): ?>
                        <div class="alert alert-warning alert-dismissible flash-message" role="alert">
                            <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                            <div class="alert-message">
                                <?php echo $session->data["message"]; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                    <?php unset($session->data["message"]); unset($session->data["messageType"]); unset($session->data["messageTitle"]); ?>
                <?php endif; ?>