📄 stat.asp
字号:
<!--#include file="conn.asp"--><%
dim sql,rs
dim lastid
dim total
lastid=encodestr(Request.querystring("ID"))
if lastid="" then
response.write "请选择一个投票!"
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select sum(votes) from vote where id="&lastid
rs.open sql,conn,1,1
if rs.eof then
rs.close
set rs=nothing
response.write "数据已经被破坏!"
response.end
end if
total=rs(0)
rs.close
sql="select * from vote where id="&lastid&" order by options"
rs.open sql,conn,1,1
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {color: #0000CC}
.style4 {
color: #3366FF;
font-style: italic;
}
.style6 {color: #FF0000}
.ttr {
color: #3366FF;
margin: 0px;
padding: 0px;
border-top: thin none;
border-right: medium none;
border-bottom: 1px dotted #A4D1FF;
border-left: thin none;
}
-->
</style>
</head>
<body>
<table width="300" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#9B9BFF">
<tr>
<td width="21%" height="35" bgcolor="#BBD3F4" class="style4">投票:<%= rs("title") %></td>
</tr>
<tr>
<td height="168" bordercolor="#333333" bgcolor="#D7E8FB"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
rs.movenext
while not rs.eof %>
<tr valign="middle" class="ttr">
<td width="12%" height="22" align="center" class="ttr"><strong class="style1"> <%= Chr(64+rs("options")) %>.</strong></td>
<td width="76%" valign="bottom" class="ttr" > <img src="images/bar<%= rs("options") %>.gif" width="<%= round(rs("votes")/total*100,2)%>%" height="10"> </td>
<td width="7%" align="center" class="ttr"> <span class="style6"><%= round(rs("votes")/total*100,2) %></span> </td>
<td width="5%" align="center" class="ttr">%</td>
</tr>
<%
rs.movenext
wend
%>
</table></td>
</tr>
<tr>
<td><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0" bgcolor="#B3B8D9">
<tr>
<td align="center"><input type="submit" name="Submit" value="返回" onClick="javascript:history.go(-1)"> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -