@extends('layouts.dashboard') @section('title', 'Results — ' . $election->title) @section('content')
Back

Election Results

{{ $election->title }}

PDF Excel
{{ number_format($totalVoters) }}
Registered Voters
{{ number_format($votedVoters) }}
Votes Cast
{{ $turnout }}%
Turnout
@foreach($positions as $position)
{{ $position->name }} {{ $position->votes_count }} votes
@foreach($position->candidates as $i => $candidate) @php $pct = $position->votes_count > 0 ? round(($candidate->votes_count / $position->votes_count) * 100, 1) : 0; @endphp @endforeach
# Candidate Votes Percentage Status
{{ $i + 1 }} @if($i === 0 && $position->votes_count > 0) @endif {{ $candidate->name }} {{ $candidate->votes_count }}
{{ $pct }}%
@if($i === 0 && $position->votes_count > 0) WINNER @else @endif
@endforeach @endsection