<%@ Language=VBScript%> <%Response.Buffer = True%> <% 'Local Variables to be used in the page.. Dim ComID, bInit, bExecuted, fExecuted, pExecuted 'Initialize the Page for each server request adLockOptimistic = 3 InitializePage() %> <% '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Function InitializePage() bInit = CBool(Request.Querystring ("init")) If Request.Form("selComm") = "0" AND Not bInit Then messages = "You must select a committe to view voting results." Response.Clear Response.Redirect "error.asp?mess=" + Server.URLEncode(messages) Response.End End If If bInit <> Cint(False) then ComId = Cint(0) else ComID = Cint(Request.Form("selComm")) End IF End Function '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %> <% Set rsComm = Server.CreateObject("ADODB.Recordset") GetCommsApprove rsCOMM %> <% '************************ '* HTML Section '************************ %> Nomination and Voting System - Voting Results <% Title = "Voting Results" %>
<% If Not rsCOMM.EOF then %>
<% Else %>       Currently there are no committees in a voting period. <% Set rsCOMM = Nothing Set dbNVS = Nothing Response.End End If dbNVS.Close If Not bInit then Dim lngVOTE_TOTAL GetNumVotes lngVOTE_TOTAL, ComId Set objVote= Server.CreateObject("ADODB.Recordset") GetCommsPeople objVote, ComID %>

<% Do While Not objVote.EOF If Clng(objVote.fields("VOTES").value) <> Clng(0) AND Clng(lngVOTE_TOTAL) <> Clng(0)Then Percent = Clng((Clng(objVote.fields("VOTES").value) / Clng(lngVOTE_TOTAL)) * 100) Else Percent = Clng(0) End If %> <%objVote.MoveNext Loop%>
Name Division Votes Percent
<%=objVote.fields("F_NAME").value + " " + objVote.fields("L_NAME").value%> <%=objVote.fields("DIVISION").value%> <%=objVote.fields("VOTES").value %> <%=Cint(Percent)%>%
<% 'cleaning dbNVS.Close Set objVote = Nothing Set rsComm = Nothing Set dbNVS = Nothing End if %> <% Response.End %>