![](images/title07.gif)
<%
Select Case Request("Action")
Case "SubCount"
Call SubCount()
Case Else
Call Surver()
End Select
function getIP()
getIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If getIP = "" Then getIP = Request.ServerVariables("REMOTE_ADDR")
end function
Sub SubCount()
if Request.Cookies("mycookie")("votetimes")<>"" then
if Request.Cookies("mycookie")("votetimes")>10 then
Response.Write ""
response.End()
else
Response.Cookies("mycookie")("votetimes")=Request.Cookies("mycookie")("votetimes")+1
Response.Cookies("mycookie").Expires=date+1
end if
else
Response.Cookies("mycookie")("votetimes")=0
Response.Cookies("mycookie")("userip")=getIP()
Response.Cookies("mycookie").Expires=date+1
end if
sql="select * from assess_result where pyuser='"&request("pyuser")&"' and gxqid="&Session("Gxqid")'每个评议员只能评一次。
set Rs=CreateRs(Cn,sql)
if Rs.recordcount<>0 then
Response.Write ""
response.End()
end if
DistoryRs(Rs)
sql="select * from assess_result where gxqid="&Session("Gxqid")'每个高新区最多提交10个评议
set Rs=CreateRs(Cn,sql)
if Rs.recordcount>9 then
Response.Write ""
response.End()
end if
DistoryRs(Rs)
TotalScore= 0
surver_sql="select * from assess_surver where parentid=2 order by sid asc"
set RsSur=CreateRs(Cn,surver_sql)
if not RsSur.eof then '
For i = 1 to RsSur.recordcount
sub_sql="select * from assess_surver where parentid="&RsSur("sid")&" order by sid desc"
set RsSub=CreateRs(Cn,sub_sql)
if not RsSub.eof then
For j = 1 to RsSub.recordcount
Gxqid = Session("Gxqid")
SurId = RsSub("sid")
Score = request("sc"&RsSub("sid"))
pyuser = request("pyuser")
sql="Insert into assess_subscore(gxqid,surid,score,pyuser,addtime) values('"&GxqId&"','"&SurId&"','"&Score&"','"&pyuser&"','"&now()&"')"
Cn.execute(sql)
TotalScore = TotalScore+Score
RsSub.movenext
next
end if
DistoryRs(RsSub)
RsSur.movenext
next
end if
DistoryRs(RsSur)
sql="Insert into assess_result(gxqid,gxqname,total,pyuser,addtime) values('"&Session("Gxqid")&"','"&Session("Gxqname")&"','"&TotalScore&"','"&pyuser&"','"&now()&"')"
Cn.execute(sql)
Response.Write ""
response.End()
End Sub
Sub Surver()
%>
<%End Sub%>