<?php
$session = session();
$settings = $session->get('settings');
$picture = "/assets/img/default-user.png";
?>
<!DOCTYPE html>

<html
        lang="<?= $session->get('lang') ?>"
        class="h-100 light-style layout-navbar-fixed layout-menu-fixed"
        dir="ltr"
        data-theme="theme-default"
        data-assets-path="<?= site_url('themes/vuexy/') ?>"
        data-template="vertical-menu-template-no-customizer"
>


<head>
    <meta charset="utf-8">
    <meta
            name="viewport"
            content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
    />

    <title><?= config('Safekat')->appName ?></title>

    <meta name="description" content=""/>

    <!-- Favicon -->
    <link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>"/>
    <link rel="apple-touch-icon" sizes="57x57" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-57x57.png') ?>">
    <link rel="apple-touch-icon" sizes="60x60" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-60x60.png') ?>">
    <link rel="apple-touch-icon" sizes="72x72" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-72x72.png') ?>">
    <link rel="apple-touch-icon" sizes="76x76" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-76x76.png') ?>">
    <link rel="apple-touch-icon" sizes="114x114"
          href="<?= site_url('themes/vuexy/img/favicon/apple-icon-114x114.png') ?>">
    <link rel="apple-touch-icon" sizes="120x120"
          href="<?= site_url('themes/vuexy/img/favicon/apple-icon-120x120.png') ?>">
    <link rel="apple-touch-icon" sizes="144x144"
          href="<?= site_url('themes/vuexy/img/favicon/apple-icon-144x144.png') ?>">
    <link rel="apple-touch-icon" sizes="152x152"
          href="<?= site_url('themes/vuexy/img/favicon/apple-icon-152x152.png') ?>">
    <link rel="apple-touch-icon" sizes="180x180"
          href="<?= site_url('themes/vuexy/img/favicon/apple-icon-180x180.png') ?>">
    <link rel="icon" type="image/png" sizes="192x192"
          href="<?= site_url('themes/vuexy/img/favicon/android-icon-192x192.png') ?>">
    <link rel="icon" type="image/png" sizes="32x32"
          href="<?= site_url('themes/vuexy/img/favicon/favicon-32x32.png') ?>">
    <link rel="icon" type="image/png" sizes="96x96"
          href="<?= site_url('themes/vuexy/img/favicon/favicon-96x96.png') ?>">
    <link rel="icon" type="image/png" sizes="16x16"
          href="<?= site_url('themes/vuexy/img/favicon/favicon-16x16.png') ?>">
    <link rel="manifest" href="<?= site_url('themes/vuexy/img/favicon/manifest.json') ?>">

    <!-- Fonts -->
    <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=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
            rel="stylesheet"
    />

    <!-- Icons -->
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>"/>
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>"/>
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>"/>

    <!-- Core CSS -->
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>"/>
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>"/>
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>"/>


    <!-- Vendors CSS -->
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>

    <!-- Page CSS -->
    <link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/page-faq.css') ?>"/>
    <?= $this->renderSection('css') ?>

    <!-- Helpers -->
    <script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
    <script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>


</head>

<body>

