📄 view.asp
字号:
<!--#include file = "conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>投票结果</title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<%
Dim sid
sid = Request.QueryString("sid")
%>
<p align="center" style="margin-top: 10"><font size="5">
目前投票结果</font>
<hr>
<p></p>
<div align="center">
<table border="0" width="40%" id="table1" cellspacing="1" cellpadding="3" class="tableborder">
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open "select * from Title where sid="&sid,conn,1,1
If not (rs.eof and rs.bof) Then
Do While not rs.eof
%>
<tr>
<th colspan="4"><%=rs("title")%></th>
</tr>
<%
Dim rsq,rsp,total
total=0
Set rsp=Server.CreateObject("ADODB.RecordSet")
rsp.open "select ps from Question where tid="&rs("id"),conn,1,1
Do While not rsp.eof
total=total+rsp("ps")
rsp.MoveNext
loop
rsp.close
Set rsp=nothing
Set rsq=Server.CreateObject("ADODB.RecordSet")
rsq.open "select * from Question where tid="&rs("id"),conn,1,1
If not (rsq.eof and rsq.bof) Then
Do While not rsq.eof
%>
<tr>
<td class="tablebody1"><%=rsq("question")%></td>
<td class="tablebody1" width="10%" nowrap><b><%=rsq("ps")%></b>票</td>
<td class="tablebody1" width="80">
<%
Dim width
If total<>0 Then
width = 80*formatNumber((rsq("ps")/total),3)
%>
<table border="0" width="<%=width%>" cellspacing="0" cellpadding="0" height="5" bgcolor="#CC99FF">
<tr>
<td></td>
</tr>
</table>
<%End If%>
</td>
<td class="tablebody1" width="18%" nowrap>占<b><%If total=0 Then Response.Write "0.0%" Else Response.Write FormatPercent((rsq("ps")/total),3) End If%></b></td>
</tr>
<%
rsq.MoveNext
Loop
End If
rsq.close
Set rsq=nothing
rs.MoveNext
Loop
End If
rs.close
Set rs=nothing
%>
</table>
</div>
<%
'End If
%>
<br>
<div align="center">
<a href = "index.asp">返回</a>
</div>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -