@extends('usuarios.funcionarios.admin.usuarios.template')

@section('usuarioDestaqueSection')
<label  >
GERIR ACESSOS
</label >
<br> <br>
<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">Pedidos</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">Liberados</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">Barrados</a>
        </li>

        {{--
        <li class="nav-item" role="presentation">
            <a class="nav-link" id="contact-tab" data-bs-toggle="tab" href="#pendentes" role="tab" aria-controls="pendentes" aria-selected="false">Pendentes</a>
          </li>
            <li class="nav-item" role="presentation">
            <a class="nav-link" id="solicitados-tab" data-bs-toggle="tab" href="#solicitados" role="tab" aria-controls="solicitados" aria-selected="false">Pedidos</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">
            PEDIDOS
            <nav class="w-100 d-none overflow-auto">

                {{ $idUser }}
                {{ $devices=\App\Models\Dispositivo::where('user_id',$idUser)->where('estado','solicitado')->get()}}
                {{ $i=1 }}
            </nav>
            {{--
            ,"latitude":"-8.83682","longitude":"13.2343","browser":"Chrome",
            "versaoBrowser":"87.0.4280.141","plataform":"Windows",
            "versaoPlataform":"10.0","device":"WebKit",
            "robot":"0","ip":"154.127.212.219",
            "mac":"6C-62-6D-C8-42-EA
            \\Device\\Tcpip_{DF137857-DF6F-443A-A5E8-74F6A2762D8E}","estado":"null",
            "user_id":1,"created_at":"2021-01-22T15:25:37.000000Z",
            "updated_at":"2021-01-22T15:25:37.000000Z"}, --}}
            <hr>
            <nav class="table-responsive">
                <table class="table table-hover table-success p-2 rounded">
                    <thead>
                      <tr>
                        <th scope="col">#</th>
                        <th scope="col">País</th>
                        <th scope="col">Província</th>
                        <th scope="col">Navegador</th>
                        <th scope="col">Versão</th>
                        <th scope="col">Renderizador</th>
                        <th scope="col">SO</th>
                        <th scope="col">IP</th>
                        <th scope="col">Cadastrado</th>
                        <th scope="col">Solicitado</th>
                        <th scope="col">Acção</th>
                      </tr>
                    </thead>
                    <tbody>
                        @foreach($devices as $device )
                            <tr>
                                <th scope="row">{{ $i++ }}</th>
                                <td>{{ $device->countryName }}</td>
                                <td>{{ $device->cityName }}</td>
                                <td>{{ $device->browser }}</td>
                                <td>{{ $device->versaoBrowser }}</td>
                                <td>{{ $device->device }}</td>
                                <td>{{ $device->plataform }}</td>
                                <td>{{ $device->ip }}</td>
                                <td>{{ $device->created_at }}</td>
                                <td>{{ $device->updated_at }}</td>
                                <td>
                                    <form action="post">
                                        <a href="" class="btn btn-outline-success"><i class="fa fa-check"></i>Liberar</a>
                                        <input type="hidden" name="" class="idDevice" value="{{ $device->id }}">
                                    </form>
                                    <form action="post">
                                        <a href="" class="mt-2 btn btn-outline-info"><i class="fa fa-eye"></i><br>  Ver acessos</a>
                                        <input type="hidden" name="" class="idDevice" value="{{ $device->id }}">
                                    </form>
                                </td>

                            </tr>
                        @endforeach
                    </tbody>
                  </table>
            </nav>
        </div>
        <div class="tab-pane fade pt-5 text-justify" id="profile" role="tabpanel" aria-labelledby="profile-tab">

            LIBERADOS
            <hr>
            <nav class="w-100 d-none overflow-auto">

                {{ $idUser }}
                {{ $devices=\App\Models\Dispositivo::where('user_id',$idUser)->where('estado','permitido')->get()}}
                {{ $i=1 }}
            </nav>
            {{--
            ,"latitude":"-8.83682","longitude":"13.2343","browser":"Chrome",
            "versaoBrowser":"87.0.4280.141","plataform":"Windows",
            "versaoPlataform":"10.0","device":"WebKit",
            "robot":"0","ip":"154.127.212.219",
            "mac":"6C-62-6D-C8-42-EA
            \\Device\\Tcpip_{DF137857-DF6F-443A-A5E8-74F6A2762D8E}","estado":"null",
            "user_id":1,"created_at":"2021-01-22T15:25:37.000000Z",
            "updated_at":"2021-01-22T15:25:37.000000Z"}, --}}

            <nav class="table-responsive">
                <table class="table table-hover table-success p-2 rounded">
                    <thead>
                      <tr>
                        <th scope="col">#</th>
                        <th scope="col">País</th>
                        <th scope="col">Província</th>
                        <th scope="col">Navegador</th>
                        <th scope="col">Versão</th>
                        <th scope="col">Renderizador</th>
                        <th scope="col">SO</th>
                        <th scope="col">IP</th>
                        <th scope="col">Cadastrado</th>
                        <th scope="col">Solicitado</th>
                        <th scope="col">Acção</th>
                      </tr>
                    </thead>
                    <tbody>
                        @foreach($devices as $device )
                            <tr>
                                <th scope="row">{{ $i++ }}</th>
                                <td>{{ $device->countryName }}</td>
                                <td>{{ $device->cityName }}</td>
                                <td>{{ $device->browser }}</td>
                                <td>{{ $device->versaoBrowser }}</td>
                                <td>{{ $device->device }}</td>
                                <td>{{ $device->plataform }}</td>
                                <td>{{ $device->ip }}</td>
                                <td>{{ $device->created_at }}</td>
                                <td>{{ $device->updated_at }}</td>
                                <td>
                                    <form action="post">
                                        <a href="" class="btn btn-outline-danger"><i class="fa fa-user-slash"></i>Barrar</a>
                                        <input type="hidden" name="" class="idDevice" value="{{ $device->id }}">
                                    </form>
                                    <form action="post">
                                        <a href="" class="mt-2 btn btn-outline-info"><i class="fa fa-eye"></i><br>  Ver acessos</a>
                                        <input type="hidden" name="" class="idDevice" value="{{ $device->id }}">
                                    </form>
                                </td>

                            </tr>
                        @endforeach
                    </tbody>
                  </table>
            </nav>
        </div>
        <div class="tab-pane fade pt-5 text-justify" id="contact" role="tabpanel" aria-labelledby="contact-tab">

            BARRADOS
            <hr>
            <nav class="w-100 d-none overflow-auto">

                {{ $idUser }}
                {{ $devices=\App\Models\Dispositivo::where('user_id',$idUser)->where('estado','barrado')->get()}}
                {{ $i=1 }}
            </nav>
            {{--
            ,"latitude":"-8.83682","longitude":"13.2343","browser":"Chrome",
            "versaoBrowser":"87.0.4280.141","plataform":"Windows",
            "versaoPlataform":"10.0","device":"WebKit",
            "robot":"0","ip":"154.127.212.219",
            "mac":"6C-62-6D-C8-42-EA
            \\Device\\Tcpip_{DF137857-DF6F-443A-A5E8-74F6A2762D8E}","estado":"null",
            "user_id":1,"created_at":"2021-01-22T15:25:37.000000Z",
            "updated_at":"2021-01-22T15:25:37.000000Z"}, --}}

            <nav class="table-responsive">
                <table class="table table-hover table-success p-2 rounded">
                    <thead>
                      <tr>
                        <th scope="col">#</th>
                        <th scope="col">País</th>
                        <th scope="col">Província</th>
                        <th scope="col">Navegador</th>
                        <th scope="col">Versão</th>
                        <th scope="col">Renderizador</th>
                        <th scope="col">SO</th>
                        <th scope="col">IP</th>
                        <th scope="col">Cadastrado</th>
                        <th scope="col">Solicitado</th>
                        <th scope="col">Acção</th>
                      </tr>
                    </thead>
                    <tbody>
                        @foreach($devices as $device )
                            <tr>
                                <th scope="row">{{ $i++ }}</th>
                                <td>{{ $device->countryName }}</td>
                                <td>{{ $device->cityName }}</td>
                                <td>{{ $device->browser }}</td>
                                <td>{{ $device->versaoBrowser }}</td>
                                <td>{{ $device->device }}</td>
                                <td>{{ $device->plataform }}</td>
                                <td>{{ $device->ip }}</td>
                                <td>{{ $device->created_at }}</td>
                                <td>{{ $device->updated_at }}</td>
                                <td>
                                    <form action="post">
                                        <a href="" class="btn btn-outline-warning">Liberar</a>
                                        <input type="hidden" name="" class="idDevice" value="{{ $device->id }}">
                                    </form>

                                </td>

                            </tr>
                        @endforeach
                    </tbody>
                  </table>
            </nav>
        </div>

        <div class="tab-pane fade pt-5 text-justify" id="pendentes" role="tabpanel" aria-labelledby="pendentes-tab">
            PENDENTES
            <hr>
            <nav class="w-100 d-none overflow-auto">

                {{ $idUser }}
                {{ $devices=\App\Models\Dispositivo::where('user_id',$idUser)->where('estado','permitido')->get()}}
                {{ $i=1 }}
            </nav>
            {{--
            ,"latitude":"-8.83682","longitude":"13.2343","browser":"Chrome",
            "versaoBrowser":"87.0.4280.141","plataform":"Windows",
            "versaoPlataform":"10.0","device":"WebKit",
            "robot":"0","ip":"154.127.212.219",
            "mac":"6C-62-6D-C8-42-EA
            \\Device\\Tcpip_{DF137857-DF6F-443A-A5E8-74F6A2762D8E}","estado":"null",
            "user_id":1,"created_at":"2021-01-22T15:25:37.000000Z",
            "updated_at":"2021-01-22T15:25:37.000000Z"}, --}}

            <nav class="table-responsive">
                <table class="table table-hover table-success p-2 rounded">
                    <thead>
                      <tr>
                        <th scope="col">#</th>
                        <th scope="col">País</th>
                        <th scope="col">Província</th>
                        <th scope="col">Navegador</th>
                        <th scope="col">Versão</th>
                        <th scope="col">Renderizador</th>
                        <th scope="col">SO</th>
                        <th scope="col">IP</th>
                        <th scope="col">Cadastrado</th>
                        <th scope="col">Solicitado</th>
                        <th scope="col">Acção</th>
                      </tr>
                    </thead>
                    <tbody>
                        @foreach($devices as $device )
                            <tr>
                                <th scope="row">{{ $i++ }}</th>
                                <td>{{ $device->countryName }}</td>
                                <td>{{ $device->cityName }}</td>
                                <td>{{ $device->browser }}</td>
                                <td>{{ $device->versaoBrowser }}</td>
                                <td>{{ $device->device }}</td>
                                <td>{{ $device->plataform }}</td>
                                <td>{{ $device->ip }}</td>
                                <td>{{ $device->created_at }}</td>
                                <td>{{ $device->updated_at }}</td>
                                <td>
                                    <form action="post">
                                        <a href="" class="btn btn-outline-danger"><i class="fa fa-user-slash"></i> Barrar</a>
                                        <input type="hidden" name="" class="idDevice" value="{{ $device->id }}">
                                    </form>
                                    <form action="post">
                                        <a href="" class="mt-2 btn btn-outline-info"><i class="fa fa-eye"></i><br>  Ver acessos</a>
                                        <input type="hidden" name="" class="idDevice" value="{{ $device->id }}">
                                    </form>
                                </td>

                            </tr>
                        @endforeach
                    </tbody>
                  </table>
            </nav>
        </div>

        <div class="tab-pane fade pt-5 text-justify" id="solicitados" role="tabpanel" aria-labelledby="solicitados-tab">

            PEDIDOS
            <hr>
            <nav class="table-responsive">
                <table class="table table-hover">
                    <thead>
                      <tr>
                        <th scope="col">#</th>
                        <th scope="col">First</th>
                        <th scope="col">Last</th>
                        <th scope="col">Handle</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <th scope="row">1</th>
                        <td>Mark</td>
                        <td>Otto</td>
                        <td>@mdo</td>
                      </tr>
                      <tr>
                        <th scope="row">2</th>
                        <td>Jacob</td>
                        <td>Thornton</td>
                        <td>@fat</td>
                      </tr>
                      <tr>
                        <th scope="row">3</th>
                        <td colspan="2">Larry the Bird</td>
                        <td>@twitter</td>
                      </tr>
                    </tbody>
                  </table>
            </nav>
        </div>
      </div>

</div>

@endsection
