@extends('usuarios.funcionarios.digitalizacao.dashboard.master')
@section('conteudo')

<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<link href="{{asset('js/digitalizacao_plugins/css/plugins/dataTables/datatables.min.css" rel="stylesheet')}}">


<script src="{{asset('js/jquery.dataTables.min.js') }}"></script>
<link href="{{url('css/alertaTemporario.css')}}" rel="stylesheet" />
<link href="{{asset('js/digitalizacao_plugins/css/bootstrap.min.css')}}" rel="stylesheet">
<link href="{{asset('js/jquery.css/plugins/dataTables/datatables.min.css')}}" rel="stylesheet">


<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <br>
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a href="{{ route('us.digit.confdigi.index') }}">home</a>
            </li>
            <li class="breadcrumb-item">
                <a>Pesquisar por classe documental</a>
            </li>
            <li class="breadcrumb-item active">
                <strong>cliente</strong>
            </li>
        </ol>
    </div>
    <br>
    <br> <br>
    <div class="table-responsive">
        <div class="container">
          <div class="list-group">
              <nav class="col-12 table-responsive">
                <br> <br>
                <table class="table table-striped table-bordered table-hover dataTables-example" >
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>Cliente</th>
                        <th>numero cliente</th>
                        <th>Telefone</th>
                        <th>Ver_docs</th>
                    </tr>
                    </thead>
                    <tbody>


                        @php $clientes=\App\Models\Cliente::all();
                        $i=1; @endphp
                          @forelse ($clientes as $dado)

                          <tr>
                              <td>{{$i++}}</td>
                                  @php $clientes_dados=\App\Models\Cliente::find($dado->id)->getUser->getPessoa; @endphp

                              <td>{{$clientes_dados->nome}}</td>

                              <td>{{$dado->numerocliente}}</td>
                              <td>{{$clientes_dados->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.digit.confdigi.pesquisa.cliente.pesq.cascata2') }}" 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>
                          @empty

                          @endforelse


                    </tbody>
                    <tfoot>
                    <tr>
                        <th>Rendering engine</th>
                        <th>Browser</th>
                        <th>Platform(s)</th>
                        <th>Engine version</th>
                        <th>CSS grade</th>
                    </tr>
                    </tfoot>
            </table>
              </nav>
          </div>


        </div>


    </div>


    <br>
</div>
<br>




    <!-- Mainly scripts -->
    <script src="{{asset('js/digitalizacao_plugins/js/jquery-3.1.1.min.js')}}"></script>


<script src="{{asset('js/digitalizacao_plugins/js/plugins/dataTables/datatables.min.js')}}"></script>
<script src="{{asset('js/digitalizacao_plugins/js/plugins/dataTables/dataTables.bootstrap4.min.js')}}"></script>

<!-- Custom and plugin javascript -->
<script src="{{asset('js/digitalizacao_plugins/js/inspinia.js')}}"></script>
<script src="{{asset('js/digitalizacao_plugins/js/plugins/pace/pace.min.js')}}"></script>

<!-- Page-Level Scripts -->
<script>
    $(document).ready(function(){
        $('.dataTables-example').DataTable({
            pageLength: 25,
            responsive: true,
            dom: '<"html5buttons"B>lTfgitp',
            buttons: [
                { extend: 'copy'},
                {extend: 'csv'},
                {extend: 'excel', title: 'ExampleFile'},
                {extend: 'pdf', title: 'ExampleFile'},

                {extend: 'print',
                 customize: function (win){
                        $(win.document.body).addClass('white-bg');
                        $(win.document.body).css('font-size', '10px');

                        $(win.document.body).find('table')
                                .addClass('compact')
                                .css('font-size', 'inherit');
                }
                }
            ]

        });

    });

</script>


@endsection
