prepare("SELECT * FROM elections WHERE id = ?"); $stmt->execute([$id]); $election = $stmt->fetch(); if (!$election) { die("Election not found."); } $positions = $pdo->prepare("SELECT * FROM positions WHERE election_id = ? ORDER BY sort_order ASC"); $positions->execute([$id]); $positions = $positions->fetchAll(); $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Online Election System'; ?> <?= htmlspecialchars($election['title']) ?> | Manage

Status: | Period: to

Positions

No positions defined yet.

prepare("SELECT COUNT(*) FROM candidates WHERE position_id = ?"); $cStmt->execute([$pos['id']]); $cCount = $cStmt->fetchColumn(); ?>
Position Name Max Votes Candidates Actions
Candidates

Quick Stats

prepare("SELECT COUNT(DISTINCT voter_id) FROM votes WHERE election_id = ?"); $vStmt->execute([$id]); $votesCount = $vStmt->fetchColumn(); ?>
Total Votes Cast
prepare("SELECT COUNT(*) FROM candidates WHERE election_id = ?"); $canStmt->execute([$id]); $candidatesTotal = $canStmt->fetchColumn(); ?>
Total Candidates