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

@section('conteudo')
<br>
<nav class="   " 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-end">
        <li class="breadcrumb-item"> <a href=""> Usuário</a> </li>
        <li class="breadcrumb-item "  ><a href=""> Administrador</a></li>
        <li class="breadcrumb-item " ><a href=""> Dispositivos</a></li>
        <li class="breadcrumb-item active" aria-current="page">Todos</li>
    </ol>
</nav>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>Usuários</h1>
          </div>

        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class=" ">
        <nav class="d-none ">
            {{ $dispositivos=\App\Models\Dispositivo::select('user_id')->distinct()->get() }}
            {{-- {{ $acessos=\App\Models\Acesso::select('user_id')->distinct()->get() }} --}}

        </nav>
      <!-- Default box -->
      <div class="card  ">
        <div class="card-body pb-0">
          <div class="row d-flex align-items-stretch p-3">
            @foreach ($dispositivos as $dispositivo)

            <nav class="d-none ">
                {{ $usuarios=\App\Models\User::where('id',$dispositivo->user_id)->first() }}

            </nav>

            <div class="col-12 col-sm-6 col-md-4 d-flex align-items-stretch">
                <div class="card bg-light">
                  <div class="card-header text-muted border-bottom-0">
                    Acessos deste usuário
                  </div>
                  <div class="card-body pt-0">
                    <div class="row">
                      <div class="col-7">
                        <h2 class="lead"><b>{{ $usuarios->name }}</b></h2>
                        <p class="text-muted text-sm"><b>Sobre: </b> Técnico indexador / Serviços externos </p>
                        <ul class="ml-4 mb-0 fa-ul text-muted">
                          <li class="small"><span class="fa-li"><i class="fa fa-lg fa-building"></i></span> Endereço: Demo Street 123, Demo City 04312, NJ</li>
                          <li class="small"><span class="fa-li"><i class="fa fa-lg fa-phone"></i></span> Telemóvel #: + 800 - 12 12 23 52</li>
                        </ul>
                      </div>
                      <div class="col-5 text-center">
                        <img src="{{ asset('img/user.jpg') }}" alt="user-avatar" class="img-circle img-fluid">
                      </div>
                    </div>
                  </div>
                  <div class="card-footer">
                    <div class="text-right">
                      <a href="#" class="btn btn-sm btn-primary" title="Chat">
                        <i class="fa fa-comments"></i>
                      </a>
                      <a href="#" class="btn btn-sm btn-primary" title="Perfil">
                        <i class="fa fa-user"></i>
                      </a>

                      <a href="{{ route('us.admin.funcionario.disp',$usuarios->id ) }}" class="btn btn-sm btn-primary" title="Dispositivos">
                        <i class="fa fa-laptop"></i>
                      </a>

                      <a href="#" class="btn btn-sm btn-primary" title="Acessos">
                        <i class="fa fa-lock"></i>
                      </a>
                    </div>
                  </div>
                </div>
              </div>
              @endforeach
          </div>
        </div>
        <!-- /.card-body -->
        <div class="card-footer">
          {{-- <nav aria-label="Contacts Page Navigation">
            <ul class="pagination justify-content-center m-0">
              <li class="page-item active"><a class="page-link" href="#">1</a></li>
              <li class="page-item"><a class="page-link" href="#">2</a></li>
              <li class="page-item"><a class="page-link" href="#">3</a></li>
              <li class="page-item"><a class="page-link" href="#">4</a></li>
              <li class="page-item"><a class="page-link" href="#">5</a></li>
              <li class="page-item"><a class="page-link" href="#">6</a></li>
              <li class="page-item"><a class="page-link" href="#">7</a></li>
              <li class="page-item"><a class="page-link" href="#">8</a></li>
            </ul>
          </nav> --}}
        </div>
        <!-- /.card-footer -->
      </div>
      <!-- /.card -->

    </section>
    <!-- /.content -->
  </div>
@endsection
