<!--#include file="../../fy_inc/fy.User.asp"-->
<%	
 	Dim id,i,VoteType,rs1,voted
	id=ChkNumeric(Rsql(request("id")))
	voted=ChkNumeric(Rsql(request("voted")))
 	 set rs1=fycms.actexe("select * from vote_fy where id="&id&" and isLock=0")
	 If Not rs1.eof Then VoteType=rs1("VoteType")
if VoteType="0" then
	if isnull(request("voted")) or request("voted")=empty then
	echo "<script>alert('请选择投票项目。');history.go(-1);</script>"
	response.end
	end If
	echo request("voted")
	fycms.actexe("Update vote_fy set VoteNum=VoteNum+1 where id="&voted)
elseif VoteType="1" then
	if request("voted").count=0 then
	echo "<script>alert('请选择投票项目。');window.close()</script>"
	response.end
	end If
	Dim arrvoted
	arrvoted=Split(request("voted"),",")
  	For I = 0 To UBound(arrvoted)
		 fycms.actexe("Update vote_fy set VoteNum=VoteNum+1 where id="&ChkNumeric(Rsql(arrvoted(i))))
	Next 
 end If
 response.Redirect "index.asp?id="&id&""

 %>