<?php require_once __DIR__."/join.php" ?>
<!doctype html>
<html class="no-js" lang="<?= $language ?? '' ?>">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <?php
    if (false) {
        ?>
        <meta name="description" content="Responsive Bootstrap 4 and web Application ui kit.">
        <?php
    }
    ?>
    <meta name="csrf-token" content="<?= $token ?? "" ?>">
    <base href="<?= $baseUrl ?? ''; ?>">
    <title> {{title}} <?= $tittle ?? "" ?> </title>
    <!-- Favicon-->
    <link rel="icon" href="<?= $favicon ?? '' ?>" type="image/x-icon">
    <link rel="stylesheet" href="assets/admin/plugins/bootstrap/css/bootstrap.min.css">
    <?= $head ?? '' ?>
    <!-- Custom Css -->
    <link rel="stylesheet" href="assets/admin/css/style.min.css">

</head>

<body class="<?= $themeColor ?? 'theme-blue' ?> <?= $themeMode ?? '' ?>">

<!-- Overlay For Sidebars -->
<div class="overlay"></div>

<!-- Right Icon menu Sidebar -->
<div class="navbar-right">
    <ul class="navbar-nav">
        <li><a href="javascript:void(0);" class="js-right-sidebar" title="Setting"><i
                    class="zmdi zmdi-settings"></i></a></li>
        <li class="dropdown">
            <a href="javascript:void(0);" class="dropdown-toggle" title="lang"
               data-toggle="dropdown" role="button">
                <div id="flag" data-lang="<?= $lang ?? "tr" ?>">
                    <img src="assets/admin/images/flags/lang-info.svg"
                         alt="<?= $lang ?? "tr" ?>" width="64">
                </div>
            </a>
            <ul class="dropdown-menu slideUp2 mt-2">
                <li>
                    <ul class="menu app_sortcut list-unstyled" id="countries">
                        <li>
                            <a href="javascript:void(0)" class="justify-content-center">
                                <img src="assets/admin/images/flags/EN.svg" alt="EN" width="64">
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0)" class="justify-content-center">
                                <img src="assets/admin/images/flags/TR.svg" alt="TR" width="64">
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </li>

        <li>
            <a href="./" target="_blank" class="mega-menu" title="{{a_tittle_site}}"><i class="zmdi zmdi-hc-fw"></i></a>
        </li>
        <li>
            <a href="admin/logout" class="mega-menu" title="{{a_tittle_logout}}"><i class="zmdi zmdi-power"></i></a>
        </li>
    </ul>
</div>

