@extends('layouts.app', ['header' => true, 'header_image' => false, 'close_button' => false]) @section('back_button') @endsection @section('content') {{-- show header --}} {{-- @include('include.leaderboard.event-header', ['collection' => getLiveChallenge(), 'score' => false]) --}}
{{ $division->code }}-{{ $division->name }}
@php $totalScore = 0; @endphp @php $scores = \App\Models\UserScore::all(); $userRank = 0; $overAllRank = 0; // foreach ($user->joinedChallenges->whereNotNull('challenge_id')->where('status', '1') as $completedChallenge) { // $userRank += $scores // ->whereNotNull('total_score') // ->where('user_id', $user->id) // ->where('challenge_id', $completedChallenge->challenge_id) // ->first() // ? $scores // ->whereNotNull('total_score') // ->where('user_id', $user->id) // ->where('challenge_id', $completedChallenge->challenge_id) // ->first()->rank // : 0; // $overAllRank += $scores // ->whereNotNull('total_score') // ->where('challenge_id', $completedChallenge->challenge_id) // ->count(); // } $week = 1; @endphp
{{ $user->username ?? '' }}

{{ strtoupper(getAddress($user->user_details)) }}

@if ($user->user_details->userCountry) {{-- COUNTRY FLAG --}} @include('include.country-flag.flag', ['user' => $user]) {{--

{{ $user->user_details->userCountry->iso_code ?? '' }}

--}} @endif

Affiliation {{ $user->user_details->affiliation }}

Performance summary

@inject('scores', 'App\Models\UserScore')

Overall current ranking

{{ $userScore->over_all_rank ?? 'N/A' }}

out of

{{ session('overAllRank') ?? 'N/A' }}

Click on the Challenge No. to view that weeks performance

@foreach (getLast8WeekChallenges() as $index => $completedChallenge)

Week {{ $week++ }}

Challenge No.

@if($completedChallenge !== null)
{{ $completedChallenge->challenge_code ?? '' }}
@else
{{ 'N/A' }}
@endif

Ranking

{{-- {{ $scores->whereNotNull('total_score')->where(['division_id' => $division->id , 'user_id' => $user->id, 'challenge_id' => $challenge->id])->first() ? $scores->whereNotNull('total_score')->where(['division_id' => $division->id , 'user_id' => $user->id, 'challenge_id' => $challenge->id ])->first()->rank : 'N/A' }} --}} {{ $user->userChallengeRank($completedChallenge, $division, request()->division_type) }}

out of

{{-- {{ $scores->whereNotNull('total_score')->where(['division_id' => $division->id , 'challenge_id' => $challenge->id])->get()->count() }} --}} @if($completedChallenge !== null) {{ $completedChallenge->totalDivisionRank($division, request()->division_type) }} @else {{ 'N/A' }} @endif
@endforeach
{{-- show user score --}} {{-- @include('include.leaderboard.user-score' , ['user' => $user , 'score' => false , 'collection' => $event]) --}} {{-- COMMENT SECTION --}} {{--
@include('include.leaderboard.comments', [ 'type' => 'challenge', 'user' => $user, 'collection' => $challenge, 'for' => 'old-challenge', 'division' => $division ])
--}} @endsection