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

@push('mycss')
<script src="{{asset('js/jquery.dataTables.min.js') }}"></script>
<link href="{{url('css/alertaTemporario.css')}}" rel="stylesheet" />
@endpush

<nav class="container animate__animated animate__zoomInDown">
@php $i=1; @endphp
    <div class="row">
        <nav class="12">
            <br>
            <h4>
                <i class="fa fa-hourglass-half"></i>
                Lista de Clientes Usuários<br>
                <i></i>
            </h4>
            <br>
                <hr>
        </nav>
        </div>
            <div class="table-responsive">
                <div class="container">
                  <div class="list-group">
                      <nav class="col-12 table-responsive">
                         <table id="example1" class="table container  table-striped table-hover">
                              <thead>
                                  <tr class="">
                                   <th>#</th>
                                   <th>Nome completo</th>
                                   <th>numero</th>
                                    <th>Categoria</th>
                                    <th>Empresa</th>
                                    <th>Telefone</th>
                                    <th>Verr_Mais</th>
                                  
                                  </tr>
                                  </thead>
                                  @if(isset($funcionario_Clientes))
                                  <tbody>
                                    @foreach ($funcionario_Clientes as $dado)
                                    
                                    <tr> 
                                        <td>{{$i++}}</td>
                                        <td>{{$dado->nome}}</td>
                                        <td>{{$dado->numerofuncionariocliente}}</td>
                                        {{-- @php $minha_categoria=\App\Models\CategoriaCliente::where('id',$dado->categoria_id)->first(); @endphp --}}
                                        <td>{{$dado->categoriacliente}}</td>
                                        @php $meu_nome=\App\Models\Cliente::find($dado->cliente_id)->getUser->getPessoa; @endphp
                                        <td>{{$meu_nome->nome}}</td>
                                        <td>{{$dado->telefone}}</td>
                                    <td>


                                        @php 
                                        //use Illuminate\Support\Facades\Crypt;
                                      
                                        try {
                                             
                                        $decrypted =Crypt::encryptString($dado->id);
                                         
                                        } catch (DecryptException $e) {
                                            $decrypted=0;
                                        }
                                    @endphp

                                        <form action="{{ route('us.admin.cliente.funcionarios.edit.clientes.funcionarios') }}" method="post">
                                            @csrf
                                         
                                            <input value="{{$decrypted}}" name="solicitacao_id" hidden/>
                                            <button type="submit" class="btn btn-sm btn-outline-primary btnSelecionarReserva"> <i class="fa fa-cog "></i> ver</button>
                                            
                                        </form>
                                    </td>
                                    

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


    
</nav>


<script src="{{url('js/msgSucessss.js')}}"></script>
<script>
 
    $(function () {
        $("#example1").DataTable();
        $('#example2').DataTable({
            "paging": true,
            "lengthChange": false,
            "searching": false,
            "ordering": true,
            "info": true,
            "autoWidth": false,
        });
    });
    </script>

    <script>
            $(function () {
                $("#tabela").DataTable();
                $('#example2').DataTable({
                    "paging": true,
                    "lengthChange": false,
                    "searching": false,
                    "ordering": true,
                    "info": true,
                    "autoWidth": false,
                });
            });
    </script>

@endsection
