@extends('layouts.app')

@section('content')
<div class="container mt-4">
    <div class="container">
        <h2 class="display-4">Resultado da Busca</h2>
        <div class="row mb-4 ml-1">
            <div class="card mr-4"><div class="card-header alert-primary">Total de Leads: </div><div class="card-body"> <?php echo count($leads) ?></div></div>
            <div class="card mr-4"><div class="card-header alert-primary">Consultor: </div><div class="card-body"> {{ $consultor ?? "Todos"}}</div></div>
            <div class="card mr-4"><div class="card-header alert-primary">Status: </div><div class="card-body"> {{ $status ?? "Todos" }}</div></div>
            <div class="card mr-4"><div class="card-header alert-primary">Marca: </div><div class="card-body"> {{ $marca ?? "Todas" }}</div></div>
            <div class="card mr-4"><div class="card-header alert-primary">Período: </div><div class="card-body"> {{ $periodo ?? "Todos" }}</div></div>

          </div>
        <a class="btn btn-secondary mb-4" href="javascript: history.go(-1);"><i class="fas fa-arrow-left"></i> Voltar</a>
        <hr>
        <table id="table_id" class="display">
            <thead>
                <tr>
                    <th>Nome</th>
                    <th>Consultor</th>
                    <th>Marca</th>
                    <th>Status</th>
                    <th>Data / Horário</th>
                    <th>Visualizar</th>
                </tr>
            </thead>
            <tbody>
                @foreach ($leads as $lead)
                <tr>
                    <td>{{ $lead->nome }}</td>
                    <td>{{ $lead->consultor }}</td>
                    <td>{{ $lead->marca }}</td>
                    <td>{{ $lead->status }}</td>
                    <td>{{ $lead->created_at }}</td>
                    <td><a class='btn btn-outline-info' href='leads/{{ $lead->lead_id }}/edit'><i class='far fa-eye' aria-hidden='true'></i></a></td>
                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@endsection
