?? showvote.asp
字號:
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="format.asp"-->
<%
dim itemid,founderr,errmsg,itemname
founderr=false
errmsg=""
if request.querystring("vt_id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必須指定投票的主題!"
else
if not isInteger(request.querystring("vt_id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的投票主題的id參數。"
else
vtid=cint(request.querystring("vt_id"))
end if
end if
if founderr then
call diserror()
response.end
else
%>
<html>
<head>
<title>投票結果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/style.css" type="text/css">
</head>
<body leftMargin=0 topMargin=0 rightMargin=0 marginwidth="0" marginheight="0">
<table width="99%" border="1" align="center" cellpadding="10" cellspacing="0" bordercolor="#09DD77F" bgcolor="#FFFFFF" style="border-collapse: collapse">
<tr>
<td colspan="2" align="center" bgcolor="#09DD77" ><img src="images/img.gif" width="18" height="13" align="top">
<B>投票結果</B></td>
</tr>
<%
sql="select vt_name from votetopic where vt_id="&vtid
set rs=conn.execute(sql)
%>
<tr>
<td colspan="2" align="center" width="100%"><B><%=rs("vt_name")%></B></td>
</tr>
<%sql="select * from voteitem where vt_id="&vtid
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
totalvote=0
rs2.movefirst
do while not rs2.eof
totalvote=totalvote+rs2("item_count")
rs2.movenext
loop
rs2.movefirst
do while not rs2.eof
%>
<tr>
<td width="20%"> <%=rs2("item_name")%></td>
<td width="80%"><img src="images/votebar.gif" width="<%= FormatNumber((rs2("item_count")/totalvote*500),4) %>" height="14" title="<%=rs2("item_count")%>票"></td>
</tr>
<%rs2.movenext
loop
if rs2.eof and rs2.bof then%>
<tr>
<td colspan="2" align="center" width="100%">當前沒有投票選項!</td>
</tr>
<%end if
rs2.close
set rs2=nothing%>
<tr>
<td height="30" colspan="2" align="center" width="100%">
<%if request.cookies("npw")("voted")<>"yes" then%>
您尚未投票!
<%else%>
您已經投過票了
<%end if%>
。總計票數<span class="newshead"><%=totalvote%></span>票 </td>
</tr>
<tr>
<td colspan="2" align="center" width="100%">[<a href="javascript:window.close()">關閉窗口</a>]</td>
</tr>
<tr>
<td colspan="2" align="center"> </td>
</tr>
</table>
</body>
</html>
<%
end if
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -