<?php require_once 'autoload.php'; ?>
<!DOCTYPE html>
<html lang="pt-Br">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Feneva</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="" name="keywords">
    <meta content="" name="description">

    <!-- Favicon -->
    <link href="img/favicon.ico" rel="icon">

    <!-- Google Web 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=Open+Sans:wght@400;600&family=Roboto:wght@500;700&display=swap" rel="stylesheet">

    <!-- Icon Font Stylesheet -->
    <link href="<?= __URLSITE__ ?>/vendor/fortawesome/font-awesome/css/all.min.css" rel="stylesheet">

    <!-- Libraries Stylesheet -->
    <link href="<?= __URLSITE__ ?>lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
    <link href="<?= __URLSITE__ ?>lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />

    <!-- Customized Bootstrap Stylesheet -->
    <link href="<?= __URLSITE__ ?>vendor/datatables/datatables/media/css/dataTables.bootstrap.css" rel="stylesheet">
    <link href="<?= __URLSITE__ ?>vendor/datatables/datatables/media/css/jquery.dataTables.css" rel="stylesheet">
    <link href="<?= __URLSITE__ ?>assets/css/bootstrap.min.css" rel="stylesheet">

    <!-- Template Stylesheet -->
    <link href="<?= __URLSITE__ ?>assets/css/style.css" rel="stylesheet">

</head>

<!-- JavaScript Libraries -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.js" integrity="sha512-+k1pnlgt4F1H8L7t3z95o3/KO+o78INEcXTbnoJQ/F2VqDVhWoaiVml/OEHv9HsVgxUaVW+IbiZPUJQfF/YxZw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
<script src="<?= __URLSITE__ ?>vendor/components/jquery/jquery.min.js" referrerpolicy="no-referrer"></script>
<script src="<?= __URLSITE__ ?>js/popper.js"></script>
<script src="<?= __URLSITE__ ?>vendor/twitter/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- <script src="<?= __URLSITE__ ?>lib/chart/chart.min.js"></script> -->
<script src="<?= __URLSITE__ ?>lib/easing/easing.min.js"></script>
<script src="<?= __URLSITE__ ?>lib/waypoints/waypoints.min.js"></script>
<script src="<?= __URLSITE__ ?>lib/owlcarousel/owl.carousel.min.js"></script>
<script src="<?= __URLSITE__ ?>lib/tempusdominus/js/moment.min.js"></script>
<script src="<?= __URLSITE__ ?>lib/tempusdominus/js/moment-timezone.min.js"></script>
<script src="<?= __URLSITE__ ?>lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>

<script src="<?= __URLSITE__ ?>vendor/datatables/datatables/media/js/jquery.dataTables.js"></script>
<script src="<?= __URLSITE__ ?>vendor/datatables/datatables/media/js/dataTables.bootstrap.js"></script>
<script src="<?= __URLSITE__ ?>vendor/datatables/datatables/media/js/dataTables.bootstrap.js"></script>


<!-- Template Javascript -->
<script src="<?= __URLSITE__ ?>js/main.js"></script>

<body>

    <div class="container-fluid position-relative d-flex p-0">
        <!-- Spinner Start -->
        <div id="spinner" class="show bg-dark position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
            <div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
                <span class="sr-only">Loading...</span>
            </div>
        </div>
        <!-- Spinner End -->
        <?php if (!str_contains($url_nav, "/inscricao") && !str_contains($url_nav, "/login_participante")): ?>
            <!-- Sidebar Start -->
            <div class="sidebar pe-4 pb-3">
                <?php include_once('menu.php') ?>
            </div>
            <!-- Sidebar End -->

        <?php endif ?>
        <!-- Content Start -->
        <div class="content">
            <!-- Navbar Start -->
            <?php if (!str_contains($url_nav, "/inscricao") && !str_contains($url_nav, "/login_participante")): ?>
                <nav class="navbar navbar-expand bg-secondary navbar-dark sticky-top px-4 py-0">
                    <a href="<?= __URLSITE__ ?>" class="navbar-brand d-flex d-lg-none me-4">
                        <h2 class="text-primary mb-0 text-center">
                            <!-- <i class="fa fa-user-edit"></i> -->
                            <!-- <img class="rounded-circle me-lg-2" src="img/feneva-logo.png" alt="" style="width: 40px; height: 40px;"> -->
                            <i class="fa-solid fa-gauge me-2"></i><br>Feneva
                        </h2>
                    </a>
                    <a href="#" class="sidebar-toggler flex-shrink-0">
                        <i class="fa fa-bars"></i>
                    </a>
                    <div class="navbar-nav align-items-center ms-auto">
                        <div class="nav-item dropdown">

                        </div>
                    </div>
                </nav>
            <?php endif ?>
            <!-- Navbar End -->

            <!-- Pages Start -->
            <div class="container-fluid pt-4 px-4">
                <?php
                if (count($url) > 1) {
                    $caminho = $url_nav . ".php";
                    if (str_contains($caminho, "/.php")) {
                        include "modulos/" . (str_replace("/.php", "/listagem.php", $caminho));
                    } else {

                        include "modulos/" . $caminho;
                    }
                } else {
                    if (str_contains($url_nav, "/inscricao")) {
                        include "inscricao.php";
                    } else if (str_contains($url_nav, "/login_participante")) {
                        include "login_participante.php";
                    } else {
                        if ($_SESSION["participante"] == true) {
                            include "home_participante.php";
                        }

                        if ($_SESSION["participante"] == false && $_SESSION["usuario_nivel"] != 'Stand') {
                            include "home.php";
                        }
                        if ($_SESSION["usuario_nivel"] == 'Stand') {
                            include "home_stand.php";
                        }
                    }
                }
                ?>
                <!-- Pages end -->
                <?php if (!str_contains($url_nav, "/inscricao") && !str_contains($url_nav, "/login_participante")): ?>
                    <!-- Footer Start -->
                    <div class="container-fluid pt-4 px-2">
                        <div class="bg-secondary rounded-top p-4">
                            <div class="row">
                                <div class="col-12 col-sm-6 text-center text-sm-start">
                                    &copy; <a href="#">Feneva</a>, Todos os Direitos Reservados. <?= date('Y-m-d H:i:s') ?>
                                </div>
                                <div class="col-12 col-sm-6 text-center text-sm-end">
                                    Painel Eventos <a href="#">1.0.0</a>
                                    <br>Distribuido por: <a href="#">ACESSO SOLUÇÕES</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Footer End -->
                <?php endif ?>
            </div>
        </div>
    </div>
    <!-- Content End -->
</body>
<!-- Template Javascript -->
<script src="<?= __URLSITE__ ?>js/main.js"></script>
<script src="<?= __URLSITE__ ?>js/mask.js"></script>
<script src="<?= __URLSITE__ ?>js/mascaras.js"></script>

</html>