loggedin()) { header('Location: /login.php'); die(); } if (!$user->voterId()) { header('Location: /login.php?denied'); die(); } $header = new Header("Michigan Flyers Election"); $header->addStyle("/styles/style.css"); $header->addScript("/js/jquery-1.11.3.min.js"); $header->addScript("/js/search.js"); $header->setAttribute('title', 'Michigan Flyers'); $header->setAttribute('tagline', 'Online Ballot'); $header->output(); $candidates = $db->fetchAssoc('select skymanager_id, name, username, coalesce(email, "") as `gravatar_email` from members where voting_id is not null'); $votes = $db->fetchAssoc("select position from votes where member_id={$user->voterId()}"); $position = $db->fetchRow("select position as code, description as label from positions where active<>0 limit 1"); get_gravatar_assoc($candidates); foreach ($votes as &$vote) { $vote = $vote['position']; } unset($vote); ?>