@extends('layouts.admin.theme') @section("title", env("APP_NAME") . " :: Editar Centro de Referencia") @section('content')
@php $headLine = " Editar Centro de Referencia"; @endphp @include('components.buttons._headLineButtonsBackAdd', [ 'headLine' => __($headLine), 'routeBack' => 'admin.acaoSocial.centrosDeReferencia.index', 'routeBackParams' => [], 'nameBack' => __("Voltar"), "permission" => "GERENCIADOR_DE_CENTROS_REFERENCIA", ])
@csrf @method("PUT") @include("errors.messageFlash")
@include('components.tables._openPhoto', [ 'asset' => $centro->foto, 'alt' => "Foto da unidade", 'title' => "Foto da unidade", 'text' => 'Visualizar foto', 'index' => 1, 'style' => "width: 200px;", ])
@include('components.inputs._inputType',[ "for" => 'foto', "label" => "Foto da unidade", "name" => "foto", "id" => 'foto', "required" => false, "type" => 'file', "old" => null, "oninput" => null, "readonly" => true, "small" => null, "accept" => 'image/jpeg,image/jpg,image/png,image/gif', ])
@include('components.inputs._inputType',[ "for" => 'nome', "label" => "Nome do centro de referencia", "name" => "nome", "id" => 'nome', "required" => true, "type" => null, "old" => old('nome', $centro->nome), "oninput" => "javascript:this.value = this.value.toLocaleUpperCase('pt-BR').replace(/[^\p{L}\s]+/gu, '').replace(/\s{2,}/g,' ').trimStart()", "readonly" => false, "small" => null, ])
@include('components.inputs._selectType', [ "for" => "tipoCentroReferencia", "label" => "Tipo de unidade", "name" => "tipoCentroReferencia", "id" => "tipoCentroReferencia", "required" => true, "readonly" => false, "placeholder" => "Selecione uma unidade...", "options" => ["CRAS" => "CRAS", "CREAS" => "CREAS", "CAPR" => "CAPR", "ILPI" => "ILPI", "CIL" => "CIL"], "selected" => old('tipoCentroReferencia', $centro->tipoCentroReferencia), "small" => "Selecione o tipo de unidade.", ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Telefone", "name" => "telefone", "id" => null, "required" => true, "type" => null, "old" => old('telefone', $centro->telefone), // "oninput" => "javascript:aplicarMascaraTelefone(this)", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Email", "name" => "email", "id" => null, "required" => false, "type" => 'email', "old" => old('email', $centro->email), "oninput" => "javascript:this.value = this.value.toLowerCase()", "readonly" => false, "small" => null, "placeholder" => "nome@email.com", ])

possuiRecursosMultifuncionais ? 'checked' : '' }}>

@include('components.inputs._inputType',[ "for" => null, "label" => "CEP", "name" => "cep", "id" => "zipCode", "required" => true, "type" => null, "old" => old('cep', $centro->endereco->cep), "oninput" => "javascript:aplicarMascaraCEP(this)", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Logradouro", "name" => "logradouro", "id" => "street", "required" => true, "type" => null, "old" => old('logradouro', $centro->endereco->logradouro), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Número", "name" => "numero", "id" => "numero", "required" => false, "type" => null, "old" => old('numero', $centro->endereco->numero), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Complemento", "name" => "complemento", "id" => "complemento", "required" => false, "type" => null, "old" => old('complemento', $centro->endereco->complemento), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Cidade", "name" => "cidade", "id" => "city", "required" => true, "type" => null, "old" => old('cidade', $centro->endereco->cidade), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Bairro", "name" => "bairro", "id" => "neighborhood", "required" => true, "type" => null, "old" => old('bairro', $centro->endereco->bairro), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "UF", "name" => "uf", "id" => "state", "required" => true, "type" => null, "old" => old('uf', $centro->endereco->uf), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, "listName" => "estadosBrasileiros", "arrayList" => [ 'AC', 'AL', 'AM', 'AP', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MG', 'MS', 'MT', 'PA', 'PB', 'PE', 'PI', 'PR', 'RJ', 'RN', 'RO', 'RR', 'RS', 'SC', 'SE', 'SP', 'TO' ], ])
@include('components.modal._mapModal',[ "label" => "Clique no mapa e escolha um determinado ponto", ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Latitude", "name" => "latitude", "id" => null, "required" => true, "type" => null, "old" => old('latitude', $centro->endereco->latitude), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Longitude", "name" => "longitude", "id" => null, "required" => true, "type" => null, "old" => old('longitude', $centro->endereco->longitude), "oninput" => "javascript:this.value = this.value.toUpperCase()", "readonly" => false, "small" => null, ])
@include('components.inputs._selectType', [ "for" => "status", "label" => "Status", "name" => "status", "required" => true, "readonly" => false, "options" => collect(App\Enums\StatusEnum::cases()) ->mapWithKeys(fn($status) => [$status->name => $status->value]) ->toArray(), "selected" => old('status', $centro->status), "placeholder" => "Selecione o status...", "small" => "Informe o status atual da unidade.", "onchange" => null ])

@error('informacoes') {{ $message }} @enderror
@include('components.buttons._backAndSend', [ 'textBack' => 'Voltar', 'textSend' => 'Atualizar', 'routeBack' => 'admin.acaoSocial.centrosDeReferencia.index' ] )
@endsection