<!--#include file="conn.asp"-->
<%
Dim voteid, MyChoose, i, Rs, SQL
voteid = CLng(request("voteid"))
If request.Cookies("vote_"&voteid) = "DownsysClassvote_" &voteid Then
	Response.Write("&back=已经参与过投票，谢谢")
	Response.End
Else
	response.Cookies("vote_"&voteid) = "DownsysClassvote_" &voteid
	response.Cookies("vote_"&voteid).expires = Date + 3650
	response.Cookies("vote_"&voteid).domain = request.ServerVariables("SERVER_NAME")
	MyChoose = Split(request("mychoose"), ",", -1, 1)
	Set Rs = server.CreateObject("adodb.recordset")
	SQL = "select * from NC_Vote where id = " &voteid
	Rs.Open SQL, conn, 1, 3
	For i = 1 To 5
		If MyChoose(i -1) = "true" Then
			Rs("ChooseNum_"&i&"") = Rs("ChooseNum_"&i&"") + 1
		End If
	Next
	Rs.update
	For i = 1 To 5
		If MyChoose(i -1) = "true" Then
			conn.Execute "update NC_Vote set VoteNum = VoteNum + 1 where id = " &Rs("id")
		End If
	Next
	Rs.Close
	Set Rs = Nothing
	Response.Write("&back=投票已经送达，谢谢参与")
	conn.Close
	Set conn = Nothing
End If
%>
