@extends('admin.layouts.layout')
@section('title', 'Configurações Gerais')
@section('content')
    <div class="container-fluid">
        <div class="card shadow mb-4">
            <div class="card-header py-3">
                <h4 class="m-0 font-weight-bold text-primary">Configurações Gerais</h4>
                <span>Configurações Gerais do Sistema</span>
            </div>

            <div class="card">
                <div class="card-body">
                    <form action="{{ route('configuracoes.update') }}" method="POST" class="form-horizontal"
                        enctype="multpart/form-data">
                        @method('PUT')
                        @csrf
                        <div class="box box-info">
                            <table>
                                <div class="form-group">
                                    <div class="row">
                                        <div class="form-group col-md-6">
                                            <div class="form-group">
                                                <label class="col-form-label">Logomarca</label>
                                                <br>
                                                <img class="form-group"
                                                    src="{{ url('assets/site/uploads/logo/' . $front_config['logomarca']) }}"
                                                    width="250">
                                            </div>
                                            <label class="col-form-label">Nova logomarca <span>*</span></label>
                                            <br>
                                            <input type="file" name="logomarca">
                                        </div>
                                        <div class="form-group col-md-6">
                                            <div class="form-group">
                                                <label class="col-form-label">Favicon</label>
                                                <br>
                                                <img class="form-group"
                                                    src="{{ url('assets/site/uploads/favicon/' . $front_config['favicon']) }}"
                                                    width="80">
                                            </div>
                                            <label class="col-form-label">Novo favicon <span>*</span></label>
                                            <br>
                                            <input type="file" name="favicon">
                                        </div>
                                    </div>



                                    <div class="form-row">
                                        <div class="form-group col-md-10">
                                            <label class="col-form-label">Nome da Instituição <span>*</span></label>
                                            <input type="text" name="titulo" value="{{ $front_config['titulo'] }}"
                                                class="form-control @error('titulo') is-invalid @enderror" disabled>
                                        </div>
                                        <div class="form-group col-md-2">
                                            <label class="col-form-label">Tipo</label>
                                            <select class="form-control" name="tipo" value="{{ $front_config['tipo'] }}"
                                                disabled>
                                                <option value="Prefeitura"
                                                    @if ($front_config['tipo'] == 'Prefeitura') selected @endif>Prefeitura</option>
                                                <option value="Camara" @if ($front_config['tipo'] == 'Camara') selected @endif>
                                                    Câmara</option>
                                                <option value="Instituto" @if ($front_config['tipo'] == 'Instituto') selected @endif>
                                                    Instituto</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Subtítulo <span>*</span></label>
                                    <input type="text" name="subtitulo" value="{{ $front_config['subtitulo'] }}"
                                        class="form-control @error('subtitulo') is-invalid @enderror">
                                </div>

                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label class="col-form-label">Endereço</label>
                                        <input type="text" name="endereco" value="{{ $front_config['endereco'] }}"
                                            class="form-control @error('endereco') is-invalid @enderror" disabled>
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label class="col-form-label">Bairro</label>
                                        <input type="text" name="bairro" value="{{ $front_config['bairro'] }}"
                                            class="form-control @error('bairro') is-invalid @enderror" disabled>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Cidade</label>
                                        <input type="text" name="cidade" value="{{ $front_config['cidade'] }}"
                                            class="form-control @error('bairro') is-invalid @enderror" disabled>
                                    </div>
                                    <div class="form-group col-md-1">
                                        <label class="col-form-label">U.F.</label>
                                        <select class="form-control" name="uf" value="{{ $front_config['uf'] }}"
                                            disabled>
                                            <option value="">Selecione</option>
                                            <option value="AC" @if ($front_config['uf'] == 'AC') selected @endif>AC
                                            </option>
                                            <option value="AL" @if ($front_config['uf'] == 'AL') selected @endif>AL
                                            </option>
                                            <option value="AP" @if ($front_config['uf'] == 'AP') selected @endif>AP
                                            </option>
                                            <option value="AM" @if ($front_config['uf'] == 'AM') selected @endif>AM
                                            </option>
                                            <option value="BA" @if ($front_config['uf'] == 'BA') selected @endif>BA
                                            </option>
                                            <option value="CE" @if ($front_config['uf'] == 'CE') selected @endif>CE
                                            </option>
                                            <option value="DF" @if ($front_config['uf'] == 'DF') selected @endif>DF
                                            </option>
                                            <option value="ES" @if ($front_config['uf'] == 'ES') selected @endif>ES
                                            </option>
                                            <option value="GO" @if ($front_config['uf'] == 'GO') selected @endif>GO
                                            </option>
                                            <option value="MA" @if ($front_config['uf'] == 'MA') selected @endif>MA
                                            </option>
                                            <option value="MS" @if ($front_config['uf'] == 'MS') selected @endif>MS
                                            </option>
                                            <option value="MT" @if ($front_config['uf'] == 'MT') selected @endif>MT
                                            </option>
                                            <option value="MG" @if ($front_config['uf'] == 'MG') selected @endif>MG
                                            </option>
                                            <option value="PA" @if ($front_config['uf'] == 'PA') selected @endif>PA
                                            </option>
                                            <option value="PB" @if ($front_config['uf'] == 'PB') selected @endif>PB
                                            </option>
                                            <option value="PR" @if ($front_config['uf'] == 'PR') selected @endif>PR
                                            </option>
                                            <option value="PE" @if ($front_config['uf'] == 'PE') selected @endif>PE
                                            </option>
                                            <option value="PI" @if ($front_config['uf'] == 'PI') selected @endif>PI
                                            </option>
                                            <option value="RJ" @if ($front_config['uf'] == 'RJ') selected @endif>RJ
                                            </option>
                                            <option value="RN" @if ($front_config['uf'] == 'RN') selected @endif>RN
                                            </option>
                                            <option value="RS" @if ($front_config['uf'] == 'RS') selected @endif>RS
                                            </option>
                                            <option value="RO" @if ($front_config['uf'] == 'RO') selected @endif>RO
                                            </option>
                                            <option value="RR" @if ($front_config['uf'] == 'RR') selected @endif>RR
                                            </option>
                                            <option value="SC" @if ($front_config['uf'] == 'SC') selected @endif>SC
                                            </option>
                                            <option value="SP" @if ($front_config['uf'] == 'SP') selected @endif>SP
                                            </option>
                                            <option value="SE" @if ($front_config['uf'] == 'SE') selected @endif>SE
                                            </option>
                                            <option value="TO" @if ($front_config['uf'] == 'TO') selected @endif>TO
                                            </option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-row">
                                    <div class="form-group col-md-4">
                                        <label class="col-form-label">Telefones de contato</label>
                                        <input type="text" name="telefones_contato"
                                            value="{{ $front_config['telefones_contato'] }}"
                                            class="form-control @error('endereco') is-invalid @enderror">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label class="col-form-label">E-mail de contato</label>
                                        <input type="email" name="email_contato"
                                            value="{{ $front_config['email_contato'] }}" class="form-control">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label class="col-form-label">Site</label>
                                        <input type="site" name="site" value="{{ $front_config['site'] }}"
                                            class="form-control" disabled>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Horário de atendimento <span>*</span></label>
                                    <input type="text" name="horario_atendimento"
                                        value="{{ $front_config['horario_atendimento'] }}"
                                        class="form-control @error('horario_atendimento') is-invalid @enderror">
                                </div>

                                <div class="form-row">
                                    <div class="form-group col-md-5">
                                        <label class="col-form-label">Cor predominante</label>
                                        <input type="color" name="cor_predominante"
                                            value="{{ $front_config['cor_predominante'] }}"
                                            class="form-control @error('endereco') is-invalid @enderror">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label class="col-form-label">Cor do texto</label>
                                        <input type="color" name="cor_texto" value="{{ $front_config['cor_texto'] }}"
                                            class="form-control">
                                    </div>
                                    <div class="form-group col-md-1">
                                        <label class="col-form-label">Tela inteira</label>
                                        <select class="form-control" name="tela_inteira"
                                            value="{{ $front_config['tela_inteira'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['tela_inteira'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['tela_inteira'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <label class="col-form-label">Mostrar</label>
                                <div class="row">

                                    <div class="form-group col-md-1">


                                        <label class="col-form-label">Turismo</label>
                                        <select class="form-control" name="mostrar_turismo"
                                            value="{{ $front_config['mostrar_turismo'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['mostrar_turismo'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['mostrar_turismo'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Secretarias</label>
                                        <select class="form-control" name="mostrar_secretarias"
                                            value="{{ $front_config['mostrar_secretarias'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['mostrar_secretarias'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['mostrar_secretarias'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Acesso rápido</label>
                                        <select class="form-control" name="mostrar_acesso_rapido"
                                            value="{{ $front_config['mostrar_acesso_rapido'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['mostrar_acesso_rapido'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['mostrar_acesso_rapido'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Agentes políticos</label>
                                        <select class="form-control" name="mostrar_agentes"
                                            value="{{ $front_config['mostrar_agentes'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['mostrar_agentes'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['mostrar_agentes'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-1">
                                        <label class="col-form-label">Serviços</label>
                                        <select class="form-control" name="mostrar_servicos"
                                            value="{{ $front_config['mostrar_servicos'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['mostrar_servicos'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['mostrar_servicos'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-1">
                                        <label class="col-form-label">DOM</label>
                                        <select class="form-control" name="mostrar_dom"
                                            value="{{ $front_config['mostrar_dom'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['mostrar_dom'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['mostrar_dom'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label class="col-form-label">Período Eleitoral?</label>
                                        <select class="form-control" name="periodo_eleitoral"
                                            value="{{ $front_config['periodo_eleitoral'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['periodo_eleitoral'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['periodo_eleitoral'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>

                                    <div class="form-group col-md-1">


                                        <label class="col-form-label">Concurso</label>
                                        <select class="form-control" name="concurso"
                                            value="{{ $front_config['concurso'] }}">
                                            <option value="">Selecione</option>
                                            <option value="S" @if ($front_config['concurso'] == 'S') selected @endif>Sim
                                            </option>
                                            <option value="N" @if ($front_config['concurso'] == 'N') selected @endif>Não
                                            </option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-form-label">Iframe do Google Maps</label>
                                    <textarea type="text" rows="5" name="mapa_google" value=""
                                        class="form-control @error('mapa_google') is-invalid @enderror">{{ $front_config['mapa_google'] }}</textarea>
                                </div>

                                <div class="form-group">
                                    <button type="submit" class="btn btn-outline-success btn-sm btn-block"
                                        name="form1">Gravar Configurações</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

@endsection
