📄 vote.asp
字号:
<!--#include file="inc/conn1.asp"-->
<%
dim hitall(10)
opendataconn
vote=trim(request("vote1"))
if not vote="" then
conn.execute("update dcdetail set hit=hit+1 where id="&vote&"")
end if
if session("qt_logined")=true then
set ps=server.CreateObject("adodb.recordset")
ps.open "select * from reg where uname='"&session("qt_uname")&"'"
if isNull(trim(rs("jifeng"))) then
conn.execute "update reg set jifeng=2 where uname='"&session("qt_uname")&"'"
else
conn.execute"update reg set jifeng=jifeng+2 where uname='"&session("qt_uname")&"'"
end if
end if
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from dctitle order by dateandtime desc"
rs.open sql,conn,1,1
if rs.eof then
resposne.write "error!"
response.end
end if
title=rs("title")
titleid=trim(rs("id"))
rs.close
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>在线调查系统</title>
<style type="text/css"></style>
<link href="inc/style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0>
<table width="377" height="19" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width=407 border=0 cellpadding=0 cellspacing=0 align="center">
<tr>
</td>
<td width=10><br>
</td>
<td width=371><br>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td class=fl align="left"> <span class="p12"><%=title%></span></td>
</tr>
<tr>
<td height=12></td>
</tr>
<%
sql="select * from dcdetail where titleid="&titleid&" order by id desc "
rs.open sql,conn,1,1
if rs.eof then
response.write "error!"
response.end
end if
i=0
all=0
do while not rs.eof
all=all+rs("hit")
hitall(i)=rs("hit")
i=i+1
rs.movenext
loop
%>
<tr>
<td height=20 class=p12>共有<%=all%> 人参加</td>
</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 bgcolor=#009999 width="100%">
<tr>
<td valign="top" bgcolor="#D9F2D7">
<table border=0 cellpadding=0 cellspacing=1 width=100%>
<tr align=center bgcolor=#F9DE8E class="p12">
<td width=20 bgcolor="#E7F7E6"> </td>
<td width=80 height=20 bgcolor="#E7F7E6"><font color="#FF711B">选项</font></td>
<td width=200 bgcolor="#E7F7E6"><font color="#FF711B">比例</font></td>
<td width=50 bgcolor="#E7F7E6"><font color="#FF711B">票数</font></td>
</tr>
<%
rs.movefirst
t=0
for i=1 to rs.recordcount-1
t=t+int((hitall(i-1)*100)/all)
%>
<tr bgcolor=#ffffff class="p12">
<td align=center><%=i%></td>
<td align=center height=22> <%=rs("name")%></td>
<td> <table border=0>
<tr>
<td align=left class=p12 width=35><font color=red><%=int((hitall(i-1)*100)/all)%>%</font></td>
<td width="19" > <img src="images/voteline.gif" width="<%=int((hitall(i-1)*100)/all)%>" height="9"></td>
</tr>
</table></td>
<td align=center> <%=rs("hit")%></td>
</tr>
<%
rs.movenext
next
rs.movelast
%>
<tr bgcolor=#ffffff class="p12">
<td align=center><%=rs.recordcount%></td>
<td align=center height=22> <%=rs("name")%></td>
<td> <table border=0>
<tr>
<td align=left class=f14 width=35> <span class="p12"><font color=red><%=(100-t)%>%</font></span></td>
<td width="19"> <img src="images/voteline.gif" width="<%=(100-t)%>" height="9"></td>
</tr>
</table></td>
<td align=center> <%=rs("hit")%></td>
</tr>
</table>
</td>
</tr>
</table>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=6></td>
</tr>
<tr>
<td align=middle></td>
</tr>
<tr>
<td class=p12 align=center>请您刷新条形图以获得最新的统计结果!<br>
感谢您的参与!</td>
</tr>
<tr>
<td height=2></td>
</tr>
</table>
</td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -