📄 vote_old.asp
字号:
<!--#include file="inc/conn1.asp"-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>在线调查</title>
<style type="text/css"></style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<link href="inc/style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0>
<table width="200" height="15" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<%
opendataconn
set ps=server.createobject("adodb.recordset")
sql="select * from dctitle order by dateandtime desc"
ps.open sql,conn,1,1
if ps.eof then
response.write "没有记录!"
response.end
end if
if not ps.eof then
dim totalpages
numperpage=4
ps.pagesize=numperpage
totalpages=ps.pagecount
curpage=request("curpage")
if curpage="" then
curpage=1
elseif cint(curpage)<1 then
curpage=1
elseif cint(curpage)>totalpages then
curpage=totalpages
end if
ps.absolutepage=curpage
dim count
count=0
end if
all=0
dim hitall(10)
do while not ps.eof and count<numperpage
title=ps("title")
titleid=trim(ps("id"))
dateandtime=ps("dateandtime")
%>
<table width="100%" height="71" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div align="center">
<table width=401 border=0 cellpadding=0 cellspacing=0 bgcolor=#E7F7E6>
<tr>
<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="news"> </span><span class="p12"> <%=title%></span></td>
</tr>
<tr>
<td height=12 class="p12">
<div align="right">开始调查时间:<%=year(dateandtime) & "年" & month(dateandtime) & "月" & day(dateandtime) & "日"%></div></td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
sql2="select * from dcdetail where titleid="&titleid&" order by id desc "
rs.open sql2,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 bgcolor=#F9DE8E align=center>
<td width=20 class=f14 bgcolor="#D9F2D7"> </td>
<td width=80 height=20 class=p12 bgcolor="#D9F2D7">选项</td>
<td width=200 class=p12 bgcolor="#D9F2D7">比例</td>
<td width=50 class=news bgcolor="#D9F2D7">票数</td>
</tr>
<%
rs.movefirst
t=0
for i=1 to rs.recordcount-1
t=t+int((hitall(i-1)*100)/all)
%>
<tr bgcolor=#ffffff>
<td class=news align=center><%=i%></td>
<td class=p12 align=center height=22> <%=rs("name")%></td>
<td class=p12>
<table border=0>
<tr>
<td align=left class=p12 width=50><font color=red><%=int((hitall(i-1)*100)/all)%>%</font></td>
<td > <img src="images/voteline.gif" width="<%=int((hitall(i-1)*100)/all)%>" height="9"></td>
</tr>
</table></td>
<td class=news align=center> <%=rs("hit")%></td>
</tr>
<%
rs.movenext
next
rs.movelast
%>
<tr bgcolor=#ffffff>
<td class=news align=center><%=rs.recordcount%></td>
<td class=p12 align=center height=22> <%=rs("name")%></td>
<td class=p12>
<table border=0>
<tr>
<td align=left class=f14 width=50> <span class="p12"><font color=red><%=(100-t)%>%</font></span></td>
<td> <img src="images/voteline.gif" width="<%=(100-t)%>" height="9"></td>
</tr>
</table></td>
<td class=news 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>
</div>
<table width=401 border=0 cellpadding=0 cellspacing=0 align="center">
<tr>
<td width=18 bgcolor=#FEFAEE><br> </td>
</tr>
</table></td>
</tr>
</table>
<%
ps.movenext
count=count+1
loop
ps.close
set ps=nothing
closedataconn
%>
<br>
<table width="100%" height="18" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="news">
<td width="11%"> </td>
<td width="36%" class="p12"><div align="center"><font color="#FFFFFF">当前页<%=curpage%>/共<%=totalpages%>页/</font></div></td>
<td width="12%">
</td>
<td width="20%"><form name="form2">
<select name="menu2" onChange="MM_jumpMenu('parent',this,0)">
<option value="#" selected>查看其它页</option>
<%
dim page
page=1
do while page<=totalpages
%>
<option value="vote_old.asp?curpage=<%=page%>">第<%=page%>页</option>
<%
page=page+1
loop
%>
</select>
</form></td>
<td width="21%"> </td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -