{{-- ***************************
  Versión de Bootstrap : 5.1.3
  Versión de Jquery : 2.2.4
  Versión de Select2 : 4.1.0
****************************--}}
<!DOCTYPE html>
<html lang="es">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Styles -->
        <link rel="stylesheet" href="{{ asset('/css/bootstrap.min.css') }}">
        <link rel="stylesheet" href="{{ asset('/css/select2.min.css') }}">
        <link rel="stylesheet" href="{{ url('/iconos/bootstrap-icons.min.css') }}">
        <link rel="stylesheet" href="{{ asset('/css/estilo.css') }}">
        <!-- Scripts -->
        <script src="{{ asset('/js/bootstrap.min.js') }}"></script>
        <script src="{{ asset('/js/jquery-2.2.4.min.js') }}"></script>
        <script src="{{ asset('/js/select2.min.js') }}"></script>
        <script src="{{ asset('/js/app.js')}}"></script>
    </head>
    <style type="text/css">
        body, html {
            height: 100%;
            background-repeat: no-repeat;
            background: url(imagenes/contabilidad5.avif) no-repeat center center fixed;
            background-size: 100% 100%;
        }
    </style>
    <body>
        <!--br-->
        <!--div class="container shadow"-->
            {{-- @include('layout.cabecera') --}}
        <div class='dashboard'>
            <div class="dashboard-nav">
                @include('layout.menu')
            </div>
            <div class='dashboard-app'>
                <header class='dashboard-toolbar'><a href="#!" class="menu-toggle"><i class="fas fa-bars"></i></a>
                    <nav class="navbar navbar-expand-lg">
                        <div class="collapse navbar-collapse" id="navbarSupportedContent">
                            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                                <li class="nav-item dropdown">
                                    <a class="nav-link dropdown-toggle text-black" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="true" style="text-decoration: none">
                                        <i class="bi bi-person-circle"></i> {{auth()->user()->nombre}}
                                    </a>
                                    {!!(\App\Http\helpers::getnameempresa(auth()->user()->idusuario))!!}
                                    {{-- Empresa en Ejercicio : {{$empresa()->nombre}} --}}
                                    <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
                                        {{-- <li><a class="dropdown-item" href="{{url('/password/reset')}}">Cambiar contraseña</a></li> --}}
                                        <li><a class="dropdown-item" href="{{url('/usuario/cambiarpass/'.auth()->user()->idusuario)}}">Cambiar contraseña</a></li>
                                        <li><a class="dropdown-item" href="{{route('logout')}}">Cerrar Sesión</a></li>
                                    </ul>
                                </li>
                            </ul>   
                        </div>
                    </nav>     
                </header>
                <div class='dashboard-content'>
                    {{-- <div class='container'> --}}
                        {{-- <div class='card'>
                            <div class='card-header'>
                                <h1>Welcome back Jim</h1>
                            </div>
                            <div class='card-body'>
                                <p>Your account type is: Administrator</p>
                            </div>
                        </div> --}}
                        @yield('contenido')
                    {{-- </div> --}}
                </div>
                @include('layout.pie')
            </div>
        </div>
        @stack('scripts')
            <script>
                $(".alert").fadeTo(2000, 500).slideUp(500, function() {
                    $("#success-alert").slideUp(1000);
                });
                function separadorMiles(x) {
                    if (x) {
                        return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
                    } else {
                        return 0;
                    }
                }

                function format(input) {
                    var num = input.value.replace(/\./g, '');
                    if (!isNaN(num)) {
                        num = num.toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g, '$1.');
                        num = num.split('').reverse().join('').replace(/^[\.]/, '');
                        input.value = num;
                    } else {
                        alert('Solo se permiten numeros');
                        input.value = input.value.replace(/[^\d\.]*/g, '');
                    }
                }    
            </script>   
        <!--/div-->
    </body>
</html>
