@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">Editando Secretaria</h4>
                    <p class="text-muted">Editando Secretaria no Sistema</p>
                    <a class="btn btn-outline-primary w-100" type="button" href="{{ route('secretarias.index') }}"
                        role="button">Ver todas</a>
                </div>
                <div class="card">
                    <div class="card-body">
                        <form action="{{ route('secretarias.update', $secretarias->id) }}" method="POST"
                            class="form-horizontal">
                            @method('PUT')
                            @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="secretaria_nome"
                                            value="{{ $secretarias->secretaria_nome }}"
                                            class="form-control @error('secretaria_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="secretaria_sigla"
                                            value="{{ $secretarias->secretaria_sigla }}"
                                            class="form-control @error('secretaria_sigla') is-invalid @enderror">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Slug <span>*</span></label>
                                    <input type="text" name="secretaria_slug" value="{{ $secretarias->secretaria_slug }}"
                                        class="form-control @error('secretaria_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('secretaria_detalhe') is-invalid @enderror bodyfield" rows="5"
                                        name="secretaria_detalhe" id="editor">{{ $secretarias->secretaria_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="secretaria_endereco"
                                            value="{{ $secretarias->secretaria_endereco }}"
                                            class="form-control @error('secretaria_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="secretaria_fixo"
                                            value="{{ $secretarias->secretaria_fixo }}" class="form-control">
                                    </div>

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

                                <div class="form-group">
                                    <label class="col-form-label">E-mail <span>*</span></label>
                                    <input type="text" name="secretaria_email"
                                        value="{{ $secretarias->secretaria_email }}"
                                        class="form-control @error('secretaria_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="{{ $secretarias->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 name="id_secretario"
                                        class="form-control @error('id_secretario') is-invalid @enderror">
                                        @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="secretaria_foto"
                                        value="{{ $secretarias->secretaria_foto }}"
                                        class="form-control @error('secretaria_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="{{ $secretarias->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="{{ $secretarias->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="{{ $secretarias->meta_descricao }}"></textarea>
                                </div>

                                <br>
                                <div class="form-group">
                                    <button type="submit" class="btn btn-outline-success w-100"
                                        name="form1">Gravar</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
