📄 pollcand.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"
If Int(Session("hxf_u_grade")) <> 12 Then Response.Redirect "manerr.asp?id=300"
poll = Split(Application("wsaxhxf_c_pollending"), "{]")
ubpoll = UBound(poll)
hxrs = Int((ubpoll - 7) / 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 del(name){
document.forms[1].delname.value = name;
document.forms[1].delname.focus();
}
function check1(){
addn = document.forms[0].addname.value;
if(addn == ""){
alert("请输入要添加的候选人姓名。")
return false;
}
return true;
}
function check2(){
deln = document.forms[1].delname.value;
if(deln == ""){
alert("请输入要删除的候选人姓名。")
return false;
}
return true;
}
</script>
</head>
<body bgcolor="FFFFFF" class=p150>
<div align="center">
<h1><font color="0099FF">【投票系统】</font></h1>
<font color="#FF0000">【候选人管理】</font></div>
<hr noshade size="1" color=009900>
<b>[功能说明]</b> <br>
添加或删除候选人。(共有候选人:<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>
<hr noshade size="1" color=009900>
<table border="1" align="center" cellpadding="4" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" bgcolor="#E0E0E0" width="80%">
<tr bgcolor="#0099FF" align="center">
<td><font color="#FFFFFF">序号</font></td>
<td><font color="#FFFFFF">候选人</font></td>
<td><font color="#FFFFFF">得票数</font></td>
<td><font color="#FFFFFF">得票率</font></td>
<td><font color="#FFFFFF">删除</font></td>
</tr>
<%for i=9 to ubpoll step 2%>
<tr align="center">
<td><%=(i-7)/2%></td>
<td><%=poll(i)%></td>
<td><%=poll(i+1)%></td>
<td><%if poll(7)=0 then
Response.write "0%"
else
Response.write int(poll(i+1)*100/poll(7))&"%"
end if%></td>
<td><a href=javascript:del("<%=poll(i)%>")>删除</a></td>
</tr>
<%next%>
</table>
<hr noshade size="1" color=009900>
<form method="post" action="pollcandadd.asp" onsubmit="return(check1())">
<div align="center"> 添加候选人:
<input type="text" name="addname" maxlength="10" size="10">
<input type="submit" name="add" value="添加">
<input type="reset" value="重写">
</div>
</form>
<form method="post" action="pollcanddel.asp" onsubmit="return(check2())">
<div align="center"> 删除候选人:
<input type="text" name="delname" maxlength="10" size="10">
<input type="submit" name="del" value="删除">
<input type="reset" value="重写">
</div>
</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 + -