⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vote.asp

📁 进入后台
💻 ASP
字号:
<!--#include file="config.asp"-->
<%bid=clng(request("bid"))
if bid="" or bid<1 then ShowError("访问的班级不存在")
if request.QueryString("stype")="" then
if request.cookies("yvsyxylvote")<>"" then
response.write "你已经投过票了"
response.end
end if
options=request("options")
		response.cookies("yvsyxylvote")=Request.ServerVariables("REMOTE_ADDR")  
		conn.execute("update vote set answer"&options&"=answer"&options&"+1 where bjid="&bid&"")
end if
%><head>
<title>投票结果</title>
<LINK href="css.css" type=text/css rel=stylesheet>
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>

<body style="margin:5px;">  
<table width="450" height="48" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC" style="border-collapse: collapse">
  <%
total=0
set rs=server.createobject("adodb.recordset")
sql="select * from vote where bjid="&bid&""
rs.open sql,conn,1,1
%>
  <tr>
      <td height="48" valign="top" colspan="3" align=center><font color="#000073"><%=rs("Title")%></font><font color="#000000"><br>
        ===============================================================================</font> </td>  
  </tr>  
    <tr>
    <td width="244" valign="top">选项</td>
	<td width="51" valign="top">百比分</td>
	<td width="52" valign="top">人数</td>
  </tr>
<%
for i=1 to 6
	if rs("Select"&i)<>"" then
		total=total+rs("answer"&i)
	end if
next

%>
<%for i=1 to 6
	if rs("Select"&i)<>"" then
		if total=0 then
			answer=0
		else
			answer=(rs("answer"&i)/total)*100
		end if
%><tr>
      <td valign="top"><%=i%>.<%=rs("select"&i)%>:</td>
	<td valign="top"><img src='skins/1/vote.gif' width=<%=int(answer*2)%> height=8> <%=round(answer,3)%>%</td> 
<td valign="top"><%=rs("answer"&i)%>人</td>           
<%
	end if
next
%>

        <tr align="center"><td colspan="3">
        共有【<%=total%>】人参加投票<br>
        <font color="#000000">===============================================================================</font></font> </td>  
    </tr>  
</table>  
<p align="center">【<a href="javascript:window.close()">关闭窗口</a>】 
<%rs.close:set rs=nothing     
closeconn%>
</body>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -