@extends('layouts.app') @php function calculateTimeDifference($date1, $date2) { $diff = $date1->diff($date2); $parts = []; if ($diff->y > 0) $parts[] = $diff->y . ' year' . ($diff->y > 1 ? 's' : ''); if ($diff->m > 0) $parts[] = $diff->m . ' month' . ($diff->m > 1 ? 's' : ''); if ($diff->d > 0) $parts[] = $diff->d . ' day' . ($diff->d > 1 ? 's' : ''); return implode(' ', $parts) ?: 'Same day'; } @endphp @section('content')
@if(session('success')) @endif @if(session('error')) @endif

Member Profile

Comprehensive member information and analytics

@if($relationship->dependent->media_gallery[0] ?? false) {{ $relationship->dependent->full_name }} @else
{{ strtoupper(substr($relationship->dependent->full_name, 0, 1)) }}
@endif

{{ $relationship->dependent->full_name }}

@if($relationship->relationship_type == 'self' || Auth::id() == $relationship->guardian_user_id) @else @endif
@if($relationship->dependent->motto)

"{{ $relationship->dependent->motto }}"

@endif
{{ $relationship->dependent->nationality }} {{ $relationship->dependent->gender == 'm' ? 'Male' : 'Female' }} Age {{ $relationship->dependent->age }} @php $horoscopeSymbols = [ 'Aries' => '♈', 'Taurus' => '♉', 'Gemini' => '♊', 'Cancer' => '♋', 'Leo' => '♌', 'Virgo' => '♍', 'Libra' => '♎', 'Scorpio' => '♏', 'Sagittarius' => '♐', 'Capricorn' => '♑', 'Aquarius' => '♒', 'Pisces' => '♓' ]; $horoscope = $relationship->dependent->horoscope ?? 'N/A'; $symbol = $horoscopeSymbols[$horoscope] ?? ''; @endphp {{ $symbol }} {{ $horoscope }} Active Joined {{ $relationship->dependent->created_at->format('F Y') }}
@if($relationship->dependent->social_links && count($relationship->dependent->social_links) > 0)
@php $socialLinks = $relationship->dependent->social_links; ksort($socialLinks); // Sort by platform name $socialIcons = [ 'facebook' => 'bi-facebook', 'twitter' => 'X', // Special case for Twitter/X 'instagram' => 'bi-instagram', 'linkedin' => 'bi-linkedin', 'youtube' => 'bi-youtube', 'tiktok' => 'bi-tiktok', 'snapchat' => 'bi-snapchat', 'whatsapp' => 'bi-whatsapp', 'telegram' => 'bi-telegram', 'discord' => 'bi-discord', 'reddit' => 'bi-reddit', 'pinterest' => 'bi-pinterest', 'twitch' => 'bi-twitch', 'github' => 'bi-github', 'spotify' => 'bi-spotify', 'skype' => 'bi-skype', 'slack' => 'bi-slack', 'medium' => 'bi-medium', 'vimeo' => 'bi-vimeo', 'messenger' => 'bi-messenger', 'wechat' => 'bi-wechat', 'line' => 'bi-line', ]; $socialTitles = [ 'facebook' => 'Facebook', 'twitter' => 'Twitter/X', 'instagram' => 'Instagram', 'linkedin' => 'LinkedIn', 'youtube' => 'YouTube', 'tiktok' => 'TikTok', 'snapchat' => 'Snapchat', 'whatsapp' => 'WhatsApp', 'telegram' => 'Telegram', 'discord' => 'Discord', 'reddit' => 'Reddit', 'pinterest' => 'Pinterest', 'twitch' => 'Twitch', 'github' => 'GitHub', 'spotify' => 'Spotify', 'skype' => 'Skype', 'slack' => 'Slack', 'medium' => 'Medium', 'vimeo' => 'Vimeo', 'messenger' => 'Messenger', 'wechat' => 'WeChat', 'line' => 'Line', ]; @endphp @foreach($socialLinks as $platform => $url) @if(!empty($url) && isset($socialIcons[$platform])) @if($platform === 'twitter') {{ $socialIcons[$platform] }} @else @endif @endif @endforeach
@endif
Profile Statistics

Key performance metrics and milestones

Total Sessions
127
Sessions completed this year
Attendance Rate
85%
Average session attendance
Achievements
8
Total badges earned
Goal Completion
75%
Current goals achieved
Self Investment Chart

Self investment analytics over time

Revenue chart visualization coming soon...

Chart will display revenue trends over time
Complete Payment & Revenue History

All package payments and revenue transactions in one view

@forelse($invoices as $invoice) @empty @endforelse
Date Transaction Type Package/Item Duration Sessions Amount Status Method Evidence
{{ $invoice->created_at->format('Y-m-d') }} Invoice {{ $invoice->tenant->club_name ?? 'N/A' }} - - {{ $invoice->amount }} BHD @if($invoice->status == 'paid') ✓ Paid @elseif($invoice->status == 'due') ○ Due @else {{ ucfirst($invoice->status) }} @endif -
No invoices found

Member Attendance

Track your gym session attendance and performance

