@extends('layouts.user') @section('title', 'Physiotherapist Dashboard') @section('content') @php // Calculate real statistics from database $totalDocs = \App\Models\PortalUserDoc::where('portal_user_id', $user->id)->count(); $uploadedDocs = \App\Models\PortalUserDoc::where('portal_user_id', $user->id) ->whereNotNull('document_path')->count(); $stateChangeRequests = \App\Models\StateChangeRequest::where('user_id', $user->id)->count(); $pendingStateChanges = \App\Models\StateChangeRequest::where('user_id', $user->id) ->where('status', 'pending')->count(); $profileFields = ['fname', 'lname', 'email', 'mobile', 'dob', 'gender', 'address', 'pincode']; $filledFields = 0; foreach($profileFields as $field) { if(!empty($user->$field)) $filledFields++; } $profileCompletion = round(($filledFields / count($profileFields)) * 100); $membershipValid = false; $daysUntilExpiry = 0; if($user->valid_up_to) { $expiryDate = \Carbon\Carbon::parse($user->valid_up_to); $daysUntilExpiry = now()->diffInDays($expiryDate, false); $membershipValid = $daysUntilExpiry > 0; } @endphp

Physiotherapist Dashboard

Welcome back, {{ $user->fname ?? $user->name }}! Help athletes recover and perform their best!

Active Roles

{{ $user->activeRoles->count() }}

Current: Physiotherapist

Documents

{{ $uploadedDocs }}/{{ $totalDocs }}

{{ $totalDocs > 0 ? round(($uploadedDocs/$totalDocs)*100) : 0 }}% uploaded

State Changes

{{ $pendingStateChanges }}/{{ $stateChangeRequests }}

{{ $pendingStateChanges }} pending

Profile

{{ $profileCompletion }}%

Completed

Events

Browse and register for events

View Events
{{-- DISABLED: Black Belt Certificate Card (Route Disabled) --}} {{--
Certificates

Access your achievements

View Certificates
--}}
Profile

{{ $profileCompletion }}% profile completed

Edit Profile
Documents

{{ $uploadedDocs }} of {{ $totalDocs }} uploaded

View Documents
Account Information

Name

{{ $user->fname }} {{ $user->lname }}

Unique ID

{{ $user->u_id ?? 'Not assigned' }}

Account Status

@if($user->status == 'approved') Approved @elseif($user->status == 'pending') Pending @else {{ ucfirst($user->status) }} @endif

Membership Validity

@if($membershipValid) Valid ({{ $daysUntilExpiry }} days left) @else Expired/Invalid @endif

@endsection