prepare("SELECT * FROM elections WHERE id = ?"); $stmt->execute([$id]); $election = $stmt->fetch(); if (!$election || $election['status'] !== 'Ongoing') { die("Election is not currently ongoing."); } // Check if already voted $check = $pdo->prepare("SELECT COUNT(*) FROM votes WHERE election_id = ? AND voter_id = ?"); $check->execute([$id, $user['id']]); if ($check->fetchColumn() > 0) { header("Location: index.php?error=already_voted"); exit; } $positions = $pdo->prepare("SELECT * FROM positions WHERE election_id = ? ORDER BY sort_order ASC"); $positions->execute([$id]); $positions = $positions->fetchAll(); $endTime = strtotime($election['end_date_and_time']) * 1000; ?> Ballot: <?= htmlspecialchars($election['title']) ?>

Review the candidates carefully and cast your secure vote below.

Voter Information
00:00:00
Grade
$pos): ?>
prepare($sql); $cStmt->execute($params); $candidates = $cStmt->fetchAll(); ?>

No candidates available for your track.

Ready to submit?

Review your selections