% pollid=request("p") if pollid="" or not(isnumeric(pollid)) then response.end zoneid=request("z") msg=request("msg") if msg="already" then msg=alreadyvotedmsg elseif msg="voted" then msg=thankyou end if set conn=server.createobject("ADODB.Connection") conn.open connection '//// Get poll properties //// psql="select * from xlaAPMpolls where pollid="&pollid set rs=conn.execute(psql) if not(rs.eof) then allowcomments=rs("allowcomments") allowviewresults=rs("allowviewresults") allowmultiplevotes=rs("allowmultiplevotes") displaynumbers=rs("displaynumbers") displaycomments=rs("displaycomments") displaytotalreplies=rs("displaytotalreplies") viewtextreplies=rs("viewtextreplies") pollreplies=rs("pollreplies") inprevious=rs("inprevious") status=rs("status") end if rs.close set rs=nothing '/// get Answers with replies if allowviewresults<>"" or (inprevious<>"" and status=0) then psql="SELECT Sum(numreply) AS totalreplies, answerid FROM xlaAPMreplies where answerid in (select answerid from xlaAPManswers where questionid in (select questionid from xlaAPMquestions where pollid="&pollid&")) GROUP BY answerid;" set conn=server.createobject("ADODB.Connection") conn.open connection set d=Server.CreateObject("Scripting.Dictionary") set rs=conn.execute(psql) do until rs.eof answerid=rs("answerid") totalreplies=rs("totalreplies") d.add answerid,totalreplies rs.movenext loop rs.close set rs=nothing end if '/// Check if Zone allows for previous polls if zoneid<>"" then psql="select zoneid from xlaAPMzones where zoneid="&zoneid&" and allowprevious<>''" set rs=conn.execute(psql) if rs.eof then allowprevious="" else allowprevious="checked" rs.close set rs=nothing end if conn.close set conn=nothing response.buffer=true response.flush %>
|
| <%=msg%> | ||
| <%=qnumber & rs("question")%> | ||
| <%=answer%> | <%=replies%> |
|
| <%=answer%> | <%=averagescale%> | |
|
||
| Replies to this question are not available. | ||
Total Replies : <%=pollreplies%> |
||