{{ $sessionsCompleted }}
Sessions Completed
{{ $noShows }}
No Shows
{{ $attendanceRate }}%
Attendance Rate
Session History
@forelse($attendanceRecords as $record) @empty @endforelse
Date & Time Session Type Trainer Name Status Notes
{{ $record->session_datetime->format('M j, Y') }}
{{ $record->session_datetime->format('g:i A') }}
{{ $record->session_type }} {{ $record->trainer_name }} @if($record->status === 'completed') Completed @else No Show @endif {{ $record->notes ?: '-' }}

No attendance records found

Health Metrics Overview

Monitor health metrics and progress over time

@if($latestHealthRecord) @php $latestDate = $latestHealthRecord->recorded_at; $now = \Carbon\Carbon::now(); $diff = $latestDate->diff($now); @endphp
Snapshot Date: {{ $latestDate->format('F j, Y') }}
Time Since: @if($diff->y > 0) {{ $diff->y }} {{ $diff->y == 1 ? 'year' : 'years' }} @endif @if($diff->m > 0) {{ $diff->m }} {{ $diff->m == 1 ? 'month' : 'months' }} @endif @if($diff->d > 0) {{ $diff->d }} {{ $diff->d == 1 ? 'day' : 'days' }} @endif ago
@else
No health records available
@endif
@if($latestHealthRecord)
{{ $latestHealthRecord->weight ?? 'N/A' }}
Weight (kg)
{{ $latestHealthRecord->body_fat_percentage ?? 'N/A' }}%
Body Fat
{{ $latestHealthRecord->body_water_percentage ?? 'N/A' }}%
Body Water
{{ $latestHealthRecord->muscle_mass ?? 'N/A' }}
Muscle Mass
{{ $latestHealthRecord->bone_mass ?? 'N/A' }}
Bone Mass
{{ $latestHealthRecord->bmr ?? 'N/A' }}
BMR (cal)
@else

No health metrics available

@endif
Body Composition Analysis
Compare
@if($comparisonRecords->count() >= 2) @php $current = $comparisonRecords->first(); $previous = $comparisonRecords->skip(1)->first(); @endphp
@if($current && $previous) Time between records: {{ calculateTimeDifference($current->recorded_at, $previous->recorded_at) }} @else Select dates to see time difference @endif
@php function getChangeIcon($current, $previous) { if ($current > $previous) return ''; if ($current < $previous) return ''; return ''; } @endphp
Metric Current Previous Change
Height {{ $current->height ?? 'N/A' }}cm {{ $previous->height ?? 'N/A' }}cm {!! $current->height && $previous->height ? getChangeIcon($current->height, $previous->height) : '-' !!}
Weight {{ $current->weight ?? 'N/A' }}kg {{ $previous->weight ?? 'N/A' }}kg {!! $current->weight && $previous->weight ? getChangeIcon($current->weight, $previous->weight) : '-' !!}
Body Fat {{ $current->body_fat_percentage ?? 'N/A' }}% {{ $previous->body_fat_percentage ?? 'N/A' }}% {!! $current->body_fat_percentage && $previous->body_fat_percentage ? getChangeIcon($current->body_fat_percentage, $previous->body_fat_percentage) : '-' !!}
BMI {{ $current->bmi ?? 'N/A' }} {{ $previous->bmi ?? 'N/A' }} {!! $current->bmi && $previous->bmi ? getChangeIcon($current->bmi, $previous->bmi) : '-' !!}
Body Water {{ $current->body_water_percentage ?? 'N/A' }}% {{ $previous->body_water_percentage ?? 'N/A' }}% {!! $current->body_water_percentage && $previous->body_water_percentage ? getChangeIcon($current->body_water_percentage, $previous->body_water_percentage) : '-' !!}
Muscle Mass {{ $current->muscle_mass ?? 'N/A' }}kg {{ $previous->muscle_mass ?? 'N/A' }}kg {!! $current->muscle_mass && $previous->muscle_mass ? getChangeIcon($current->muscle_mass, $previous->muscle_mass) : '-' !!}
Bone Mass {{ $current->bone_mass ?? 'N/A' }}kg {{ $previous->bone_mass ?? 'N/A' }}kg {!! $current->bone_mass && $previous->bone_mass ? getChangeIcon($current->bone_mass, $previous->bone_mass) : '-' !!}
Visceral Fat {{ $current->visceral_fat ?? 'N/A' }} {{ $previous->visceral_fat ?? 'N/A' }} {!! $current->visceral_fat && $previous->visceral_fat ? getChangeIcon($current->visceral_fat, $previous->visceral_fat) : '-' !!}
BMR {{ $current->bmr ?? 'N/A' }}cal {{ $previous->bmr ?? 'N/A' }}cal {!! $current->bmr && $previous->bmr ? getChangeIcon($current->bmr, $previous->bmr) : '-' !!}
Protein {{ $current->protein_percentage ?? 'N/A' }}% {{ $previous->protein_percentage ?? 'N/A' }}% {!! $current->protein_percentage && $previous->protein_percentage ? getChangeIcon($current->protein_percentage, $previous->protein_percentage) : '-' !!}
Body Age {{ $current->body_age ?? 'N/A' }}yrs {{ $previous->body_age ?? 'N/A' }}yrs {!! $current->body_age && $previous->body_age ? getChangeIcon($current->body_age, $previous->body_age) : '-' !!}
@else

