@extends('adminlte::page')

@section('title', 'Pesquisa de Titulos')

@section('content_header')
@endsection
@section('content')
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css"
        rel="stylesheet">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
    <div class="header_listagem small-box bg-gradient-success">
    </div>
    <div class="card card-outline card-success">
        <div class="card-header">
            <h3 class="card-title"><b>Listagem dos Títulos</b></h3>
        </div>
        <div class="card-body">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>MUNICÍPIO</th>
                        <th>PROPRIETÁRIO</th>
                        <th>LOTE</th>
                        <th>CPF</th>
                        <th>STATUS</th>
                        {{-- <th>DATA</th> --}}
                        {{-- <th>NÚMERO DO ATENDIMENTO</th> --}}
                        <th width="100">AÇÕES</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach ($pessoasLote as $pessoaLote)
                    <tr>
                        <td>{{ $pessoaLote->lote->municipio->nome }}</td>
                        <td>{{ $pessoaLote->pessoa->nome }}</td>
                        <td>{{ $pessoaLote->lote->numero }}</td>
                        <td>{{ $documentoPessoa->cpf }}</td>
                        <td>{{ $tramite->nome }}</td>
                        {{-- <td>{{ date('d/m/Y', strtotime($agendamentos->data)) }}</td> --}}
                        {{-- <td>{{ $agendamentos->id }}</td> --}}
                        <td><a
                            href="{{ route('titulos.show', $pessoaLote->lote->id) }}"
                            class="badge bg-green">DETALHES</a></td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
            <div class="container">
                <form method="post" action="{{ route('datepicker') }}" enctype="multipart/form-data">
                    @csrf
                    <div class="row">
                        <div class="col-md-4"></div>
                        <div class="form-group col-md-4">
                            <strong>DATA : </strong>
                            <input class="text form-control" type="text" id="datepicker" name="data">
                            <input class="text form-control" type="text" id="datepicker1" name="detentor" value="{{ $pessoaLote->pessoa->nome }}">
                            <input class="date form-control" type="text" id="datepicker1" name="cpf" value="{{ $documentoPessoa->cpf }}">
                            {{-- <input class="boolean form-control" id="datepicker1" name="agendado" value="true"> --}}
                            <button type="submit" class="btn btn-success" class="badge bg-green">AGENDAR</a></button>
                        </div>
                    </div>
                </form>
            </div>
            {{-- <form action="{{ route('dadosAtendimento') }}" enctype="multipart/form-data">
                <button type="submit" class="btn btn-success" class="badge bg-green">DADOS ATENDIMENTO</a></button>
            </form> --}}
            <script type="text/javascript">
                $('#datepicker').datepicker({
                    autoclose: true,
                    format: 'dd/mm/yyyy'
                });
                $('#datepicker1').datepicker({
                    autoclose: true,
                });
            </script>
        </div>
    </div>
@endsection
