@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" />
<style type="text/css">
    #example1{
        border-color: red;
        
    }
    .myspandanger
    {
        color:red;
    }
</style>


@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>
                Pedidos e Consultas<br>
                <i>Pedidos Recebidos - <span class="myspandanger">Destruição</span></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 Cliente</th>
                                    <th>Categoria</th>
                                    <th>Empresa</th>
                                    <th>Data_Envio</th>
                                    <th>Estado</th>
                                    <th>Auto destruição</th>
                                  
                                  </tr>
                                  </thead>
                                  <tbody>
                                    @foreach ($dados as $dado)
                                    
                                    <tr> 
                                        <td>{{$i++}}</td>
                                        <td>{{$dado->nome}}</td>
                                        <td>{{$dado->categoria}}</td>
                                @php $meu_nome=\App\Models\Cliente::find($dado->cliente_id)->trazerPessoa; @endphp
                                        <td>{{$meu_nome->nome}}</td>
                                        {{-- <td>{{$dado->tema}}</td> --}}
                                        <td>{{$dado->created_at}}</td>
                                        <td>Espera</td>
                                    <td>


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

                                        <form action="{{route('us.pedidosconsulta.confpedidosconsulta.pedidos.fisicos.new.create')}}">
                                            @csrf
                                         
                                            <input value="{{$decrypted}}" name="solicitacao_id" hidden/>
                                            <button type="submit" class="btn btn-sm btn-outline-danger btnSelecionarReserva"> <i class="fa fa-cog "></i> criar</button>
                                            
                                        </form>
                                    </td>
                                    

                                    </tr>
                                    @endforeach
                                    </tbody>
                                </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