<!-- Layout wrapper -->
<div class="layout-wrapper layout-content-navbar">
    <div class="layout-container">

        <?php include "selector_menu.php" ?>

        <!-- Layout container -->
        <div class="layout-page">

            <!-- Navbar -->
            <nav
                    class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
                    id="layout-navbar"
            >
                <div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
                    <a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
                        <i class="ti ti-menu-2 ti-sm"></i>
                    </a>
                </div>

                <div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
                    <div class="navbar-nav align-items-center">
                        <a class="nav-link style-switcher-toggle hide-arrow" href="javascript:void(0);">
                            <i class="ti ti-sm"></i>
                        </a>
                    </div>

                    <ul class="navbar-nav flex-row align-items-center ms-auto">

                        <!-- Notification -->
                        <li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-1">
                            <a
                                    class="nav-link dropdown-toggle hide-arrow"
                                    href="javascript:void(0);"
                                    data-bs-toggle="dropdown"
                                    data-bs-auto-close="outside"
                                    aria-expanded="false"
                            >
                                <i class="ti ti-bell ti-md"></i>
                                <span class="badge bg-danger rounded-pill badge-notifications">5</span>
                            </a>
                        </li>
                        <!--/ Notification -->

                        <!-- Search Budgets -->
                        <li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
                            <a
                                    class="nav-link hide-arrow"
                                    href="<?= route_to("buscadorPresupuestosList"); ?>"
                                    title="Acceso directo a buscador de presupuestos"
                            >
                                <i class="ti ti-report-search ti-md"></i>

                            </a>
                        </li>
                        <!--/ Search Budgets -->

                        <!-- View Mode links  -->
                        <?php
                        if (auth()->user()->inGroup('beta')) :
                            ?>
                            <li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
                                <a
                                        class="nav-link dropdown-toggle hide-arrow"
                                        href="javascript:void(0);"
                                        data-bs-toggle="dropdown"
                                        data-bs-auto-close="outside"
                                        aria-expanded="false"
                                >
                                    <i class="ti ti-building ti-md"></i>
                                </a>
                                <div class="dropdown-menu dropdown-menu-end py-0">
                                    <div class="dropdown-menu-header border-bottom">
                                        <div class="dropdown-header d-flex align-items-center py-3">
                                            <h5 class="text-body mb-0 me-auto">Vistas</h5>
                                        </div>
                                    </div>

                                    <div class="dropdown-shortcuts-list scrollable-container">

                                        <div class="row row-bordered overflow-visible g-0">
                                            <div class="dropdown-shortcuts-item col">
                                            <span class="dropdown-shortcuts-icon rounded-circle mb-2">
                                                <i class="ti ti-printer fs-4"></i>
                                            </span>
                                                <small class="text-muted mb-0">Vista</small>
                                                <a href="<?= site_url('viewmode/' . config("Basics")->vista_impresion); ?>"
                                                   class="stretched-link">Impresión</a>
                                            </div>
                                            <div class="dropdown-shortcuts-item col">
                                            <span class="dropdown-shortcuts-icon rounded-circle mb-2">
                                                <i class="ti ti-ruler-2 fs-4"></i>
                                            </span>
                                                <small class="text-muted mb-0">Vista</small>
                                                <a href="<?= site_url('viewmode/' . config("Basics")->vista_maquetacion); ?>"
                                                   class="stretched-link">Maquetación</a>
                                            </div>
                                        </div>
                                        <div class="row row-bordered overflow-visible g-0">
                                            <div class="dropdown-shortcuts-item col">
                                            <span class="dropdown-shortcuts-icon rounded-circle mb-2">
                                                <i class="ti ti-file-code-2 fs-4"></i>
                                            </span>
                                                <small class="text-muted mb-0">Vista</small>
                                                <a href="<?= site_url('viewmode/' . config("Basics")->vista_digitalizacion); ?>"
                                                   class="stretched-link">Digitalización</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </li>
                        <?php
                        endif;
                        ?>
                        <!-- View Mode links -->

                        <!-- Language -->
                        <li class="nav-item dropdown-language dropdown me-2 me-xl-0">
                            <a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
                               data-bs-toggle="dropdown">
                                <i class="fi <?= getCurrentLanguageFlag(); ?> fis rounded-circle me-1 fs-3"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-end">
                                <li>
                                    <a class="dropdown-item" href="<?= site_url('lang/es'); ?>" data-language="es">
                                        <i class="fi fi-es fis rounded-circle me-1 fs-3"></i>
                                        <span class="align-middle"><?= lang("App.lang_es") ?></span>
                                    </a>
                                </li>
                                <li>
                                    <a class="dropdown-item" href="<?= site_url('lang/en'); ?>" data-language="en">
                                        <i class="fi fi-gb fis rounded-circle me-1 fs-3"></i>
                                        <span class="align-middle"><?= lang("App.lang_en") ?></span>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <!--/ Language -->

                        <!-- User -->
                        <li class="nav-item navbar-dropdown dropdown-user dropdown">
                            <a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
                               data-bs-toggle="dropdown">
                                <div class="avatar">
                                    <img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
                                </div>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-end">
                                <li>
                                    <a class="dropdown-item" href="#">
                                        <div class="d-flex">
                                            <div class="flex-shrink-0 me-3">
                                                <div class="avatar avatar">
                                                    <img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
                                                </div>
                                            </div>
                                            <div class="flex-grow-1">
                                                <span class="fw-semibold d-block"><?= auth()->user()->getFullName(); ?></span>
                                                <small class="text-muted"><?= auth()->user()->getEmail(); ?></small>
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <div class="dropdown-divider"></div>
                                </li>
                                <li>
                                    <a class="dropdown-item" href="<?= site_url('profile'); ?>">
                                        <i class="ti ti-user-check me-2 ti-sm"></i>
                                        <span class="align-middle"><?= lang("App.menu_profile") ?></span>
                                    </a>
                                </li>
                                <!--                                <li>-->
                                <!--                                    <a class="dropdown-item" href="#">-->
                                <!--                                        <i class="ti ti-settings me-2 ti-sm"></i>-->
                                <!--                                        <span class="align-middle">Settings</span>-->
                                <!--                                    </a>-->
                                <!--                                </li>-->

                                <li>
                                    <div class="dropdown-divider"></div>
                                </li>
                                <li>
                                    <a class="dropdown-item" href="<?= site_url("logout") ?>">
                                        <i class="ti ti-logout me-2 ti-sm"></i>
                                        <span class="align-middle"><?= lang("App.menu_logout") ?></span>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <!--/ User -->
                    </ul>
                </div>
            </nav>
            <!-- / Navbar -->

            <!-- Content wrapper -->
            <div class="content-wrapper">
                <!-- Content -->
                <?= $this->renderSection('content') ?>
                <!-- / Content -->

                <!-- Footer -->
                <footer class="content-footer footer bg-footer-theme">
                    <div class="container-xxl">
                        <div class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
                            <div>
                                <a href="#" target="_blank" class="fw-semibold">Safekat</a> © <?= date('Y'); ?>
                            </div>
                        </div>
                    </div>
                </footer>
                <!-- / Footer -->

                <div class="content-backdrop fade"></div>
            </div>
            <!-- Content wrapper -->
        </div>
        <!-- / Layout page -->
    </div>

    <!-- Overlay -->
    <div class="layout-overlay layout-menu-toggle"></div>

    <!-- Drag Target Area To SlideIn Menu On Small Screens -->
    <div class="drag-target"></div>
</div>
<!-- / Layout wrapper -->

<?= $this->renderSection('footerAdditions') ?>

<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
<!-- endbuild -->

<!-- Vendors JS -->
<?= $this->renderSection('additionalExternalJs') ?>

<!-- Main JS -->
<script src="<?= site_url('themes/vuexy/js/main.js') ?>"></script>

<!-- Page JS -->
<?= sweetAlert() ?>


<script type="text/javascript">

    <?= $this->renderSection('additionalInlineJs') ?>

</script>

</body>
</html>