<!-- Left Sidebar -->
<aside id="leftsidebar" class="sidebar">
    <?php
    $open_tab = $open_tab ?? '';
    $active = $active ?? '';
    ?>
    <div class="navbar-brand">
        <button class="btn-menu ls-toggle-btn" type="button"><i class="zmdi zmdi-menu"></i></button>
        <?php
        if (false) {
        ?>
        <a href="./admin"><img src="<?= $logo ?? '' ?>" alt="<?= $tittle ?? '' ?>">
            <?php
            } else {
            ?>
            <a href="./admin"><img src="<?= "upload/logo/demir-logo-black.png" ?? '' ?>" alt="<?= $tittle ?? '' ?>">
                <?php
                }
                ?>

                <div class="row">
                    <span class="font-bold col-12 mt-2 text-center"> {{span_text_1}} </span>
                </div>
            </a>
    </div>
    <div class="menu">
        <ul class="list">
            <li>
                <div class="user-info">
                    <a class="image" href="<?= isset($user["username_slug"]) ? "admin/profile/".$user["username_slug"] : 'javascript:void(0)' ?>" title="<?= $user["username_slug"] ?? 'kullanıcı bulunamadı' ?>">
                        <img src="<?= $user['user_avatar'] ?? 'assets/admin/images/profile_av.jpg' ?> " alt="<?= $user["username_slug"] ?? 'kullanıcı bulunamadı' ?>"></a>
                    <div class="detail">
                        <a class="image" href="<?= isset($user["username_slug"]) ? "admin/profile/".$user["username_slug"] : 'javascript:void(0)' ?>" title="<?= $user["username_slug"] ?? 'kullanıcı bulunamadı' ?>">
                            <h4><?= $user["username"] ?? "Kullanıcı Bulunamadı" ?></h4>
                        </a>
                        <?php
                        if (false) {
                            ?>
                            <small>Admin</small>
                            <?php
                        }
                        ?>
                    </div>
                </div>
            </li>
            <li class="<?= $active === "index" ? "active" : "" ?>"><a href="./admin/"><i
                            class="zmdi zmdi-home"></i><span>{{menu_text_1}}</span></a></li>
            <li class="<?= $active === "users" ? "active" : "" ?>"><a href="./admin/users"><i
                            class="zmdi zmdi-hc-fw"></i><span>{{menu_text_2}}</span></a></li>
            <?php
            if ($_SERVER["HTTP_HOST"] == "localhost") {
                ?>
                <li class="open_top <?= in_array($open_tab, ['blank', 'admin']) ? "open active" : "" ?> ">
                    <a href="javascript:void(0);" class="menu-toggle"><i
                                class="zmdi zmdi-copy"></i><span>{{menu_text_3}}</span>
                    </a>
                    <ul class="ml-menu">
                        <li class="<?= $active === "blank" ? "active" : "" ?>">
                            <a href="./admin/blank">
                                {{menu_text_3_1}}
                            </a>
                        </li>

                        <li>
                            <a href="template/admin/index.html" target="_blank">
                                {{menu_text_3_2}}
                            </a>
                        </li>
                        <li>
                            <a href="template/home/saasland/index.php" target="_blank">
                                {{menu_text_3_3}}
                            </a>
                        </li>
                    </ul>
                </li>
                <?php
            }
            ?>
            <li class="<?= $active === "references" ? "active" : "" ?>">
                <a href="./admin/references">
                    <i class="zmdi zmdi-hc-fw"></i>
                    <span>{{menu_text_5}}</span>
                </a>
            </li>
            <li class="<?= $active === "settings" ? "active" : "" ?>">
                <a href="./admin/settings">
                    <i class="zmdi zmdi-flower"></i>
                    <span>{{menu_text_4}}</span>
                </a>
            </li>
        </ul>
    </div>
</aside>

<!-- Right Sidebar -->
<aside id="rightsidebar" class="right-sidebar">
    <ul class="nav nav-tabs sm">
        <li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#setting"><i
                        class="zmdi zmdi-settings zmdi-hc-spin"></i></a></li>
    </ul>
    <div class="tab-content">
        <div class="tab-pane active" id="setting">
            <div class="slim_scroll">
                <div class="card">
                    <?php
                       $themeMode=$themeMode ?? '';
                       $themeColor=$themeColor ?? 'theme-blue'
                    ?>
                    <h6>{{theme_option_text}}</h6>
                    <div class="light_dark">
                        <div class="radio">
                            <input type="radio" name="themeMode" id="lighttheme" value="light" <?= $themeMode!=='theme-dark' ? 'checked' : '' ?> >
                            <label for="lighttheme">{{mode_text_light}}</label>
                        </div>
                        <div class="radio mb-0">
                            <input type="radio" name="themeMode" id="darktheme" value="dark" <?= $themeMode==='theme-dark' ? 'checked' : '' ?>>
                            <label for="darktheme">{{mode_text_dark}}</label>
                        </div>
                    </div>
                </div>
                <div class="card">
                    <h6>{{color_skins_text}}</h6>
                    <ul class="choose-skin list-unstyled">
                        <li data-theme="purple" <?= $themeColor==='theme-purple' ? 'class="active"' : '' ?>><div class="purple"></div></li>
                        <li data-theme="blue" <?= $themeColor==='theme-blue' ? 'class="active"' : '' ?>><div class="blue"></div></li>
                        <li data-theme="cyan" <?= $themeColor==='theme-cyan' ? 'class="active"' : '' ?>><div class="cyan"></div></li>
                        <li data-theme="green" <?= $themeColor==='theme-green' ? 'class="active"' : '' ?>><div class="green"></div></li>
                        <li data-theme="orange" <?= $themeColor==='theme-orange' ? 'class="active"' : '' ?>><div class="orange"></div></li>
                        <li data-theme="blush" <?= $themeColor==='theme-blush' ? 'class="active"' : '' ?>><div class="blush"></div></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</aside>