@extends('layouts/contentNavbarLayout') @section('title', 'Challenge Details - ' . $challenge->title) @section('content')
@if($challenge->image) {{ $challenge->title }} @else
@endif

{{ $challenge->title }}

{{ $challenge->description }}

@if($challenge->status === 'upcoming') Upcoming Challenge @elseif($challenge->status === 'active') Active Challenge @else Completed Challenge @endif
Edit
Company {{ $challenge->company->name }}
Start Date & Time {{ \Carbon\Carbon::parse($challenge->start_date)->format('M j, Y') }} at {{ \Carbon\Carbon::parse($challenge->start_time)->format('g:i A') }}
End Date & Time {{ \Carbon\Carbon::parse($challenge->end_date)->format('M j, Y') }} at {{ \Carbon\Carbon::parse($challenge->end_time)->format('g:i A') }}
{{ ucfirst($challenge->type) }} @if($challenge->is_steps_goal) Goal: {{ number_format($challenge->steps_goal) }} steps @endif @if($challenge->is_max_team_members) Max {{ $challenge->max_team_members }} per team @endif @if($challenge->is_points_prize) {{ $challenge->points_prize }} points prize @endif

{{ $challenge->firstDepartment->name }} VS {{ $challenge->secondDepartment->name }}

{{ $challenge->firstDepartment->name }} @if($currentLeader === 'first') @endif

{{ $firstTeamStats['total_participants'] }}

Participants

{{ number_format($firstTeamStats['total_steps']) }}

Total Steps

{{ number_format($firstTeamStats['total_distance']) }}

Total Distance

{{ number_format($firstTeamStats['average_steps']) }}

Avg Steps
@if($firstTeamStats['top_performer'])
Top Performer {{ $firstTeamStats['top_performer']->name }}
{{ number_format($firstTeamStats['top_performer']->pivot->steps) }} steps
@endif
{{ $challenge->secondDepartment->name }} @if($currentLeader === 'second') @endif

{{ $secondTeamStats['total_participants'] }}

Participants

{{ number_format($secondTeamStats['total_steps']) }}

Total Steps

{{ number_format($secondTeamStats['total_distance']) }}

Total Distance

{{ number_format($secondTeamStats['average_steps']) }}

Avg Steps
@if($secondTeamStats['top_performer'])
Top Performer {{ $secondTeamStats['top_performer']->name }}
{{ number_format($secondTeamStats['top_performer']->pivot->steps) }} steps
@endif
@if($challenge->is_steps_goal)
Progress to Goal: {{ number_format($challenge->steps_goal) }} steps
{{ $challenge->firstDepartment->name }}
{{ $challenge->secondDepartment->name }}
{{ number_format(($firstTeamStats['total_steps'] / $challenge->steps_goal) * 100, 1) }}% Complete {{ number_format(($secondTeamStats['total_steps'] / $challenge->steps_goal) * 100, 1) }}% Complete
@endif @if($challenge->winner_department_id)

{{ $challenge->winnerDepartment->name }} Wins!

Congratulations to the winning team!

@elseif($goalReached)
Goal Reached!

@if($goalReached === 'first') {{ $challenge->firstDepartment->name }} reached the goal first! @else {{ $challenge->secondDepartment->name }} reached the goal first! @endif

@endif
@if($challenge->prize_description || $challenge->is_points_prize)
Prize Information
@if($challenge->is_points_prize)
Points Prize: {{ $challenge->points_prize }} points for each winning team member
@endif @if($challenge->prize_description)

{{ $challenge->prize_description }}

@endif
@endif
{{ $challenge->firstDepartment->name }} Team
@if($challenge->firstTeam->count() > 0)
@foreach($challenge->firstTeam->take(10) as $index => $participant) @endforeach
Rank Participant Steps Distance
{{ $index + 1 }} @if($index === 0) @endif
{{ substr($participant->name, 0, 1) }}
{{ $participant->name }}
{{ $participant->email }}
{{ number_format($participant->pivot->steps) }} {{ number_format($participant->pivot->distance) }}
@if($challenge->firstTeam->count() > 10) @endif @else

No participants yet

@endif
{{ $challenge->secondDepartment->name }} Team
@if($challenge->secondTeam->count() > 0)
@foreach($challenge->secondTeam->take(10) as $index => $participant) @endforeach
Rank Participant Steps Distance
{{ $index + 1 }} @if($index === 0) @endif
{{ substr($participant->name, 0, 1) }}
{{ $participant->name }}
{{ $participant->email }}
{{ number_format($participant->pivot->steps) }} {{ number_format($participant->pivot->distance) }}
@if($challenge->secondTeam->count() > 10) @endif @else

No participants yet

@endif
@endsection