<!--#include file="vote/conn.asp"-->
<%
'调用方式:<Script Language="JavaScript" SRC="vote/loveu99_Vote.asp?top=3"></Script>
color1="#003399" '投票说明字体颜色
color2="#000000" '投票项字体颜色
color3="FF9900" '投票按钮背景颜色
dim aa
aa=0
FOR EACH name IN Request.Form("rc")
aa=aa+1
NEXT
IF aa>3 THEN
Response.write "<Script language=JavaScript>alert('你选择太多了!')</Script>;"
Response.write "<Script language=JavaScript>location.replace('loveu99_VoteView.asp?ID=4');</Script>"
Response.end
END IF
Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr
IF Request.Form("IsSub")="YES" THEN
SS=Request.Form("SS") '投票序号
Set rs=conn.execute("Select Vote_Limit From Vote_list Where ID="&SS)
Limit=Cint(rs(0))
rs.close
Vote_Ok=False
IF Limit=2 THEN
IF Request.Cookies("loveu99_vote_"&SS)="DONE" THEN
Vote_Ok=True
ELSE
Response.Cookies("loveu99_vote_"&SS) = "DONE"
Response.Cookies("loveu99_vote_"&SS).Expires = date()+time()+TimeSerial(1,0,0) '设置cookie的过期日
END IF
END IF
IF Vote_Ok=True THEN
Response.write "<Script language=JavaScript>alert('请不要重复投票!')</Script>;" '这里自己可以设置下面基本上都不用改了
ELSE
FOR EACH name IN Request.Form("rc")
conn.execute "Update Vote_Answer Set VoteResult=VoteResult+1 Where ID="&name
NEXT
Response.write "<Script language=JavaScript>alert('您已投票成功,谢谢您得参与!')</Script>;"
END IF
Response.write "<Script language=JavaScript>location.replace('index.asp');</Script>"
END IF
top=Cint(Request.QueryString("top"))
IF top<1 THEN top=1
Set rs=conn.execute("Select Top "&top&" ID,Project,MultiSelect From Vote_List Where online=True Order By ID DESC")
IF rs.eof THEN
Response.write "<font color=red>目前还没有投票项目</font>"
ELSE
Set rs2=Server.Createobject("ADODB.RecordSet")
While NOT rs.eof
Response.write "<table border=0 cellspadding=0 width='100%' align=center bgcolor=#84D36B><form method=POST action='loveu99_Vote.asp' target=_blank><tr><td><input type=hidden name=IsSub value=YES><input type=hidden name=SS value="&rs(0)&">"
Response.write "<br>"
rs2.open "Select ID,VoteContent From Vote_Answer Where ListID="&rs(0),conn,1,1
Response.write "<tr align=center><td><a href=images/nopic.jpg target='_blank'></td><td><a href=images/nopic.jpg target='_blank'></td><td><a href=images/3.JPG target='_blank'></td><td><a href=images/nopic.jpg target='_blank'></td>"
Response.write "<tr align=center><td><input type=checkbox name=rc value=20>文章作品</td><td align=left><input type=submit value=投票 style=background-color:"&color3&"> </td>"
Response.write "<tr align=center><td colspan='2' rowspan='2' align=left> 投票说明:<p> 1、在你满意的文章作品下打“√”后,点击投票即可;<p> 2、每人选投文章作品每天只能投1次,重复投选票无效;<p> 3、投票截止到2006年10月31日。</td>"
rs2.close
Response.write "<tr><td></td><td></td></tr>"
Response.write "</td></tr></form></table><br>"
rs.MoveNext
WEND
Set rs2=nothing
END IF
rs.close
Set rs=nothing
conn.close
Set conn=nothing
%>