@extends('admin.layouts.app') @section('title','Elections') @section('page-title','Elections') @section('page-subtitle','Setup elections, positions, candidates and view results') @section('elections-active','active') @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
Election OTP Settings Bulk Import Voters @unless($otpChannelsEnabled ?? true) No OTP channels configured @endunless
Create Election
@csrf
Elections
@forelse($elections as $election) {{ $election->title }}
{{ $election->conference?->name }} · {{ ucfirst($election->status) }}
@empty

No elections yet.

@endforelse {{ $elections->links() }}
@if($selectedElection)
{{ $selectedElection->title }}

{{ $selectedElection->start_time?->format('M d, Y H:i') }} — {{ $selectedElection->end_time?->format('M d, Y H:i') }}

Eligible voters: {{ $selectedElection->eligibleVoters->count() }} · Voted: {{ $selectedElection->eligibleVoters->where('voting_status', 'voted')->count() }}

View Results @if($selectedElection->otp_required)
@csrf
@endif
@if($selectedElection->otp_required && $selectedElection->eligibleVoters->isNotEmpty())
@foreach($selectedElection->eligibleVoters as $voter) @endforeach
VoterContactStatusOTP
{{ $voter->full_name }}
{{ $voter->membership_number }}
{{ $voter->email ?: $voter->user?->email ?: '—' }}
{{ $voter->phone_number ?: $voter->user?->phone_number ?: '—' }}
{{ str_replace('_', ' ', ucfirst($voter->voting_status)) }} @if($voter->otp_locked_until && $voter->otp_locked_until->isFuture()) Locked @elseif($voter->otp_last_sent_at) Sent {{ $voter->otp_last_sent_at->diffForHumans() }} @else Not sent @endif @if($voter->voting_status !== 'voted')
@csrf
@endif
@endif
@foreach($selectedElection->positions as $position)
{{ $position->title }}
    @foreach($position->candidates as $candidate) @php $votes = $results->firstWhere('candidate_id', $candidate->id)?->vote_count ?? 0; @endphp
  • {{ $candidate->full_name }} — {{ $votes }} votes
  • @endforeach
@csrf
@endforeach
@csrf
@endif
@endsection