📄 js-tp2.asp
字号:
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
<html>
<head>
<title>投票调查</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type="text/css">
<!--
a:link {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited {text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline}
body {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000}
TD {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;line-height: 120%;table-layout:fixed;word-break:break-all}
p {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
input {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
body {
margin-top: 0;
margin-bottom: 0;
margin-left:0;
margin-right:0;
color: #000000;
background-image: url(images/background.gif);
}
select {FONT-SIZE: 9PT;font-family: 宋体}
option {FONT-SIZE: 9pt;font-family: 宋体}
textarea {FONT-SIZE: 9pt;font-family: 宋体}
-->
</STYLE>
</head>
<body>
<%
tpid=trim(Request("tpid"))
tps=trim(Request("tps"))
tps=replace(tps," ","")
aaa=split(tps,",")
if Request.Cookies("tpid"&tpid&"")=tpid then
Response.Write "<script>alert('已经投过了,请不要重复投票!');</script>"
er=1
end if
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [tp] where id="&tpid&" order by id desc",conn,1,1
if rs.recordcount<>0 then
endtime=rs("endtime")
title=rs("title")
end if
rs.close:set rs=nothing
if datediff("d",endtime,date())>0 then
Response.Write "<script>alert('这个项目已经到期了,不能再投票了!');</script>"
er=1
end if
if er<>1 then
for i=0 to ubound(aaa)
tpsid=aaa(i)
'Response.Write tpsid&"<BR>"
conn.Execute "update [tptitle] set [tps]=tps+1 where id="&clng(tpsid)
Response.Cookies ("tpid"&tpid&"")=tpid
Response.Cookies("tpid"&tpid&"").expires=date+1
next
end if
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [tptitle] where tpid="&tpid&" order by id desc",conn,1,1
if rs.recordcount<>0 then
set rssum = Server.CreateObject("ADODB.RecordSet")
rssum.Open "select sum(tps) as f_sum from [tptitle] where tpid="&tpid&" ",conn,1,1
tpsall=rssum(0)
rssum.close:set rssum=nothing
%>
<br>
<div align="center">
<table width="448" border="0" cellpadding="0" cellspacing="15" bordercolor="#FFFFFF" bgcolor="#f4f4f4" id="table1" style="border-collapse: collapse">
<tr>
<td height="15" colspan="3" ><div align="left"><b><%=title%></b><font color="#FF6633">(过期时间:<%=endtime%>)</font></div></td>
</tr>
<TR>
<TD>共有 <FONT color=red><%=tpsall%></FONT> 人参与投票</TD>
</TR>
<tr>
<td bgColor=#007ecc>
<table cellSpacing=1 cellPadding=2 width=460 border=0>
<%
for i=1 to rs.recordcount
tps=rs("tps")
if tpsall<>0 then
bfb=Round(rs("tps")/tpsall*100,1)
else
bfb=0
end if
%>
<tr>
<td width="33%" height="15" bgColor=#ffffff><%=i%>、<%=rs("tpxx")%> </td>
<td width="56%" bgColor=#ffffff><img border="0" src="images/bg1.GIF" width="<%=int(bfb)%>" height="10"> <%=bfb%>%</td>
<td width="11%" align="center" bgColor=#ffffff><%=tps%>票</td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
end if
rs.close:set rs=nothing
%>
</table> </TD></tr>
<tr>
<TD>
<TABLE width="100%" height="53" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD align=middle>感谢您的参与!</TD>
</TR>
<TR>
<TD height="33" align=right valign="bottom">【<A href="javascript:window.close()">关闭窗口</A>】</TD>
</TR>
</TBODY>
</TABLE>
</td></tr></table>
</div>
</body>
</html>
<% call CloseConn() %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -