@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 Secretaria</h4>
                    <p class="text-muted">Cadastro de Secretaria no Sistema</p>
                    <a class="btn btn-outline-primary btn-block d-grid gap-2" type="button"
                        href="{{ route('secretarias.index') }}" role="button">Ver todas</a>
                </div>
                <div class="card">
                    <div class="card-body">
                        <form action="{{ route('secretarias.store') }}" method="POST" class="form-horizontal"
                            enctype="multipart/form-data">
                            @csrf
                            <div class="box box-info">
                                <div class="row">
                                    <div class="form-group col-md-10">
                                        <label class="col-form-label">Nome da Secretaria <span>*</span></label>
                                        <input type="text" name="nome" value="{{ old('nome') }}"
                                            class="form-control @error('nome') is-invalid @enderror">
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Sigla <span>*</span></label>
                                        <input type="text" name="sigla" value="{{ old('sigla') }}"
                                            class="form-control @error('sigla') is-invalid @enderror">
                                    </div>

                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Slug <span>*</span></label>
                                    <input type="text" name="slug" value="{{ old('slug') }}"
                                        class="form-control @error('slug') is-invalid @enderror"
                                        placeholder="Campo preenchido automaticamente pelo sistema" disabled>
                                </div>


                                <div class="form-group">
                                    <label class="col-form-label">Detalhes </label>
                                    <textarea type="text" class="form-control @error('detalhe') is-invalid @enderror" rows="5" name="detalhe"
                                        id="editor" value="{{ old('detalhe') }}"></textarea>
                                </div>

                                <div class="row">
                                    <div class="form-group col-md-6">
                                        <label class="col-form-label">Endereço <span>*</span></label>
                                        <input type="text" name="endereco" value="{{ old('endereco') }}"
                                            class="form-control @error('endereco') is-invalid @enderror">
                                    </div>

                                    <div class="form-group col-md-3">
                                        <label class="col-form-label">Fixo <span>*</span></label>
                                        <input type="text" name="fixo" value="{{ old('fixo') }}"
                                            class="form-control @error('fixo') is-invalid @enderror">
                                    </div>

                                    <div class="form-group col-md-3">
                                        <label class="col-form-label">Celular <span>*</span></label>
                                        <input type="text" name="celular" value="{{ old('celular') }}"
                                            class="form-control @error('celular') is-invalid @enderror">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">E-mail <span>*</span></label>
                                    <input type="text" name="email" value="{{ old('email') }}"
                                        class="form-control @error('email') is-invalid @enderror">
                                </div>
                                <div class="form-group">
                                    <label class="col-form-label">Horário de Atendimento <span>*</span></label>
                                    <input type="text" name="horario_atendimento"
                                        value="{{ old('horario_atendimento') }}"
                                        class="form-control @error('horario_atendimento') is-invalid @enderror">
                                </div>
                                <div class="form-group">
                                    <label class="col-form-label">Secretário <span>*</span></label>
                                    <select class="form-control @error('id_secretario') is-invalid @enderror"
                                        name="id_secretario">
                                        <option name="id_secretario" value="">Selecione</option>
                                        @foreach ($secretarios as $secretario)
                                            <option value="{{ $secretario->id }}">{{ $secretario->nome }}</option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label class="col-form-label">Foto <span>*</span></label>
                                    <input type="file" name="foto" value="{{ old('foto') }}"
                                        class="form-control @error('foto') is-invalid @enderror">
                                </div>

                                <h4 class="seo-info">SEO Informações</h4>
                                <div class="form-group">
                                    <label class="col-form-label">Meta Título </label>
                                    <input type="text" class="form-control @error('meta_titulo') is-invalid @enderror"
                                        name="meta_titulo" value="{{ old('meta_titulo') }}"
                                        placeholder="Campo preenchido automaticamente pelo sistema" disabled>
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Meta Keywords </label>
                                    <textarea type="text" class="form-control @error('meta_keyword') is-invalid @enderror" name="meta_keyword"
                                        rows="2" value="{{ old('meta_keyword') }}"></textarea>
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Meta Descrição </label>
                                    <textarea type="text" class="form-control @error('meta_descricao') is-invalid @enderror" name="meta_descricao"
                                        rows="2" value="{{ old('meta_descricao') }}"></textarea>
                                </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
