<nav class="main-header navbar navbar-expand navbar-white navbar-light <?php if($per_accesos != "") echo' bg-'.$per_accesos;?>">
    <ul class="navbar-nav">
        <li class="nav-item">
            <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars" <?php if($iconoColor != "") echo" style='color:".$iconoColor; echo";'";?>></i></a>
        </li>
        <li class="nav-item d-none d-sm-inline-block">
            <a href="index3.html" class="nav-link <?php if($colorTexto != "") echo' text-'.$colorTexto;?>">Inicio</a>
        </li>
        <li class="nav-item d-none d-sm-inline-block">
            <a href="#" class="nav-link <?php if($colorTexto != "") echo' text-'.$colorTexto;?>">Contacto</a>
        </li>
    </ul>
    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
        <!-- Messages Dropdown Menu -->
<!--        <li class="nav-item dropdown">
            <a class="nav-link" data-toggle="dropdown" href="#">
                <i class="far fa-comments" <?php if($iconoColor != "") echo" style='color:".$iconoColor; echo";'";?>></i>
                <span class="badge badge-danger navbar-badge">3</span>
            </a>
            <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                <a href="#" class="dropdown-item">
                     Message Start 
                    <div class="media">
                        <img src="../../public/img/user1-128x128.jpg" alt="User Avatar" class="img-size-50 mr-3 img-circle">
                        <div class="media-body">
                            <h3 class="dropdown-item-title">
                                Brad Diesel
                                <span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>
                            </h3>
                            <p class="text-sm">Call me whenever you can...</p>
                            <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                        </div>
                    </div>
                     Message End 
                </a>
                <div class="dropdown-divider"></div>
                <a href="#" class="dropdown-item">
                     Message Start 
                    <div class="media">
                        <img src="../../public/img/user8-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
                        <div class="media-body">
                            <h3 class="dropdown-item-title">
                                John Pierce
                                <span class="float-right text-sm text-muted"><i class="fas fa-star"></i></span>
                            </h3>
                            <p class="text-sm">I got your message bro</p>
                            <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                        </div>
                    </div>
                     Message End 
                </a>
                <div class="dropdown-divider"></div>
                <a href="#" class="dropdown-item">
                     Message Start 
                    <div class="media">
                        <img src="../../public/img/user3-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
                        <div class="media-body">
                            <h3 class="dropdown-item-title">
                                Nora Silvester
                                <span class="float-right text-sm text-warning"><i class="fas fa-star"></i></span>
                            </h3>
                            <p class="text-sm">The subject goes here</p>
                            <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                        </div>
                    </div>
                     Message End 
                </a>
                <div class="dropdown-divider"></div>
                <a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
            </div>
        </li>-->
        <!-- Notifications Dropdown Menu -->
        <?php
        require_once("../../models/Notificaciones.php");
        $notificacion = new Notificaciones();
        $notificacion->InsertarNotificacionPerfil($_SESSION["usuariodbk"], $_SESSION["personadbk"]);
        $respuesta = $notificacion->ConsultarTotalNotificaciones($_SESSION["usuariodbk"]);
        foreach ($respuesta as $row) {
            $total = $row["total"];
        }
        ?>        
        <li class="nav-item dropdown">
            <a class="nav-link" data-toggle="dropdown" href="#">
                <i class="far fa-bell" <?php if($iconoColor != "") echo" style='color:".$iconoColor; echo";'";?>></i>
                <span class="badge badge-warning navbar-badge"><?php echo ' ' . $total . ' '; ?></span>
            </a>
            <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                <span class="dropdown-item dropdown-header"><?php echo ' ' . $total . ' Notificaciones'; ?></span>
                <div class="dropdown-divider"></div>
                <a href="../Notificaciones/" class="dropdown-item">
                    <?php
//                        $respuesta = $notificacion->ConsultarNotificaciones($_SESSION["personadbk"]);
//                        foreach ($respuesta as $row){
//                            $total = $row["not_usuariodbk"];
//                        }                                            
                    ?>
                    <i class="fas fa-bell"></i><?php echo ' ' . $total . ' Alertas del Sistema'; ?>                        
                    <span class="float-right text-muted text-sm"><i class="fa fa-eye" aria-hidden="true"></i></span>   

                </a>
                <div class="dropdown-divider"></div>
                <a href="#" class="dropdown-item dropdown-footer">Ver todo</a>
            </div>
        </li>
        <li class="nav-item">
            <a class="nav-link" href="../html/Logout.php" role="button">
                <i class="fas fa-power-off fa-expand-arrows-alt" <?php if($iconoColor != "") echo" style='color:".$iconoColor; echo";'";?>></i>
            </a>
        </li>
        <!--            <li class="nav-item">
                        <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button">
                            <i class="fas fa-th-large"></i>
                        </a>
                    </li>-->
    </ul>
</nav>
<input type="hidden" id="userId" value="<?php echo $_SESSION["usuariodbk"]; ?>">
<input type="hidden" id="personaId" value="<?php echo $_SESSION["personadbk"]; ?>">
<input type="hidden" id="userPerfil" value="<?php echo $_SESSION["perfil"]; ?>">
<!-- /.navbar -->
