@extends('usuarios.funcionarios.master.layout2')

@section('conteudo')
    <nav class="d-none">
        {{ $funcionario= \App\Models\Funcionario::where('nmec',$nmec)->first() }}
        {{ $usuario= $funcionario->getUser }}
        {{ $sector= $funcionario->getSector }}
        {{ $categoria= $funcionario->getCategoria }}
        {{ $pessoa= $usuario->getPessoa }}
    </nav>
    {{-- \App\Models\User::where('id',$funcionario->user_id)->first() --}}
    <br>
    {{-- <div class="container ">
        <nav class="row">

            <nav class="col-12" style="--bs-breadcrumb-divider: url(&#34;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M2.5 0L1 1.5 3.5 4 1 6.5 2.5 8l4-4-4-4z' fill='currentColor'/%3E%3C/svg%3E&#34;);" aria-label="breadcrumb">

                <ol class="breadcrumb justify-content-start">
                    <li class="breadcrumb-item"> <a href=""> Usuário</a> </li>
                    <li class="breadcrumb-item "  ><a href=""> Area restrita</a></li>
                    <li class="breadcrumb-item active" aria-current="page">Perfil</li>
                </ol>
            </nav>
        </nav>
    </div> --}}
    <div class="p-4">

        <label for="" class="m-3">Perfil do funcionário</label>

        <nav class="container">

            <div class="row">
                <div class="col-4">
                    <div class="row rounded p-3 border-5 border-success shadow border-top">
                    <div class="col-12 text-center">
                            <a href="{{ route('us.admin.funcionario.editar_foto',$funcionario->id) }}" class="btn shadow-sm border border-3 btn-lg bg-light rounded-circle   " style="height: 150px; width:150px; background-repeat:no-repeat; background-size:90%; background-position:center; background-image:url({{ asset('storage/img/'.$usuario->avatar) }})">

                            </a>
                            <br><br>
                            <strong><h6>{{ $pessoa->nome }}</h6></strong>
                            <small href="" class="  ">  {{ $usuario->email }}  </small>


                            <br>

                            <div class="text-start">
                                <br>
                                <hr>
                                <b>Identificador:</b><small href="" class="  "> {{ $funcionario->id }}  </small>
                                <br>
                                <hr>
                                <b>Número mecanográfico:</b><small href="" class="  "> {{ $funcionario->nmec }}  </small>
                                <br>
                                <hr>
                                <b>Nome completo:</b><small href="" class="  "> {{ $pessoa->nome }}  </small>

                                <br>
                                <hr>
                                <b>Nome de usuário:</b><small href="" class="  ">    {{ $usuario->name }}  </small>

                                <br>
                                <hr>
                                <b>Email:</b><small href="" class="  ">      {{ $usuario->email }}  </small>

                                <br>
                                <hr>
                                <b>Telefone:</b><small href="" class="  ">   +244   {{ $pessoa->telefone }}  </small>
                                <br>
                                <hr>
                                <b>Sector:</b><small href="" class="  ">      {{ $sector->sector }} </small>

                                <br>
                                <hr>

                                <b>Categoria:</b><small href="" class="  ">      {{ $categoria->categoria }} </small>
                                <br>
                                <hr>

                                <b>Estado da conta:</b><small href="" class="  ">    {{ $usuario->estado }}</small>

                                <br>
                                <hr>
                                <b>Data de criação da conta:</b><small href="" class="  ">   {{ $funcionario->created_at }} </small>


                            </div>

                    </div>
                    </div>
                    {{-- <div class="row rounded p-3 mt-4 border-5 border-success shadow border-top">
                        <div class="col-12 text-start">

                            <br>
                            <strong><h6>SOBRE</h6></strong>

                            <br><br>

                            <div class="text-start">

                                <b><i class="fa fa-book"></i> Formação</b> <br>
                                <small class="text-justify" >
                                    Lorem ipsum dolor, sit amet consectetur sit amet consectetur sit amet consectetur adipisicing elit.
                                </small>
                                <br>
                                <hr>
                            </div>
                            <div class="text-start">

                                <b><i class="fa fa-book"></i> Localização</b> <br>
                                <small class="text-justify" >
                                    Lorem ipsum dolor, sit amet consectetur sit amet consectetur sit amet consectetur adipisicing elit.
                                </small>
                                <br>
                                <hr>
                            </div>
                            <div class="text-start">

                                <b><i class="fa fa-book"></i> Ligação com a GESTDOC</b> <br>
                                <small class="text-justify" >
                                    Lorem ipsum dolor, sit amet consectetur sit amet consectetur sit amet consectetur adipisicing elit.
                                </small>
                                <br>
                                <hr>
                            </div>
                            <div class="text-start">

                                <b><i class="fa fa-book"></i> Habilidades</b> <br>
                                <small class="text-justify" >
                                    Lorem ipsum dolor, sit amet consectetur sit amet consectetur sit amet consectetur adipisicing elit.
                                </small>
                                <br>
                                <hr>
                            </div>
                    </div>
                    </div> --}}
                </div>
                <div class="col-7 offset-1">
                    <div class="row rounded p-3 border-5 border-success shadow border-top">
                        <ul class="nav nav-tabs" id="myTab" role="tablist">
                            <li class="nav-item" role="presentation">
                            <a class="nav-link active" id="home-tab" data-bs-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Dashboard</a>
                            </li>
                            <li class="nav-item" role="presentation">
                            <a class="nav-link" id="profile-tab" data-bs-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Pendentes</a>
                            </li>
                            <li class="nav-item" role="presentation">
                            <a class="nav-link" id="contact-tab" data-bs-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Produtividade</a>
                            </li>
                            <li class="nav-item" role="presentation">
                                <a class="nav-link" id="permissoes-tab" data-bs-toggle="tab" href="#permissoes" role="tab" aria-controls="permissoes" aria-selected="false">Permissões</a>
                            </li>
                        </ul>
                        <div class="tab-content" id="myTabContent">
                            <div class="tab-pane fade show active pt-5 text-justify" id="home" role="tabpanel" aria-labelledby="home-tab">

                                Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore commodi voluptatum labore! Quos veniam sunt facere dolorum maiores, nesciunt animi suscipit magnam ea quasi voluptate, sed aliquid ratione? Neque, obcaecati.
                                lotem
                            </div>
                            <div class="tab-pane fade pt-5 text-justify" id="profile" role="tabpanel" aria-labelledby="profile-tab">

                                Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore commodi voluptatum labore! Quos veniam sunt facere dolorum maiores, nesciunt animi suscipit magnam ea quasi voluptate, sed aliquid ratione? Neque, obcaecati.
                                lotem
                            </div>
                            <div class="tab-pane fade pt-5 text-justify" id="contact" role="tabpanel" aria-labelledby="contact-tab">

                                Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore commodi voluptatum labore! Quos veniam sunt facere dolorum maiores, nesciunt animi suscipit magnam ea quasi voluptate, sed aliquid ratione? Neque, obcaecati.
                                lotem
                            </div>
                            <div class="tab-pane fade pt-5 text-justify" id="permissoes" role="tabpanel" aria-labelledby="permissoes-tab">

                                <nav class="d-none">

                                    {{ $sector=$funcionario->getSector }}
                                    <br> Categoria <br>
                                    {{ $categoria=$funcionario->getCategoria }}
                                    {{ $i=0 }}
                                    <br>Permissoes <br>
                                    {{ $permissoes=\App\Models\Permissao::where('sector_id',$sector->id)->where('categoria_id',$categoria->id)->orderBy('permissao','Asc')->get() }}
                                </nav>
                                <ul class="list-group shadow">
                                    <li class="list-group-item bg-success text-white " aria-current="true"><h6>Permissões</h6></li>
                                    @foreach ($permissoes as $permissao)
                                        <nav class="d-none">
                                            {{ $i++}}

                                        </nav>

                                        <li class="list-group-item"> <label class="float-start">{{ $i }}</label>&nbsp;&nbsp;&nbsp;&nbsp; {{ $permissao->permissao }} <i class=" text-success fa fa-check float-end"></i></li>

                                    @endforeach

                                </ul>
                            </div>
                            <br><br><br><br>
                        </div>

                    </div>
                </div>
            </div>

        </nav>
    </div>

    <nav class="container p-4">
        <nav class="row">
            <nav class="col-12 bg-danger text-white rounded text-center shadow  border-3 border-warning border p-4">
                <h1>Zona perigosa</h1>
                <br> <hr> <br><br><br>
                <a href="{{ route('us.admin.funcionario.editar_foto',$funcionario->id) }}" class="btn btn-outline-warning w-25 btn-sm"><i class="fa fa-user"></i> Editar Foto</a>
                <a href="{{ route('us.admin.funcionario.editar_dados_gerais',$funcionario->id) }}" class="btn btn-outline-warning w-25 btn-sm"><i class="fa fa-list"></i> Editar dados gerais</a>
                <a href="{{ route('us.admin.funcionario.editar_outros_dados',$funcionario->id) }}" class="btn btn-outline-warning w-25 btn-sm"><i class="fa fa-cog"></i> DNZ</a>
                <a href="{{ route('us.admin.funcionario.ass.funcionarios', ['id' => $usuario->id, 'pagevar' => 'todos']) }}" class="btn btn-outline-warning w-25 btn-sm"><i class="fa fa-lock"></i> Acessos</a>
                <a href="{{ route('us.admin.funcionario.devices.funcionarios',$usuario->id) }}" class="btn btn-outline-warning w-25 btn-sm"><i class="fa fa-laptop"></i> Dispositivos</a>
                {{-- <a href="{{ route('us.admin.funcionario.editar_outros_dados',$funcionario->id) }}" class="btn btn-outline-warning w-25 btn-sm">Editar outros dados</a> --}}
                <a href="{{ route('us.admin.funcionario.editar_password',$funcionario->id) }}" class="btn btn-outline-warning w-25 btn-sm"><i class="fa fa-user-secret"></i> Editar password</a>

                <br><br><br><br>
            </nav>
        </nav>
    </nav>

@endsection
