@extends('layouts/client') @section('title', __('client.profile.index')) @section('scripts') @endsection @section('content') {{-- Banner --}}

{{ __('global.clientarea') }}

{{ __('client.profile.index') }}

@include('shared/alerts')
{{-- Colonne principale --}}
{{-- Informations personnelles --}}

{{ __('client.profile.index') }}

{{ __('client.profile.index_description') }}

@csrf
@include('shared.input', ['name' => 'firstname', 'label' => __('global.firstname'), 'value' => auth('web')->user()->firstname ?? old('firstname')])
@include('shared.input', ['name' => 'lastname', 'label' => __('global.lastname'), 'value' => auth('web')->user()->lastname ?? old('lastname')])
@include('shared/input', ['name' => 'company_name', 'label' => __('global.company_name') . ' (' . __('global.optional') . ')', 'value' => auth('web')->user()->company_name ?? old('company_name')])
@include('shared.input', ['name' => 'address', 'label' => __('global.address'), 'value' => auth('web')->user()->address ?? old('address')])
@include('shared.input', ['name' => 'address2', 'label' => __('global.address2'), 'value' => auth('web')->user()->address2 ?? old('address2')])
@include('shared.input', ['name' => 'zipcode', 'label' => __('global.zip'), 'value' => auth('web')->user()->zipcode ?? old('zipcode')])
@include('shared.input', ['name' => 'email', 'label' => __('global.email'), 'type' => 'email', 'value' => auth('web')->user()->email ?? old('email'), 'disabled' => true])
@include('shared.input', ['name' => 'phone', 'label' => __('global.phone'), 'value' => auth('web')->user()->phone ?? old('phone')])
@include('shared.select', ['name' => 'country', 'label' => __('global.country'), 'options' => $countries, 'value' => auth('web')->user()->country ?? old('country')])
@include('shared.input', ['name' => 'city', 'label' => __('global.city'), 'value' => auth('web')->user()->city ?? old('city')])
@include('shared.input', ['name' => 'region', 'label' => __('global.region'), 'value' => auth('web')->user()->region ?? old('region')])
@include('shared/select', ['name' => 'locale', 'label' => __('global.locale'), 'options' => $locales, 'value' => auth('web')->user()->locale ?? old('locale')])
@include('shared/textarea', ['name' => 'billing_details', 'label' => __('global.billing_details'), 'value' => auth('web')->user()->billing_details ?? old('billing_details'), 'help' => __('global.billing_details_help')])
{{-- Question de sécurité --}} @if (!$user->hasSecurityQuestion())

{{ __('client.profile.security_question.title') }}

{{ __('client.profile.security_question.description') }}

@csrf
@include('shared/select', ['name' => 'security_question_id', 'label' => __('client.profile.security_question.select'), 'options' => \App\Models\Admin\SecurityQuestion::active()->ordered()->pluck('question', 'id')->toArray(), 'value' => old('security_question_id', $user->security_question_id), 'required' => true, 'placeholder' => __('client.profile.security_question.choose')])
@include('shared/input', ['name' => 'security_answer', 'label' => __('client.profile.security_question.answer'), 'type' => 'text', 'placeholder' => __('client.profile.security_question.answer_placeholder'), 'required' => true])
@include('shared/password', ['name' => 'currentpassword_sq', 'label' => __('client.profile.security.currentpassword')])
@endif
{{-- Colonne latérale --}}
{{-- Sécurité / Mot de passe --}}

{{ __('client.profile.security.index') }}

{{ __('client.profile.security.index_description') }}

@csrf
@include('shared/password', ['name' => 'currentpassword', 'label' => __('client.profile.security.currentpassword')]) @include('shared/password', ['name' => 'password', 'label' => __('client.profile.security.newpassword')]) @include('shared/password', ['name' => 'password_confirmation', 'label' => __('global.password_confirmation')]) @if (auth('web')->user()->twoFactorEnabled()) @include('shared/input', ['name' => '2fa', 'label' => __('client.profile.2fa.code')]) @endif @if ($user->hasSecurityQuestion()) @include('shared/input', ['name' => 'security_answer', 'label' => $user->securityQuestion->question]) @endif
{{-- 2FA --}}

{{ __('client.profile.2fa.title') }}

@if (!auth('web')->user()->twoFactorEnabled())

{{ __('client.profile.2fa.info') }}

@else

{!! __('client.profile.2fa.download_codes', ['url' => route('front.profile.2fa_codes')]) !!}

@endif
@csrf @if (!auth('web')->user()->twoFactorEnabled()) {!! $qrcode !!} @include('shared/input', ['name' => '2fa', 'label' => __('client.profile.2fa.code'), 'help' => $code]) @else @include('shared/input', ['name' => '2fa', 'label' => __('client.profile.2fa.code')]) @endif
{{-- Connexions sociales --}} @if (!empty($providers)) @endif
{{-- Zone de danger --}} @php $deletionService = new \App\Services\Account\AccountDeletionService(); $canDelete = $deletionService->canDelete($user); $blockingReasons = $deletionService->getBlockingReasons($user); @endphp

{{ __('client.profile.delete.danger_zone') }}

{{ __('client.profile.delete.warning_message') }}

@if (!$canDelete)

{{ __('client.profile.delete.cannot_delete') }}

@if (isset($blockingReasons['active_services']))

{{ __('client.profile.delete.has_active_services', ['count' => $blockingReasons['active_services']['count']]) }}

@endif @if (isset($blockingReasons['pending_invoices']))

{{ __('client.profile.delete.has_pending_invoices', ['count' => $blockingReasons['pending_invoices']['count']]) }}

@endif
@else
@csrf @method('DELETE')
@include('shared/input', ['name' => 'password', 'type' => 'password', 'label' => __('client.profile.delete.password_label')]) @if ($user->twoFactorEnabled()) @include('shared/input', ['name' => '2fa_code', 'type' => 'text', 'label' => __('client.profile.delete.2fa_label')]) @endif
@include('shared/checkbox', ['name' => 'confirm_deletion', 'label' => __('client.profile.delete.confirm_checkbox'), 'checked' => false])
@endif
@endsection