@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">Cadastrando Arquivo ou Documento</h4>
                    <p class="text-muted">Cadastrando Arquivo ou Documento no Sistema</p>
                    <a class="btn btn-outline-primary w-100" type="button" href="{{ route('arquivos.index') }}"
                        role="button">Ver
                        todos</a>
                </div>

                <div class="card">
                    <div class="card-body">
                        <form action="{{ route('arquivos.store') }}" method="POST" class="form-horizontal"
                            enctype="multipart/form-data">
                            @csrf
                            <div class="box box-info">

                                <div class="form-group">
                                    <label class="col-form-label">Título do arquivo</label>
                                    <input type="text" name="titulo" value="{{ old('titulo') }}"
                                        class="form-control @error('titulo') is-invalid @enderror">
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Tipo</label>
                                    <select class="form-control @error('tipo_id') is-invalid @enderror"
                                            name="tipo_id" value="{{ old('tipo_id') }}">
                                            <option value="">Selecione uma categoria</option>
                                            @foreach ($arquivostipo as $tipo)
                                                <option value="{{ $tipo->id }}">{{ $tipo->tipo_nome }}
                                                </option>
                                            @endforeach
                                        </select>
                                </div>

                                <div class="row">
                                    <div class="form-group col-md-6">
                                        <label class="col-form-label">Data do arquivo</label>
                                        <input type="date" name="data" value="{{ old('data') }}"
                                            class="form-control @error('data') is-invalid @enderror">
                                    </div>

                                    <div class="form-group col-md-6">
                                        <label class="col-form-label">Data da publicação</label>
                                        <input type="date" name="publicacao" value="{{ old('publicacao') }}"
                                            class="form-control @error('publicacao') is-invalid @enderror">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-md-4">
                                        <div class="form-group">
                                            <label class="col-form-label">Arquivo</label>
                                            <br>
                                            <input type="file" name="nome">
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="form-group col-md-1">
                                        <label class="col-form-label">Covid-19?</label>
                                        <select class="form-control" name="covid" value="{{ old('covid') }}"
                                            class="form-control @error('covid') is-invalid @enderror">
                                            <option value="N">Não</option>
                                            <option value="S">Sim</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Concurso?</label>
                                        <select class="form-control" name="concurso" value="{{ old('concurso') }}"
                                            class="form-control @error('concurso') is-invalid @enderror">
                                            <option value="N">Não</option>
                                            <option value="S">Sim</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Aldir Blank?</label>
                                        <select class="form-control" name="aldir_blanc" value="{{ old('aldir_blanc') }}"
                                            class="form-control @error('aldir_blanc') is-invalid @enderror">
                                            <option value="N">Não</option>
                                            <option value="S">Sim</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Sala do Empreendedor</label>
                                        <select class="form-control" name="empreendedor" value="{{ old('empreendedor') }}"
                                            class="form-control @error('empreendedor') is-invalid @enderror">
                                            <option value="N">Não</option>
                                            <option value="S">Sim</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Lei Paulo Gustavo</label>
                                        <select class="form-control" name="paulogustavo" value="{{ old('paulogustavo') }}"
                                            class="form-control @error('paulogustavo') is-invalid @enderror">
                                            <option value="N">Não</option>
                                            <option value="S">Sim</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-1">
                                        <label class="col-form-label">Ativo?</label>
                                        <select class="form-control" name="ativo" value="{{ old('ativo') }}"
                                            class="form-control @error('ativo') is-invalid @enderror">
                                            <option value="N">Não</option>
                                            <option value="S">Sim</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">CACS</label>
                                        <select class="form-control" name="cacs" value="{{ old('cacs') }}"
                                            class="form-control @error('cacs') is-invalid @enderror">
                                            <option value="N">Não</option>
                                            <option value="S">Sim</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <br>
                            <div class="form-group">
                                <input type="submit" value="Gravar" class="btn btn-sm btn-outline-success w-100">
                            </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
@endsection
