ACE Voting Online SystemAn error has occurred (cannot find election).
"; // error_message(sql_error()); } else if(mysql_num_rows($findElectionRslt) == 1) { $electionInfo = mysql_fetch_array($findElectionRslt); echo "Election Results for: {$electionInfo['ElectionName']}
"; echo "Election Description: {$electionInfo['ElectionDescript']}
"; echo "Election Closed Date: ".timeconvert($electionInfo['EndDate'])."
"; if($electionInfo['PostResults'] == 'show') {$postresults = "Yes"; }else{ $postresults = "No"; } echo "Election Results Open to Members: $postresults
"; switch( $electionInfo['MemStatusOnly'] ) { case '1': $onlyfor = "Members Only"; break; case '0': $onlyfor = "Everyone"; break; } switch( $electionInfo['Location'] ) { case '1': $onlyat = "Foothill"; break; case '2': $onlyat = "De Anza"; break; case '4': $onlyat = "Central Services"; break; case '0': $onlyat = "All District Locations"; break; case '0': $onlyat = "Anywhere"; break; } echo "Election opened to $onlyfor at $onlyat
"; if(! empty ($electionInfo['DefaultInfoPath'])) { echo "Link to additional information about the Election. (Note: may no longer be available)
"; } echo "An error has occurred (cannot find eligible members).
"; // error_message(sql_error()); } else { list($eligibleVoters) = mysql_fetch_array($findVotersRslt); } $findWhoVoted = "select count(*) from Members where VoteParticipate like '%$e%' "; $findWhoVotedRslt = mysql_query($findWhoVoted); if(!$findWhoVotedRslt) { echo "An error has occurred (cannot find who voted).
"; // error_message(sql_error()); } else { list($whovoted) = mysql_fetch_array($findWhoVotedRslt); } if($eligibleVoters != 0 && $whovoted != 0) { $responserate = round( ($whovoted/$eligibleVoters) * 100,1)."%"; } echo "| Number of Eligible Voters: $eligibleVoters, Number Who Voted: $whovoted, Response Rate: $responserate |
Error: Cannot find vote candidates
"; } else if(mysql_num_rows($findCandidatesRslt) == 0) { echo "No vote candidates found.
"; } else { mysql_data_seek($findCandidatesRslt,0); $categorylist = ""; while( $candvote = mysql_fetch_array($findCandidatesRslt) ) { if($categorylist != $candvote['CategoryName']) { echo "Error: Cannot get Candidate ID: {$candvote['CandidateID']} count.
"; } else { list($SingleCount) = mysql_fetch_array($getSingleCountRslt); } if($SingleCount > 0 && $SingleCount < $barlengthvalue) { $barlength = (int)( $barlengthvalue * ($SingleCount/$barlengthvalue) ); } else if($SingleCount > 0 && $SingleCount > $barlengthvalue) { $barlength = (int)( $barlengthvalue - 50 ); } // 50 is to allow room for number else { $SingleCount = 0; $barlength = 0; } echo "({$candvote['BallotOrder']}) $CandidateNameError: Cannot find vote candidates
"; } else { if(mysql_num_rows($findCandidatesRslt) == 0) { echo "No vote candidates found.
"; } if(mysql_num_rows($findCandidatesRslt) > 0) { $categorylist = ""; while( $candvote = mysql_fetch_array($findCandidatesRslt) ) { if($categorylist != $candvote['CategoryName']) { echo "Error: Cannot get Candidate ID: {$candvote['CandidateID']} count.
"; } else { list($SingleCount) = mysql_fetch_array($getSingleCountRslt); } if($SingleCount > 0 && $SingleCount < $barlengthvalue) { $barlength = (int)( $barlengthvalue * ($SingleCount/$barlengthvalue) ); } else if($SingleCount > 0 && $SingleCount > $barlengthvalue) { $barlength = (int)( $barlengthvalue - 50 ); } // 50 is to allow room for number else { $SingleCount = 0; $barlength = 0; } echo "({$candvote['BallotOrder']}) $CandidateName**************************** Write-In Candidates
"; $findWriteIns = "select distinct CandWriteIn from SessionVotes where ElectVoteID='$e' and CandVoteID='0' and (CandWriteIn is not null) order by CandWriteIn "; $findWriteInsRslt = mysql_query($findWriteIns); if(!$findWriteInsRslt) { // error_message(sql_error()); echo "Error: Cannot find write-in candidates
"; } else if(mysql_num_rows($findWriteInsRslt) == 0) { echo "No write-in candidates found.
"; } else { while( $writeincandvote = mysql_fetch_array($findWriteInsRslt) ) { $getSingleCount = "select count(*) from SessionVotes where CandWriteIn='{$writeincandvote['CandWriteIn']}' and ElectVoteID='$e' "; $getSingleCountRslt = mysql_query($getSingleCount); if(!$getSingleCountRslt) { // error_message(sql_error()); echo "Error: Cannot get Write-In Candidate: {$writeincandvote['CandWriteIn']} count.
"; } else { list($SingleCount) = mysql_fetch_array($getSingleCountRslt); } if($SingleCount > 0 && $SingleCount < $barlengthvalue) { $barlength = (int)( $barlengthvalue * ($SingleCount/$barlengthvalue) ); } else if($SingleCount > 0 && $SingleCount > $barlengthvalue) { $barlength = (int)( $barlengthvalue - 50 ); } // 50 is to allow room for number else { $SingleCount = 0; $barlength = 0; } echo "(Write-In) {$writeincandvote['CandWriteIn']}Error: Cannot find vote tickets candidates
"; } else if(mysql_num_rows($findCandidatesRslt) == 0) { echo "No vote ticket candidates found.
"; } else { $cateCountArray = ""; while($candvote = mysql_fetch_array($findCandidatesRslt)) { $getAllCount = "select count(*) from SessionVotes where CategoryVote='{$candvote['Category']}' and ElectVoteID='$e' "; $getAllCountRslt = mysql_query($getAllCount); if(!$getAllCountRslt) { // error_message(sql_error()); echo "Error: Cannot get count for Category {$candvote['Category']}.
"; } else { list($cateCountArray[$candvote['Category']]) = mysql_fetch_array($getAllCountRslt); } } mysql_data_seek($findCandidatesRslt,0); $ticketList = ""; while( $candvote = mysql_fetch_array($findCandidatesRslt) ) { if($ticketList != $candvote['PresTicket']) { echo "Error: Cannot get Candidate ID: {$candvote['CandidateID']} count.
"; } else { list($SingleCount) = mysql_fetch_array($getSingleCountRslt); } if($SingleCount > 0 && $SingleCount < $barlengthvalue) { $barlength = (int)( $barlengthvalue * ($SingleCount/$barlengthvalue) ); } else if($SingleCount > 0 && $SingleCount > $barlengthvalue) { $barlength = (int)( $barlengthvalue - 50 ); } // 50 is to allow room for number else { $SingleCount = 0; $barlength = 0; } echo "$CandidateName, ({$candvote['CategoryName']})An error has occurred (cannot find measures).
"; // error_message(sql_error()); } else if( mysql_num_rows($findMeasureVotesRslt) > 0 ) { $measuretitle = ""; echo "| {$measureresult['MeasureChoiceName']} -- Number of votes: $votecount |
There are no Measures associated with this election.
"; } } } else { echo "Results for this election are not available
"; } ?>