toupiao_jg.asp
来自「类似于baidu的百度知道」· ASP 代码 · 共 146 行
ASP
146 行
<!--#include file=conn.asp-->
<!--#include file="Config.asp"-->
<%
if not IsNumeric(request("id")) or request("id")="" then
Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
Response.end
end if
if request("id")<>"" then
id=CLNG(request("id"))
end if
rs.open"select * from question where id="&id,conn,1,1
if rs.eof then
Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
Response.end
else
if request("daid")<>"" then
if session("person")="" then
Response.Write ("<script>alert('友情提示!\n\请您登录后再进行投票!');window.close();</script>")
Response.end
end if
if not IsNumeric(request("daid")) then
Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
Response.end
end if
daid=CLNG(request("daid"))
rs3.open"select * from toupiao where wenid="&id&"",conn,1,1
if rs3.eof then
Response.Write ("<script>alert('友情提示!\n\参数错误!');window.close();</script>")
Response.end
end if
rs3.close
rs3.open"select * from touuser where wenid="&id&" and touuser='"&session("person")&"'",conn,1,1
if not rs3.eof then
Response.Write ("<script>alert('友情提示!\n\对不起,您不能重复投票!');window.close();</script>")
Response.end
end if
rs3.close
rs3.open"select * from toupiao where wenid="&id&" and daid="&daid&"",conn,1,3
rs3("dapiao")=rs3("dapiao")+1
rs3.update
rs3.close
rs3.open"select * from touuser",conn,1,3
rs3.addnew
rs3("wenid")=id
rs3("daid")=daid
rs3("touuser")=session("person")
rs3.update
rs3.close
rs3.open"select * from person where name='"&session("person")&"'",conn,1,3
rs3("jifen")=rs3("jifen")+tpdf
if rs3("jifen")+tpdf<fen1 then
rs3("touxian")=""&ji1&" "
elseif rs3("jifen")+tpdf>=fen1 and rs3("jifen")+tpdf<fen2 then
rs3("touxian")=""&ji1&" "
elseif rs3("jifen")+tpdf>=fen2 and rs3("jifen")+tpdf<fen3 then
rs3("touxian")=""&ji2&" "
elseif rs3("jifen")+tpdf>=fen3 and rs3("jifen")+tpdf<fen4 then
rs3("touxian")=""&ji3&" "
elseif rs3("jifen")+tpdf>=fen4 and rs3("jifen")+tpdf<fen5 then
rs3("touxian")=""&ji4&" "
elseif rs3("jifen")+tpdf>=fen5 and rs3("jifen")+tpdf<fen6 then
rs3("touxian")=""&ji5&" "
elseif rs3("jifen")+tpdf>=fen6 and rs3("jifen")+tpdf<fen7 then
rs3("touxian")=""&ji6&" "
elseif rs3("jifen")+tpdf>=fen7 and rs3("jifen")+tpdf<fen8 then
rs3("touxian")=""&ji7&" "
elseif rs3("jifen")+tpdf>=fen8 and rs3("jifen")+tpdf<fen9 then
rs3("touxian")=""&ji8&" "
elseif rs3("jifen")+tpdf>=fen9 and rs3("jifen")+tpdf<fen10 then
rs3("touxian")=""&ji9&" "
elseif rs3("jifen")+tpdf>=fen10 then
rs3("touxian")=""&ji10&" "
end if
rs3.update
rs3.close
end if
%>
<html>
<head>
<title>投票结果页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body><center>
<table border="0" width="420" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td>
<div align="center">
<br><table width="400" border="0" cellpadding="0" cellspacing="0" class="t1">
<tr>
<td height="36" align="center" onMouseOver="this.className='tbb'" onMouseOut="this.className='taa'" class="taa">
<b>投票结果</b></td>
</tr>
<tr>
<td>
<%
rs1.open"select sum(dapiao) as piaoshu from toupiao where wenid="&id&"",conn,1,1
toushu=rs1("piaoshu")
rs1.close
rs1.open"select * from toupiao where wenid="&id&"",conn,1,1%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40"><div align="center">
<p>感谢您的参与!</p>
</div></td>
</tr>
<tr>
<td height="25" class="f14B"> 当前投票结果: </td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%while not rs1.eof
if toushu=0 then
zongpiao=0
else
zongpiao=rs1("dapiao")/toushu*30
end if
%>
<tr>
<td width="23%" height="20"><%=rs1("dauser")%>:</td>
<td width="77%"><img src="img/bar1.gif" width="<%=zongpiao%>" height="10"> <%=rs1("dapiao")%>票</td>
</tr>
<%rs1.movenext
wend
rs1.close
%>
</table></td>
</tr>
<tr>
<td height="30" valign="bottom"><div align="center">
<input type="button" name="Submit" value="关闭窗口" class="bnsrh" onClick="javascript:window.close();">
</div></td>
</tr>
</table></td>
</tr>
</table><br></div>
</td>
</tr>
</table></center>
</body>
</html>
<%end if
rs.close
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?