📄 research.asp
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
' TXSite / 通用网站系统
'
' 版本 :v1.8.20
'
' 制作人 :milp(milp@21cn.com)
'
' 版权所有:源码之家(http://www.21tx.com)
'
' 主页地址:http://www.21tx.com
' http://www.bestnets.net
' http://www.soucn.com
'
' 技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
%>
<!--#include file="conn.asp"-->
<%
dim action,id
id=request("id")
action=Lcase(Trim(Request("action")))
Select Case action
Case "research" Call research
Case "result" Call result(id)
Case Else Call result(id)
End Select
Call objend()
Sub research()
dim selected
selected=request("selected")
if session("research")="" then
conn.execute("update research set res"&selected&"=res"&selected&"+1 where id="&id)
session("research")=1
end if
response.redirect "research.asp?id="&id&""
End Sub
Sub result(id)
dim research(16)
dim sel(8)
dim total
dim i
total=0
rs.open "select * from research where id="&id,conn,1,1
if rs.bof and rs.eof then
response.write "未指定所需参数!"
response.end
end if
for i=0 to rs("rno")-1
research(i)=rs("res"&i&"")
research(i+8)=rs("res"&i+8&"")
total=total+research(i)
next%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<meta http-equiv="Pragma" content="no-cache">
<title>调查结果</title>
<script language=javascript src="count.asp?id=6"></script>
</head>
<body bgcolor="#99ccff">
<p align=center>
<table width=360 border=0 cellspacing=0 cellpadding=0 bgcolor=#000000>
<p align=left><%=rs("name")%>:</p>
<caption align=left><font size=2>共有 <font color=red><%=total%></font> 人参加(调查开始时间:<%=rs("addate")%>)</font></caption>
<tr><td>
<table width=360 border=0 cellspacing=1 cellpadding=3>
<tr bgcolor=#dcdcdc align=center valign=center>
<td width=100><font size=2>选项</font></td>
<td width=60><font size=2>人数</font></td>
<td width=200><font size=2>比 例</font></td>
</tr>
<%for i=0 to rs("rno")-1
sel(i)=(research(i)/total)*100%>
<tr bgcolor=#ffffff valign=center>
<td width=100 align=center><font size=2 color=#000000><%=research(i+8)%></font></td>
<td width=60 align=center><font size=2 color=#ff0000><%=research(i)%></font></td>
<td width=200 align=left><img src=images/research.gif width=<%=int(sel(i)*1.5)%> height=10><font size=2 color=#ff0000><%=round(sel(i),2)%>%</font></td>
</tr>
<%next
rs.close%>
</table>
</td></tr>
</table></p>
<p align=center><small>请您刷新条形图以获得最新的统计结果!</small></p>
</body></html>
<%End Sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -