@extends('layouts.app') @section('content')

User Details

@if ($user->profileImage)
{{ ucfirst($user->name ?? 'User') }}
@else
User
@endif

Before

Name:

{{ ucfirst($user->name ?? 'N/A') }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'name')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Email:

{{ $user->email ?? 'N/A' }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'email')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Phone Number:

{{ $user->country_code ? $user->country_code : 'N/A' }}{{ $user->phone ? $user->phone : '' }}

Status:

@if ($user->status === 0) Inactive @elseif ($user->status === 1) Active @elseif ($user->status === 2) Deactive @else N/A @endif

Gender:

{{ $user->sex ? $user->sex : 'N/A' }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'sex')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Daily Limit:

{{ $user->surveyLimit->limit ?? 'N/A' }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'survey limit')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Location:

{{ $user->location ?? 'N/A' }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'location')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Nationality:

{{ ucfirst($user->nationality ?? 'N/A') }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'nationality')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Timezone:

{{ $user->timezone ?? 'N/A' }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'timezone')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Document:

{{ $user->document_type ?? 'N/A' }}

@foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'document_type')
Before: {{ $auditDetail['previous_value'] ?? 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
@if ($user->document) User @else

No document uploaded

@endif
@php $hasDocument = false; @endphp @foreach ($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'document' && !empty($auditDetail['previous_value'])) @php $hasDocument = true; @endphp @endif @endforeach @if ($hasDocument)

Before

@endif
User Added Locations
@if (!empty($locations))
    @foreach ($locations as $location)
  • {{ ucfirst($location) }}
  • @endforeach
@else

No locations added

@endif
@if (!empty($auditLocations))

Before

    @foreach ($auditLocations as $auditLocation)
  • {{ ucfirst($auditLocation['location']) }} @if(isset($auditLocation['status']) && $auditLocation['status'] === 'deleted') Deleted @endif
  • @endforeach
@endif
Interests
@if (!empty($interests))
    @foreach ($interests as $interest)
  • {{ $interest }}
  • @endforeach
@else

No interests available

@endif
@if (!empty($auditInterests)) @php $hasPreviousInterests = false; @endphp

Before

    @foreach ($auditInterests as $interest) @if (!empty($interest->interest->title)) @php $hasPreviousInterests = true; @endphp
  • {{ $interest->interest->title }} @if (isset($interest->status) && $interest->status == "removed") Deleted @endif
  • @endif @endforeach
@if (!$hasPreviousInterests)

No changes made

@endif
@else

No changes made

@endif
Sub Interests
@if (!empty($subInterests))
    @foreach ($subInterests as $subInterest)
  • {{ $subInterest }}
  • @endforeach
@else

No sub interests available

@endif
@if(!empty($auditSubInterests))

Before

    @foreach ($auditSubInterests as $subInterest)
  • {{ @$subInterest->subInterest->title }} @if(isset($subInterest->status) && $subInterest->status == "removed") Deleted @endif
  • @endforeach
@endif
Date of Birth:

{{ isset($user->age) && !empty($user->age) ? \Carbon\Carbon::createFromFormat('d/m/Y', $user->age)->format('j M Y') : 'N/A' }}

@foreach($userAuditDetails as $auditDetail) @if ($auditDetail['field_name'] == 'age')
Before: {{ isset($auditDetail['previous_value']) && !empty($auditDetail['previous_value']) ? \Carbon\Carbon::createFromFormat('d/m/Y', $auditDetail['previous_value'])->format('j M Y') : 'N/A' }} (Changed on: {{ \Carbon\Carbon::parse($auditDetail['created_at'])->setTimezone($user->timezone ?? 'UTC')->format('d M Y H:i') }} )
@endif @endforeach
Total Reward Points: {{$totalRewardPoints}}

@if ($rewardPoints->isEmpty()) No reward points available. @else

    @foreach ($rewardPoints as $reward)
  • {{ $reward->points }} points earned for {{ $reward->type }}
  • @endforeach
@endif

User Response on Surveys

@if (!empty($surveyResponses) && is_array($surveyResponses)) @php $count = 0; @endphp @foreach ($surveyResponses as $surveyName => $questions) @if ($count < 5)
Survey {{ $count + 1 }}: {{ ucfirst($surveyName) }}
    @foreach ($questions as $response)
  • Based on: {{ $surveyType ?? 'N/A' }}
    Question: {{ $response['question'] }}
    Answer: {{ ucfirst($response['answer']) }}
  • @endforeach
@php $count++; @endphp @endif @endforeach @if (count($surveyResponses) > 5) View more @endif @else

No survey responses available.

@endif
@endsection