📄 pollview.asp
字号:
<%@ LANGUAGE=VBScript codepage ="936" %>
<%Response.Expires=0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma","No-Cache"
Response.AddHeader "Cache-Control","Private"
Response.CacheControl = "No-Cache"
nickname=Session("hxf_u_nickname")
if nickname="" then Response.Redirect "manerr.asp?id=100"
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
poll = Split(Application("wsaxhxf_c_pollending"), "{]")
ubpoll = UBound(poll)
hxrs = Int((ubpoll - 8) / 2)
Dim show()
js = 1
For i = 9 To ubpoll 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">
<link rel="stylesheet" href="readonly/style.css">
<script Language=JavaScript>
function check(){
if(confirm("你只有一次投票机会,确定投出吗?")){
document.forms[0].ok.disabled = 1;
return true;
}
else{
return false;
}
}
function g(v1, v2){
if(v2 == 0){
url = "mangradedown2.asp?id=" + v1;
}
else{
url = "mangradeup2.asp?id=" + v1;
}
window.open(url, "", "width=380,height=120");
}
</script>
</head>
<body bgcolor="FFFFFF" class=p150>
<h1 align="center"><font color="0099FF">【投票结果】</font></h1>
<div align="center">现在是:<%=sj%> </div>
<hr noshade size="1" color=009900>
<b>[功能说明]</b> 投票时间:<font color=red><%=poll(1)%></font> 至 <font color=red><%=poll(2)%></font>
<hr noshade size="1" color=009900>
<div align="center">目前共有候选人:<font color=red><%=hxrs%></font> 位;已投票:<font color=red><%=poll(7)%></font> 票。<a href="javascript:history.go(0)">【刷新】</a><a href="javascript:history.go(-1)">【返回】</a></div>
<form method="post" action="pollviewpoll.asp" onsubmit="return(check())">
<table border="1" align="center" cellpadding="4" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" bgcolor="#E0E0E0" width="90%">
<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>
<%If Int(Session("hxf_u_grade")) = 12 then%><td align="center"><font color="#FFFFFF">调级</font></td><%End if%>
</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(7) > 0 And show(i + 1) > 0 Then%><img src="readonly/poll.gif" width="<%=Int(show(i + 1) * 200 / zzz)%>" height="18"><%End If%> <%=show(i + 1)%></td>
<td align="right">
<%
If poll(7)=0 then
Response.Write "0%"
Else
Response.Write FormatNumber(Show(i + 1) * 100 / poll(7), 2) & "%"
End If
%>
</td>
<td align="center"><%=show(i + 2)%></td>
<%If Int(Session("hxf_u_grade")) = 12 then%><td align="center"><a href='javascript:g("<%=show(i)%>",0)'>降级</a> <a href='javascript:g("<%=show(i)%>",1)'>升级</a></td><%End If%>
</tr>
<%Next%>
<tr>
<td align="center" colspan="7">
<%
yxtp = 1
If CDate(poll(1)) > CDate(sj) Then
yxtp = 0
Response.Write "投票活动尚未开始,不能投票"
End If
If CDate(poll(2)) < CDate(sj) Then
yxtp = 0
Response.Write "投票活动已经结束,不能投票"
End If
If Int(Session("hxf_u_value")) < Int(poll(3)) And yxtp = 1 Then
yxtp = 0
Response.Write "您的累积分数没有达到" & poll(3) & "分,不能投票"
End If
If Int(Session("hxf_u_mvalue")) < Int(poll(4)) And yxtp = 1 Then
yxtp = 0
Response.Write "您的月积分数没有达到" & poll(4) & "分,不能投票"
End If
If Int(Session("hxf_u_hb")) < Int(poll(5)) And yxtp = 1 Then
yxtp = 0
Response.Write "您的货币数值没有达到" & poll(5) & "¥,不能投票"
End If
If Int(Session("hxf_u_grade")) < Int(poll(6)) And yxtp = 1 Then
yxtp = 0
Response.Write "您的级别没有达到" & poll(6) & "级,不能投票"
End If
If Instr(" " & LCase(poll(8)) & " ", " " & LCase(nickname) & " ") <> 0 And yxtp = 1 Then
yxtp = 0
Response.Write "您已经投过票了,不能重复投票"
End If
If yxtp = 1 Then
Response.Write "<input type='submit' name='ok' value='投出神圣一票'>"
end if
%>
</td>
</tr>
</table>
</form>
<hr noshade size="1" color=009900>
<div align=center class=cp><%Response.Write "序列号:<font color=blue>" & Application("wsaxhxf_c_sn") & "</font>,授权给:<font color=blue>" & Application("wsaxhxf_c_user") & "</font><br><font color=999999>" & Application("wsaxhxf_c_copyright") & "</font>"%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -