📄 pollview.asp
字号:
<%@ LANGUAGE=VBScript%>
<%Server.ScriptTimeout=1000
Response.Expires=0
if Session("a_c_user_name")="" then
Response.write "<b>[操作失败]</b><p>您尚未登录(或已经超时退出),不能进行此操作!"
Response.end
end if
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
if len(y)=1 then y="0" & y
if len(r)=1 then r="0" & r
if len(s)=1 then s="0" & s
if len(f)=1 then f="0" & f
if len(m)=1 then m="0" & m
sj=n & "-" & y & "-" & r & " " & s & ":" & f & ":" & m
Set fs=CreateObject("Scripting.FileSystemObject")
pollfile=Server.Mappath("pollending.asp")
Set thisfile = fs.OpenTextFile(pollfile,1,False)
Dim poll()
count=0
do while not thisfile.AtEndOfStream
thisline=thisfile.Readline
Redim preserve poll(count)
poll(count)=thisline
count=count+1
loop
thisfile.close
set thisfile=nothing
set fs=nothing
hxrs=int((count-6)/2)
Dim show()
js=1
for i=6 to count-1 step 2
Redim Preserve show(js),show(js+1),show(js+2)
show(js)=poll(i)
show(js+1)=poll(i+1)
show(js+2)=1
js=js+3
next
zzz=0
for i=1 to js-3 step 3
if int(show(i+1))>int(zzz) then zzz=show(i+1)
for j=1 to js-3 step 3
if int(show(i+1))<int(show(j+1)) then show(i+2)=show(i+2)+1
next
next%><html>
<head>
<title>候选人管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type='text/css'>
<!--
.p9 {line-height: 150%; font-size: 9pt;}
.p12 {line-height: 150%; font-size: 12pt;}
body {line-height: 150%;font-size : 12pt;}
td {line-height: 135%;font-size : 10.5pt;}
A {text-decoration: none;}
A:Hover {text-decoration : none;}
a:visited { color: #0000FF}
-->
</style>
<script language="JavaScript">
function load()
{var name=navigator.appName
var vers=navigator.appVersion
if(name=="Netscape")
{window.location.reload()
}else
{history.go(0)
}}</script>
</head>
<body bgcolor="FFFFFF">
<h1 align="center"><font color="0099FF">【投票结果】</font></h1>
<div align="center">现在是:<%=sj%> </div>
<hr noshade size="1" color=009900>
<p><b>[功能说明]</b> 投票时间:<font color=red><%=poll(1)%></font> 至 <font color=red><%=poll(2)%></font></p>
<p align="center">目前共有候选人:<font color=red><%=hxrs%></font> 位;已投票:<font color=red><%=poll(4)%></font> 票。<a href="javascript:load()">【刷新】</a><a href="javascript:history.go(-1)">【返回】</a>
</p>
<form method="post" action="pollviewpoll.asp">
<table border="1" align="center" cellpadding="4" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" bgcolor="#E0E0E0">
<tr bgcolor="#0099FF">
<td align="center"><font color="#FFFFFF">序号</font></td>
<td align="center"><font color="#FFFFFF">投票</font></td>
<td><font color="#FFFFFF">候选人</font></td>
<td align="center"><font color="#FFFFFF">得 票 数</font></td>
<td align="center"><font color="#FFFFFF">得票率</font></td>
<td align="center"><font color="#FFFFFF">名次</font></td>
</tr><%for i=1 to js-3 step 3%>
<tr><td align="center"><%=(i+2)/3%></td><td align="center"><input type="radio" name="poll" value="<%=show(i)%>"></td><td><%=show(i)%></td><td nowrap><%if poll(4)>0 and show(i+1)>0 then%><img src="read/poll.gif" width="<%=int(show(i+1)*200/zzz)%>" height="18"><%end if%> <%=show(i+1)%></td><td align="right"><%if poll(4)=0 then
Response.Write "0%"
else
Response.Write formatnumber(show(i+1)*100/poll(4),2)&"%"
end if%></td><td align="center"><%=show(i+2)%></td></tr><%next%>
<tr><td align="center" colspan="6"><%yxtp=1
if int(Session("a_c_user_value"))<int(poll(3)) then
yxtp=0%>您的经验值没有达到<%=poll(3)%>分,不能投票<%end if%>
<%if Instr(poll(5)," "&Session("a_c_user_name")&" ")<>0 then
yxtp=0%>您已经投过票了,不能重复投票<%end if%>
<%if CDate(poll(1))>CDate(sj) then
yxtp=0%>投票活动尚未开始,不能投票<%end if%>
<%if CDate(poll(2))<CDate(sj) then
yxtp=0%>投票活动已经结束,不能投票<%end if%>
<%if yxtp=1 then%><input type="submit" name="Submit" value="投出神圣一票"><%end if%></td>
</tr>
</table>
</form>
<hr noshade size="1" color=009900>
<div align="center" class="p9"><script src="use.asp"></script> <script src="sn.asp"></script><br><script src="copyright.asp"></script></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -