@extends('layouts.admin.theme') @section("title", env("APP_NAME") . " :: " . __("Atualizar Usuário")) @section('content')
@php $headLine = " Atualizar Usuário"; $filterParams = request()->only(['q', 'structure_id', 'status', 'sort_by', 'sort_dir', 'page']); $filterQueryString = http_build_query(array_filter($filterParams)); $backUrl = route('admin.contas.index') . ($filterQueryString ? '?' . $filterQueryString : ''); @endphp

{!! __($headLine) !!}

@include("errors.messageFlash") @csrf @method('patch') {{-- Preservar filtros e parâmetros de paginação --}} @php $filterParams = request()->only(['q', 'structure_id', 'status', 'sort_by', 'sort_dir', 'page']); @endphp @foreach($filterParams as $key => $value) @if($value) @endif @endforeach
@include('components.tables._openPhoto', [ 'asset' => $user->photo, 'alt' => $user->name, 'title' => $user->name, 'text' => 'Visualizar foto', 'index' => 1, 'style' => "width: 200px;", ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Foto", "name" => "photo", "id" => null, "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" => null, "label" => "Nome completo", "name" => "fullName", "id" => null, "required" => true, "type" => null, "old" => old('fullName', $user->name), "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._inputType',[ "for" => null, "label" => "Email", "name" => "email", "id" => null, "required" => false, "type" => 'email', "old" => old('email', $user->email), "oninput" => "javascript:this.value = this.value.toLowerCase()", "readonly" => false, "small" => null, "placeholder" => "nome@email.com", ])
@include('components.inputs._inputType',[ "for" => null, "label" => "CPF", "name" => "cpf", "id" => null, "required" => true, "type" => null, "old" => old('cpf', $user->cpf), "oninput" => "javascript:aplicarMascaraCPF(this)", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Matrícula", "name" => "matriculation", "id" => null, "required" => false, "type" => null, "old" => old('matriculation', $user->matriculation), "oninput" => "javascript:this.value = this.value.replace(/\D/g, '')", "readonly" => false, "small" => null, ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Telefone", "name" => "phoneNumber", "id" => null, "required" => true, "type" => null, "old" => old('phoneNumber', $user->phoneNumber), "oninput" => "javascript:aplicarMascaraTelefone(this)", "readonly" => false, "small" => null, ])
@include('components.inputs._selectType', [ "for" => "structure_id", "label" => "Pertence a", "name" => "structure_id", "id" => "structureID", "required" => true, "readonly" => false, "placeholder" => "Selecione uma secretaria...", "options" => $secretarias->mapWithKeys(fn($s) => [ $s->id => "{$s->name} ({$s->abbreviation})" ])->toArray(), "selected" => old('structure_id', $user->structure_id ?? ''), "small" => "Selecione a secretaria à qual o usuário pertence.", ])
@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', $user->status ?? ''), "placeholder" => "Selecione o status...", "small" => "Informe o status atual do usuário.", "onchange" => null ])
@include('components.inputs._unidadesSelector', [ 'unidades' => $unidades, 'selectedUnidades' => old('unidades', $userUnidades ?? []), ])
@include('components.inputs._empresasSelector', [ 'empresas' => $empresas, 'selectedEmpresas' => old('empresas', $userEmpresas ?? []), ])
@include('components.inputs._inputType',[ "for" => null, "label" => "Senha", "name" => "password", "id" => null, "required" => true, "type" => 'password', "old" => old('password', 'mudar123'), "oninput" => null, "readonly" => true, "small" => '* A senha padrão é: mudar123
', "inputGroup" => false, ])
{{ __("* Permissão") }}
* selecionar todas as categorias
@foreach(collect(App\Enums\StatusPermission::cases())->sortBy('value') as $status) @php $permissao = $permissoes->firstWhere('permissao', $status->name); @endphp {{-- VISUALIZAR --}} {{-- ADICIONAR --}} {{-- EDITAR --}} {{-- EXCLUIR --}} @endforeach
visualizar ? 'checked' : '' }}>
adicionar ? 'checked' : '' }}>
editar ? 'checked' : '' }}>
excluir ? 'checked' : '' }}>
@php $filterParams = request()->only(['q', 'structure_id', 'status', 'sort_by', 'sort_dir', 'page']); $filterQueryString = http_build_query(array_filter($filterParams)); $backUrl = route('admin.contas.index') . ($filterQueryString ? '?' . $filterQueryString : ''); @endphp
{{ __('Voltar') }}
@endsection