Student Rank Dashboard
Current rank, progress, testing and promotion history.
Current Rank @if($rankProgress['current_rank'])
{{ $rankProgress['current_rank']->title }}
{{ $contact->currentRankStyle?->title }}
@else
No Rank Assigned
@endif
Rank Achieved Date
@if($rankProgress['rank_achieved_date']) {{ $rankProgress['rank_achieved_date']->format('d M Y') }} @else Not Assigned @endif
{{ $contact->currentRankStyle?->title ?? '-' }}
Next Rank @if($rankProgress['next_rank'])
{{ $rankProgress['next_rank']->title }}
@else
@if($rankProgress['current_rank']) Highest Rank Achieved @else No Rank Available @endif
@endif
Overall Progress @if($rankProgress['current_rank'])
{{ $rankProgress['overall_progress'] }}%
@if($rankProgress['next_rank']) @if($rankProgress['estimated_eligibility_date']) Estimated : {{ $rankProgress['estimated_eligibility_date']->format('d M Y') }} @else Pending @endif @else Completed @endif @else
0%
Not Started @endif
@if($rankProgress['current_rank']) @foreach([['Days',$rankProgress['days_progress'],$rankProgress['completed_days'],$rankProgress['required_days'],$rankProgress['remaining_days']],['Classes',$rankProgress['classes_progress'],$rankProgress['completed_classes'],$rankProgress['required_classes'],$rankProgress['remaining_classes']],['Skills',$rankProgress['skills_progress'],$rankProgress['completed_skills'],$rankProgress['required_skills'],$rankProgress['remaining_skills']],['Testing',$rankProgress['testing_progress'],$rankProgress['testing_satisfied'] ? 1 : 0,1,$rankProgress['testing_satisfied'] ? 0 : 1]] as $metric)
{{ $metric[0] }}{{ $metric[1] }}%
{{ $metric[2] }} / {{ $metric[3] }} @if($metric[4] > 0) · {{ $metric[4] }} remaining @else · Complete @endif
@endforeach @else @foreach([ 'Days', 'Classes', 'Skills', 'Testing' ] as $title)
{{ $title }} 0%
Not Started
@endforeach @endif
Eligibility Summary
@if($rankEligibility['eligible']) Eligible for Promotion @else {{ count($rankEligibility['reasons']) }} {{ \Illuminate\Support\Str::plural('Requirement', count($rankEligibility['reasons'])) }} Remaining @endif
@unless($rankEligibility['eligible'])
@foreach($rankEligibility['reasons'] as $reason)
{{ $reason['label'] }}
@endforeach
@endunless
@if($rankProgress['next_rank'])
Required Skills - {{ $rankProgress['next_rank']->title }}
@can('student-rank-skill.edit')
@endcan @can('student-rank-skill.edit') @endcan @foreach($rankProgress['skill_details'] as $item) @can('student-rank-skill.edit') @endcan @endforeach
Skill Status Completed Date Completed By Actions
{{ $item['title'] }} @if($item['completed']) Completed @else Missing @endif {{ optional($item['completed_at'])->format('d M Y') ?: '-' }} {{ $item['completed_by']?->name ?? $item['completed_by']?->title ?? '-' }} @can('student-rank-skill.edit') @if($item['completed'])
@csrf
@else
@csrf
@endif @endcan
@endif
Upcoming Testing
@foreach($upcomingTestingRegistrations as $registration) @endforeach
Testing Event Date Attempt Registration Payment Sent Invitation Link Fee
{{ $registration->event_name_snapshot }} {{ optional($registration->event?->event_date)->format('d M Y') ?: '-' }} #{{ $registration->attempt_number }} @php $registrationBadge = match($registration->registration_status) { 'registered' => 'bg-success', 'invited' => 'bg-info', 'pending' => 'bg-warning text-dark', 'cancelled' => 'bg-danger', default => 'bg-secondary', }; @endphp {{ ucwords(str_replace('_', ' ', $registration->registration_status)) }} @php $paymentBadge = match($registration->payment_status) { 'paid' => 'bg-success', 'pending' => 'bg-warning text-dark', 'not_required' => 'bg-secondary', 'failed' => 'bg-danger', default => 'bg-secondary', }; @endphp {{ ucwords(str_replace('_', ' ', $registration->payment_status)) }} {{ $registration->invited_at ? '' . $registration->invited_at->format('d M Y') : '-' }} @if($registration->isInvitationValid()) Valid @else Expired @endif {{ currency_symbol() }}{{ number_format((float) $registration->fee_amount, 2) }}
@if($availableTestingEventRanks->isNotEmpty()) @php $eligibleEvents = $availableTestingEventRanks->reject(function ($eventRank) use ($rankTestingHistory) { return $rankTestingHistory->contains(function ($registration) use ($eventRank) { return $registration->rank_testing_event_rank_id == $eventRank->id && in_array($registration->registration_status, [ 'invited', 'registered', ], true); }); }); @endphp @if($eligibleEvents->isNotEmpty())
Invite to Testing Event
@foreach($eligibleEvents as $eventRank)
@csrf
@endforeach
@endif @endif
Promotion History
@foreach($rankPromotionHistory as $promotion) @endforeach
Previous Rank New Rank Promotion Date Approved By Notes / Override
@if($promotion->previousRank)
{{ $promotion->previousRank->title }}
@else {{ $promotion->previous_rank_title ?? '-' }} @endif
@if($promotion->newRank)
{{ $promotion->newRank->title }}
@else {{ $promotion->new_rank_title }} @endif
{{ optional($promotion->promotion_date)->format('d M Y') ?: '-' }} {{ $promotion->promotedBy?->name ?? '-' }} @if($promotion->notes) {{ $promotion->notes }} @else - @endif
Testing History
@foreach($rankTestingHistory as $registration) @endforeach
Testing Event Attempt Result
{{ $registration->event_name_snapshot }} #{{ $registration->attempt_number }} @php $result = strtolower($registration->result?->result ?? 'pending'); $resultBadge = match($result) { 'passed' => 'bg-success', 'failed' => 'bg-danger', 'pending' => 'bg-warning text-dark', default => 'bg-secondary', }; @endphp {{ ucwords($result) }}
Testing Payment History
@foreach($testingPaymentHistory ?? collect() as $transaction) @php($reference = data_get($transaction->gateway_response, 'reference') ?: data_get(json_decode($transaction->response ?: '{}', true), 'reference')) @endforeach
Transaction Date Amount Payment Method Status Transaction ID
{{ optional($transaction->paid_at ?? $transaction->created_at)->format('d M Y') ?: '-' }} {{ currency_symbol() }}{{ number_format((float) $transaction->amount, 2) }} {{ $transaction->paymentMethod?->card_brand ? $transaction->paymentMethod->card_brand.' •••• '.$transaction->paymentMethod->last_four : ($transaction->payment_type ?: '-') }} {{ (string)$transaction->status === '1' ? 'Paid' : 'Failed' }} {{ $transaction->transaction_id ?: '-' }}