%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <%option explicit%> <% '**************************************************** ' Software name:Kesion CMS 5.0 ' Email: service@kesion.com . QQ:111394,9537636 ' Web: http://www.kesion.com http://www.kesion.cn ' Copyright (C) Kesion Network All Rights Reserved. '**************************************************** Dim KSCls Set KSCls = New Vote KSCls.Kesion() Set KSCls = Nothing Class Vote Private KS Private Sub Class_Initialize() Set KS=New PublicCls End Sub Private Sub Class_Terminate() Call CloseConn() Set KS=Nothing End Sub Sub Kesion() dim Action,ID,VoteType,VoteOption,sqlVote,rsVote Action = KS.S("Action") ID = KS.ChkCLng(KS.S("ID")) VoteType = KS.S("VoteType") VoteOption= KS.R(KS.S("VoteOption")) If Action = "Vote" And Id<> "" And VoteOption<>"" And Session("Voted" &ID) = "" Then if VoteType="Single" then on error resume next conn.execute "Update KS_Vote set answer" & VoteOption & "= answer" & VoteOption & "+1 where ID=" & ID else dim arrOptions if instr(VoteOption,",")>0 then arrOptions=split(VoteOption,",") dim i for i=0 to ubound(arrOptions) conn.execute "Update KS_Vote set answer" & cint(trim(arrOptions(i))) & "= answer" & cint(trim(arrOptions(i))) & "+1 where ID=" & Clng(ID) next else conn.execute "Update KS_Vote set answer" & VoteOption & "= answer" & VoteOption & "+1 where ID=" & Clng(ID) end if end if session("Voted" & ID)="True" End If if ID<>"" then sqlVote="Select * From KS_Vote Where ID=" & Clng(ID) else sqlVote="select top 1 * From KS_Vote order by NewestTF desc" end if Set rsVote = Server.CreateObject("ADODB.Recordset") rsVote.open sqlVote,conn,1,1 if not rsvote.eof then %>
|
<%
if Action="Vote" and session("voted" & ID)<>"" then
Response.Write ""
if KS.C("UserName")<>"" then Response.Write KS.C("UserName") & ","
Response.Write " 非常感谢您的投票! " end if %>
" & KS.C("UserName") & "," end if Response.Write " 您还没有投票,请您在此投下您宝贵的一票!" Response.Write "" end if %> |
||||||||||||||||||||||
【关闭窗口】 |
||||||||||||||||||||||