@extends('admin.layouts.layout')
@section('content')
    <div class="row match-height">
        <div class="col-md-12 col-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title text-primary">Vacinação</h4>
                    <p class="text-muted">Cadastro de Vacinação no Sistema</p>
                    <a class="btn btn-outline-primary w-100" type="button" href="{{ route('vacinacao.create') }}"
                        role="button">Nova Vacinação</a>
                </div>

                <div class="card">
                    <div class="card-body">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>Data</th>
                                    <th>Hora</th>
                                    <th>Enviadas</th>
                                    <th>Vacinadas</th>
                                    <th>Disponíveis</th>
                                    <th>Ações</th>
                                </tr>
                            </thead>
                            @foreach ($vacinacao as $vacina)
                                <tbody>
                                    <tr>
                                        <td>{{ $vacina->id }}</td>
                                        <td>{{ date('d/m/Y', strtotime($vacina->data)) }}</td>
                                        <td>{{ date('H:i:s', strtotime($vacina->hora)) }}</td>
                                        <td>{{ $vacina->enviadas }}</td>
                                        <td>{{ $vacina->vacinadas }}</td>
                                        <td>{{ $vacina->disponiveis }}</td>
                                        <td>
                                            <a href="{{ route('vacinacao.edit', ['vacinacao' => $vacina->id]) }}"
                                                class="btn btn-sm btn-outline-warning">Editar</a>
                                            <form class="d-inline" method="POST"
                                                action="{{ route('vacinacao.destroy', ['vacinacao' => $vacina->id]) }}"
                                                onSubmit="return confirm('Tem certeza que deseja excluir?')">
                                                @method('DELETE')
                                                @csrf
                                                <button class="btn btn-sm btn-outline-danger">Exluir</button>
                                            </form>
                                        </td>
                                    </tr>
                                </tbody>
                            @endforeach
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
