    @extends('usuarios.clientes.master.layoutcliente')

    @section('conteudo')
    <style type="text/css">
        .flex
            {
            min-width: 100%;
            }
    </style>
    {{-- SELECT STYLE --}}

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
    <script src="{{asset('js/jquery.dataTables.min.js') }}"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">


                        <div class="container-fluid">
                            <div class="page-header">
                                <div class="row align-items-end">
                                    <div class="col-lg-8">
                                        <div class="page-header-title">
                                            <i class="ik ik-file-text bg-blue"></i>
                                            <div class="d-inline">
                                                <h5>Detalhes da Solicitação já Tratada</h5>
                                                
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-lg-4">
                                        <nav class="breadcrumb-container" aria-label="breadcrumb">
                                            <ol class="breadcrumb">
                                                <li class="breadcrumb-item">
                                                    <a href="../index.html"><i class="ik ik-home"></i></a>
                                                </li>
                                                <li class="breadcrumb-item">
                                                    <a href="#">Home</a>
                                                </li>
                                                <li class="breadcrumb-item active" aria-current="page">tratada</li>
                                            </ol>
                                        </nav>
                                    </div>
                                </div>
                            </div>
                            @if(isset($dados))
                              @if( !(empty($dados)) )
                                <div class="card">
                                      @php    
                                               
                                                $minha_solicitacao=\App\Models\Solicitacao::where('id',$dados->solicitacao_id)->first(); 
                                                $meu_nome=App\Models\Cliente::find($dados->cliente_id)->getUser->getPessoa; 
                                                $socitei=\App\Models\User::find($dados->autor_id)->getPessoa;
                                      @endphp
                                    
                                    
                                    <div class="card-header bg-blue"><h3 class="d-block w-100">Auto Nº:{{$dados->numeroauto}}, {{$meu_nome->nome}}
                                                                            <small class="float-right">Data de Envio: {{$dados->created_at}}</small></h3></div>
                                    <div class="card-body">
                                        <div class="row invoice-info">
                                            <div class="col-sm-6 invoice-col">
                                                
                                                <address>
                                                    
                                                    <h5><b>Solicitado Por:</b> {{$dados->nome}}<strong></strong></h5>
                                                    <h5><b>Categoria:</b> {{$minha_solicitacao->categoriacliente}}<strong></strong></h5>
                                                    <h5><b>Assunto:</b> {{$minha_solicitacao->assuntosolicitacao}}<strong></strong></h5>
                                                    <h6><b>Natureza da Solicitacão:</b></b>{{$minha_solicitacao->naturezasolicitacao}}<strong></strong></h6>
                                                    <h6><b>Tempo Médio de espera:</b> <span style="color:red;">processando</span>...</h6>
                                                    <h6><b>Tratado por:</b> {{$socitei->nome}}<strong></strong></h6>
                                                </address>
                                            </div>
                                            <div class="col-sm-6 invoice-col">
                                                <h6>
                                                    <b>Tipo Documentação:</b> {{$minha_solicitacao->tipodocumentosolicitacao}}<br></h6>
                                                    @if($minha_solicitacao->naturezasolcitacao === "virtual")
                                                    <h6> <b>Local da descarga:</b> {{$dados->localdescarga}}<br></h6>
                                                    <h6> <b>Forma de expedição/Matricula:</b> {{$dados->formaexpedicao}} - {{$dados->matriculaveiuclo}}<br></h6>
                                                    <h6> <b>Hora de chegada:</b> {{$dados->horasaida}}<br></h6>
                                                    @endif
                                                    <h6>Nota: {{$dados->nota}}</h6>   
                                                    <h6><b>Detalhes</b></h6> 
                                                        <textarea class="form-control" style="width:500px;height:150px;" >{{$dados->detalhesauto}}</textarea>
                                                
                                            </div>
                                        </div>
    
                                      
                                        @php $meu_comprovativo=\App\Models\ComprovativoSolicitacao::join('solicitacaos','solicitacaos.id','comprovativosolicitacaos.solicitacao_id')
                                                                                                  ->where('solicitacaos.id',$dados->id)->get();
                                                                                         //dd($dados->id);
                                        @endphp
                                        
                                        @if( !($meu_comprovativo->isEmpty()) )
                                        <div class="row">
                                            <div class="col-12">
                                                <br><br><br>
                                                <h4 class="text-center" ><b>Comprovativo de Solicitação</b></h4>
                                                  <div class="row">
                                                          @foreach($meu_comprovativo as $compro)
                                                      <div class="col-12 list-item">
                                                                <div class="card d-flex flex-row mb-3">
                                                                    <a class="d-flex card-img" href="#editLayoutItem" data-toggle="modal" data-target="#editLayoutItem">
                                                                        <img src="{{asset('img/foto.jpg')}}" alt=",iha foto comprovativo" class="list-thumbnail responsive border-0">
                                                                        <span class="badge badge-pill badge-primary position-absolute badge-top-left">New</span>
                                                                        <span class="badge badge-pill badge-secondary position-absolute badge-top-left-2">Trending</span>
                                                                    </a>
                                                                    <div class="d-flex flex-grow-1 min-width-zero card-content">
                                                                        <div class="card-body align-self-center d-flex flex-column flex-lg-row justify-content-between min-width-zero align-items-lg-center">
                                                                            <a href="#editLayoutItem" data-toggle="modal" data-target="#editLayoutItem" class="w-40 w-sm-100">
                                                                                <p class="list-item-heading mb-1 truncate">{{$compro->nomecomprovativo}}</p>
                                                                            </a>
                                                                            <p class="mb-1 text-muted text-small category w-15 w-sm-100">{{$compro->tamanhocomprovativo}}</p>
                                                                            <p class="mb-1 text-muted text-small date  w-15 w-sm-100">{{$compro->created_at}}</p>
                                                                            {{---<div class="w-15 w-sm-100">
                                                                                <span class="badge badge-pill badge-secondary">On Hold</span>
                                                                            </div>
                                                                        </div>
                                                                        <div class="list-actions">
                                                                            <a href="#editLayoutItem" data-toggle="modal" data-target="#editLayoutItem"><i class="ik ik-eye"></i></a>
                                                                            <a href="layout-edit-item.html"><i class="ik ik-edit-2"></i></a>
                                                                            <a href="#" class="list-delete"><i class="ik ik-trash-2"></i></a>
                                                                        </div>----}}
                                                                        <div class="custom-control custom-checkbox pl-1 align-self-center">
                                                                            <label class="custom-control custom-checkbox mb-0">
                                                                                <input type="checkbox" class="custom-control-input">
                                                                                <span class="custom-control-label"></span>
                                                                            </label>
                                                                        </div>
                                                                        
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            @endforeach
                                                </div>
    
                                            </div>
                                           
                                        </div>
                                        
                                        @endif
                                        
                                        
                                        @if( !($meu_comprovativo->isEmpty()) )
                                        <div class="row">
                                            <div class="col-12">
                                                <br><br><br>
                                                <h4 class="text-center" ><b>Ficheiros Partilhados</b></h4>
                                                  <div class="row">
                                                          @foreach($meu_comprovativo as $compro)
                                                      <div class="col-12 list-item">
                                                                <div class="card d-flex flex-row mb-3">
                                                                    <a class="d-flex card-img" href="#editLayoutItem" data-toggle="modal" data-target="#editLayoutItem">
                                                                        <img src="{{asset('img/foto.jpg')}}" alt=",iha foto comprovativo" class="list-thumbnail responsive border-0">
                                                                        <span class="badge badge-pill badge-primary position-absolute badge-top-left">New</span>
                                                                        <span class="badge badge-pill badge-secondary position-absolute badge-top-left-2">Trending</span>
                                                                    </a>
                                                                    <div class="d-flex flex-grow-1 min-width-zero card-content">
                                                                        <div class="card-body align-self-center d-flex flex-column flex-lg-row justify-content-between min-width-zero align-items-lg-center">
                                                                            <a href="#editLayoutItem" data-toggle="modal" data-target="#editLayoutItem" class="w-40 w-sm-100">
                                                                                <p class="list-item-heading mb-1 truncate">{{$compro->nomecomprovativo}}</p>
                                                                            </a>
                                                                            <p class="mb-1 text-muted text-small category w-15 w-sm-100">{{$compro->tamanhocomprovativo}}</p>
                                                                            <p class="mb-1 text-muted text-small date  w-15 w-sm-100">{{$compro->created_at}}</p>
                                                                            {{---<div class="w-15 w-sm-100">
                                                                                <span class="badge badge-pill badge-secondary">On Hold</span>
                                                                            </div>
                                                                        </div>
                                                                        <div class="list-actions">
                                                                            <a href="#editLayoutItem" data-toggle="modal" data-target="#editLayoutItem"><i class="ik ik-eye"></i></a>
                                                                            <a href="layout-edit-item.html"><i class="ik ik-edit-2"></i></a>
                                                                            <a href="#" class="list-delete"><i class="ik ik-trash-2"></i></a>
                                                                        </div>----}}
                                                                        <div class="custom-control custom-checkbox pl-1 align-self-center">
                                                                            <label class="custom-control custom-checkbox mb-0">
                                                                                <input type="checkbox" class="custom-control-input">
                                                                                <span class="custom-control-label"></span>
                                                                            </label>
                                                                        </div>
                                                                        
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            @endforeach
                                                </div>
    
                                            </div>
                                           
                                        </div>
                                         @endif   
                                        
                                        {{----
                                        <div class="row no-print">
                                            <div class="col-12">
                                                <button type="button" class="btn btn-success pull-right"><i class="fa fa-credit-card"></i> Submit Payment</button>
                                                <button type="button" class="btn btn-primary pull-right" style="margin-right: 5px;"><i class="fa fa-download"></i> Generate PDF</button>
                                            </div>
                                        </div>----}}
                                    </div>
                                </div>
                                @else
                                <h1>Sem Dados</h1>
                                @endif
                            @else
                            <h1>Sem Dados</h1>
                            @endif
                        </div>

    @endsection