📄 voteshow.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/config.asp"-->
<%
dim id
id=CheckSql(request("id"))
CheckSqlnum(id)
id=int(id)
set rs1=server.createobject("adodb.recordset")
sql1="select * from vote_class where id="&id
rs1.open sql1,conn,1,1
if rs1.eof and rs1.bof then
Response.Write ("<script>alert(' 访问错误!\n\n 您访问的调查或文件不存在!\n\n 点击确定返回 ');history.back();</script>")
Response.end
else
votetitle=rs1("title")
end if
rs1.close
set rs1=nothing
set rs2=server.createobject("adodb.recordset")
sql2="select SUM(num) from vote where vote_title="&id
rs2.open sql2,conn,1,1
if rs2(0)=0 then
response.write "目前还没有投票数!"
else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=SiteName%>-浏览调查-<%=votetitle%></title>
<link rel="stylesheet" href="css/main.css" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {color: #FFFF00}
.style4 {color: #CC0000}
-->
</style>
</head>
<body>
<table width="96%" height="191" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
<tr>
<td width="100%" height="189" valign="top" bgcolor="#E0E1E3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="45" valign="bottom" bgcolor="#1685C7"><div align="center"><span class="style1">关于“</span><%=votetitle%><span class="style1">”的主题投票结果如下:</span>
<hr width="96%" size="1" color="#FFFFFF">
</div></td>
</tr>
</table>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25"> </td>
</tr>
</table>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="179">
<%set rs=server.createobject("adodb.recordset")
sql="select * from vote where vote_title="&id&" order by id desc"
rs.open sql,conn,1,1
do while not rs.eof%>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="25%"><%=rs("vote_name")%></td>
<td width="55%">
<img src="images/count.gif" width="<%=int(100*rs("num")/rs2(0))%>" height="15"></td>
<td width="9%"><div align="right"><%=int(100*rs("num")/rs2(0))%>%</div></td>
<td width="11%"><div align="right"><%=rs("num")%>人</div></td>
</tr>
</table>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</td>
</tr>
</table>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="46"><div align="right">共有<%=rs2(0)%>张票数</div></td>
</tr>
</table>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25"> </td>
</tr>
</table></td>
</tr>
</table>
<p align="center"><a href="#" onClick="javascript:window.close()">关闭窗口</a></p>
<%end if
rs2.close
set rs2=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -