@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 Processo Licitatório</h4>
                    <p class="text-muted">Cadastrando Processo Licitatório no Sistema</p>
                    <a class="btn btn-outline-primary btn-block w-100" type="button" href="{{ route('licitacoes.index') }}"
                        role="button">Ver todos</a>
                </div>
                <div class="card">
                    <div class="card-body">
                        <form action="{{ route('licitacoes.store') }}" method="POST" class="form-horizontal"
                            enctype="multipart/form-data">
                            @csrf
                            <div class="form-group col-md-12">
                                <label>Modalidade</label>
                                <select class="form-control @error('id_modalidade') is-invalid @enderror"
                                    name="id_modalidade">
                                    <option name="" selected>Selecione</option>
                                    @foreach ($modalidades as $modalidade)
                                        <option value="{{ $modalidade->id }}">{{ $modalidade->modalidade }}</option>
                                    @endforeach
                                </select>
                            </div>

                            <div class="row">
                                <div class="form-group col-md-3">
                                    <label>Numero da Licitação</label>
                                    <input type="text" name="numero" value="{{ old('numero') }}"
                                        class="form-control @error('numero') is-invalid @enderror">
                                </div>
                                <div class="form-group col-md-3">
                                    <label class="control-label">Processo Administrativo</label>
                                    <input type="text" name="processo" value="{{ old('processo') }}"
                                        class="form-control @error('processo') is-invalid @enderror">
                                </div>
                                <div class="form-group col-md-2">
                                    <label class="control-label">Edital</label>
                                    <input type="date" name="edital" value="{{ old('edital') }}"
                                        class="form-control @error('edital') is-invalid @enderror">
                                </div>
                                <div class="form-group col-md-2">
                                    <label class="control-label">Abertura</label>
                                    <input type="date" name="abertura" value="{{ old('abertura') }}"
                                        class="form-control @error('abertura') is-invalid @enderror">
                                </div>
                                <div class="form-group col-md-2">
                                    <label class="control-label">Encerramento</label>
                                    <input type="date" name="encerramento" value="{{ old('encerramento') }}"
                                        class="form-control @error('encerramento') is-invalid @enderror">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label">Objeto da Licitação</label>
                                <textarea lines="10" id="editor" name="objeto" class="form-control @error('objeto') is-invalid @enderror">{{ old('objeto') }}</textarea>
                            </div>

                            <div class="form-group">
                                <label class="control-label">Arquivo principal</label>
                                <input type="file" name="arquivo" value="{{old('arquivo')}}">
                            </div>

                            <div class="row">
                                <div class="form-group col-md-8">
                                    <label class="control-label">Status</label>
                                    <div class="form-check">
                                        <input class="form-check-input" type="radio" name="status" value="Aberta"
                                            checked>
                                        <label class="form-check-label" for="exampleRadios1">Aberta</label>
                                    </div>
                                    <div class="form-check">
                                        <input class="form-check-input" type="radio" name="status" value="Encerrada">
                                        <label class="form-check-label" for="exampleRadios2">Encerrada</label>
                                    </div>
                                </div>
                                <div class="form-group col-md-2">
                                    <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">14133?</label>
                                    <select class="form-control" name="lei_14133" value="{{ old('lei_14133') }}"
                                        class="form-control @error('lei_14133') is-invalid @enderror">
                                        <option value="N">Não</option>
                                        <option value="S">Sim</option>
                                    </select>
                                </div>
                            </div>
                            <br>
                            <div class="form-group">
                                <button type="submit" class="btn btn-outline-success btn-sm w-100"
                                    name="form1">Gravar</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