Need at least 2 health records to compare

@endif
Health Tracking
@if($healthRecords->count() > 0)
@foreach($healthRecords as $record) @endforeach
Date Height (cm) Weight (kg) Body Fat % BMI Body Water % Muscle Mass (kg) Bone Mass (kg) Visceral Fat BMR Protein % Body Age
{{ $record->recorded_at->format('M j, Y') }} {{ $record->height ?? '-' }} {{ $record->weight ?? '-' }} {{ $record->body_fat_percentage ?? '-' }} {{ $record->bmi ?? '-' }} {{ $record->body_water_percentage ?? '-' }} {{ $record->muscle_mass ?? '-' }} {{ $record->bone_mass ?? '-' }} {{ $record->visceral_fat ?? '-' }} {{ $record->bmr ?? '-' }} {{ $record->protein_percentage ?? '-' }} {{ $record->body_age ?? '-' }}
{{ $healthRecords->links() }}
@else

No health records found

Health tracking data will appear here once records are added
@endif
Goal Tracking

Set, track, and achieve your fitness objectives.

{{ $activeGoalsCount }}

Active Goals

{{ $completedGoalsCount }}

Completed Goals

{{ $successRate }}%

Success Rate
@if($goals->count() > 0)
@foreach($goals as $goal)
@if($goal->status == 'active' && ($relationship->relationship_type == 'self' || Auth::id() == $relationship->guardian_user_id)) @endif
@if($goal->icon_type == 'dumbbell') @elseif($goal->icon_type == 'clock') @else @endif
{{ $goal->title }}
@if($goal->description)

{{ $goal->description }}

@endif
Progress: {{ number_format($goal->current_progress_value, 1) }} / {{ number_format($goal->target_value, 1) }} {{ $goal->unit }} {{ number_format($goal->progress_percentage, 1) }}%
Started: {{ $goal->start_date->format('M d, Y') }}
Target: {{ $goal->target_date->format('M d, Y') }}
{{ ucfirst($goal->status) }} {{ ucfirst($goal->priority_level) }}
@endforeach
@else
No Goals Set Yet

Start your fitness journey by setting your first goal!

@endif
Affiliations & Skills
@if($clubAffiliations->count() > 0)

{{ $totalAffiliations }}

Total Affiliations

{{ $distinctSkills }}

Distinct Skills

{{ floor($totalMembershipDuration / 12) }}y {{ $totalMembershipDuration % 12 }}m

Total Membership
Club Affiliations Timeline
@foreach($clubAffiliations as $index => $affiliation)
@if($affiliation->logo) {{ $affiliation->club_name }} @else
@endif
{{ $affiliation->club_name }}
{{ $affiliation->date_range }}
{{ $affiliation->formatted_duration }}
@if($affiliation->location)
{{ $affiliation->location }}
@endif
{{ $affiliation->skillAcquisitions->count() }} skills acquired
@endforeach
Skills Wheel

Select an affiliation to view skills

Affiliation Details

Select an affiliation from the timeline to view details

@else
No Affiliations Yet

Club affiliations and skills will appear here once added

@endif
Tournament & Event Participation

Proven champion with multiple championship wins and prestigious awards.

{{ $awardCounts['special'] }}

Special Award

{{ $awardCounts['1st'] }}

1st Place

{{ $awardCounts['2nd'] }}

2nd Place

{{ $awardCounts['3rd'] }}

3rd Place
Tournament & Championships History
@if($tournamentEvents->count() > 0)
@foreach($tournamentEvents as $event) @endforeach
Tournament Details Club Affiliation Performance & Result Notes & Media
{{ $event->title }}
{{ ucfirst($event->type) }} {{ $event->sport }}
{{ $event->date->format('M j, Y') }} @if($event->time) {{ $event->time->format('H:i') }} @endif @if($event->location) {{ $event->location }} @endif @if($event->participants_count) {{ $event->participants_count }} participants @endif
@if($event->clubAffiliation)
{{ $event->clubAffiliation->club_name }}
{{ $event->clubAffiliation->location }}
@else Individual @endif
@if($event->performanceResults->count() > 0) @foreach($event->performanceResults as $result)
@if($result->medal_type == '1st') 1st Place @elseif($result->medal_type == '2nd') 2nd Place @elseif($result->medal_type == '3rd') 3rd Place @elseif($result->medal_type == 'special') Special Award @endif @if($result->points) {{ $result->points }} pts @endif
@if($result->description) {{ $result->description }} @endif @endforeach @else No results recorded @endif
@if($event->notesMedia->count() > 0) @foreach($event->notesMedia as $note) @if($note->note_text)

{{ $note->note_text }}

@endif @if($note->media_link) View Media @endif @endforeach @else No notes available @endif
@else

No tournament records found

Tournament participation will appear here once records are added
@endif
Event Participation

Event history coming soon...

@endsection