@extends('layouts.admin.theme') @section("title", env("APP_NAME") . " :: " . __("Novo Usuário")) @section('content')
@php $headLine = " Novo Usuário"; @endphp @include('components.buttons._headLineButtonsBackAdd', [ 'headLine' => __($headLine), 'routeBack' => 'admin.contas.index', 'routeBackParams' => [], 'nameBack' => __("Voltar"), "permission" => "SYSADMIN", ])
@csrf @include("errors.messageFlash")
@include('components.tables._openPhoto', [ 'asset' => "pmar/assets/img/icons/usuario.png", 'alt' => "Novo usuário", 'title' => "Novo usuário", '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'), "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" => "CPF", "name" => "cpf", "id" => null, "required" => true, "type" => null, "old" => old('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'), "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'), "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'), "oninput" => "javascript:this.value = this.value.toLowerCase()", "readonly" => false, "small" => null, "placeholder" => "nome@email.com", ])
@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, ])
@include('components.inputs._selectType', [ "for" => "structure_id", "label" => "Pertence a", "name" => "structure_id", "id" => "structureID", "required" => false, "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" => "Opcional. 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', []), ])
@include('components.inputs._empresasSelector', [ 'empresas' => $empresas, 'selectedEmpresas' => old('empresas', []), ])
{{ __('* Permissão') }}
{{ __('* selecionar todas as categorias') }}
@include('components.contas._permissionsMatrix', [ 'mode' => 'create', 'permissoesDisponiveis' => \App\Enums\StatusPermission::cases(), ])
@include('components.buttons._backAndSend', [ 'textBack' => 'Voltar', 'textSend' => 'Cadastrar', 'routeBack' => 'admin.contas.index' ] )
@endsection