📄 vote.asp
字号:
<!--===============================================================-->
<!--Mfkiqpl旅行社旅游线路预订程序源代码仅供学习或部分旅行社网站用---->
<!--任何单位或个人不得随意修改、截取其中代码或做不法用途------------->
<!--版权归属:mfkiqpl http://www.zjjnet.com 所有-------------------->
<!--请务必保留以下版权信息------------------------------------------->
<!--作者:mfkiqpl----------------------------------------------------->
<!--QQ:31827726 mail:mfkiqpl@126.com--------------------------------->
<!--主页地址:http://www.zjjnet.com----------------------------------->
<!----------------欢迎各位站长与本人小站进行友情链接----------------->
<!--===============================================================-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!--#include file="conn.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
pagestart
dim action
action=trim(request("action"))
select case action
case "add"
voteadd
case "look"
votelook
case else
xxxx
end select
sub xxxx
response.Redirect("error.asp?errormsg=<li>系统参数错误!</li><br><li>请从合法的链接进入!</li>")
end sub
sub voteadd
if trim(request("vote"))="" then
response.Redirect("error.asp?errormsg=<li>系统参数错误!</li><br><li>请从合法的链接进入!</li>")
end if
sqlcmd="select * from vote"
set rsv=conn.execute(sqlcmd)
option1=rsv("option1")
option2=rsv("option2")
option3=rsv("option3")
option4=rsv("option4")
option5=rsv("option5")
option6=rsv("option6")
tickets1=rsv("tickets1")
tickets2=rsv("tickets2")
tickets3=rsv("tickets3")
tickets4=rsv("tickets4")
tickets5=rsv("tickets5")
tickets6=rsv("tickets6")
select case trim(request("vote"))
case option1
tickets="tickets1"
case option2
tickets="tickets2"
case option3
tickets="tickets3"
case option4
tickets="tickets4"
case option5
tickets="tickets5"
case option6
tickets="tickets6"
end select
if trim(request("vote"))<>"" then
SQLcmd1="update vote set "&tickets&"="&tickets&"+1 where id=1"
conn.execute(sqlcmd1)
end if
closers(rsv)
response.Redirect("vote.asp?action=look&msg=您本次投票成功!感谢您投出这宝贵的一票!")
end sub
sub votelook
response.write("<table width=755 border=0 align=center cellpadding=0 cellspacing=0><tr><td height=22 align=center bgcolor="&c3&">")
if trim(request("msg"))="" then
response.write("您没有投票,但选择了查看投票。以下是全部情况,请查看:")
else
response.write(trim(request("msg")))
end if
response.write("</td></tr></table>")
response.write("<table width=755 border=0 cellspacing=0 cellpadding=0><tr><td height=5></td></table>")
sqlcmd2 = ("select * from vote")
set rs=conn.execute(sqlcmd2)
if rs.eof and rs.bof then
response.Redirect("error.asp?errormsg=<li>严重错误!</li><br><li>未建议投票或是设票项在刚刚已经删除!</li>")
end if
all1 = 0
all11=1
all1 = all1 + rs("tickets1") + rs("tickets2") + rs("tickets3") + rs("tickets4") + rs("tickets5") + rs("tickets6")
if all1=0 then
all1=all11
end if
response.write("<table width=600 border=0 cellspacing=1 cellpadding=0 align=center bgcolor="&c1&"><tr align=center bgcolor="&c3&"> ")
response.write("<td height=24 colspan=2><img src='images/mfk20.gif'> <b>"&rs("topic")&"</b></td></tr>")
if rs("option1")<>"" then
response.write("<tr bgcolor="&c4&"><td width=300 height=22 bgcolor="&c4&"><img src='images/mfk21.gif'>"&rs("option1")&"</td>")
response.write("<td width=300 height=22 bgcolor="&c6&"> <img src=images/vote_01.gif><img src=images/vote_02.gif width=")
response.write(round(rs("tickets1")/all1,4)*100)
response.write(" height=9><img src=images/vote_03.gif>")
response.write(round(rs("tickets1")/all1,4)*100)
response.write("% ["&rs("tickets1")&"票]</td></tr>")
end if
if rs("option2")<>"" then
response.write("<tr bgcolor="&c4&"><td width=300 height=22><img src='images/mfk21.gif'>"&rs("option2")&"</td>")
response.write("<td width=300 height=22> <img src=images/vote_01.gif><img src=images/vote_02.gif width=")
response.write(round(rs("tickets2")/all1,4)*100)
response.write(" height=9><img src=images/vote_03.gif>")
response.write(round(rs("tickets2")/all1,4)*100)
response.write("% ["&rs("tickets2")&"票]</td></tr>")
end if
if rs("option3")<>"" then
response.write("<tr bgcolor="&c4&"><td width=300 height=22><img src='images/mfk21.gif'>"&rs("option3")&"</td>")
response.write("<td width=300 height=22> <img src=images/vote_01.gif><img src=images/vote_02.gif width=")
response.write(round(rs("tickets3")/all1,4)*100)
response.write(" height=9><img src=images/vote_03.gif>")
response.write(round(rs("tickets3")/all1,4)*100)
response.write("% ["&rs("tickets3")&"票]</td></tr>")
end if
if rs("option4")<>"" then
response.write("<tr bgcolor="&c4&"><td width=300 height=22><img src='images/mfk21.gif'>"&rs("option4")&"</td>")
response.write("<td width=300 height=22> <img src=images/vote_01.gif><img src=images/vote_02.gif width=")
response.write(round(rs("tickets4")/all1,4)*100)
response.write(" height=9><img src=images/vote_03.gif>")
response.write(round(rs("tickets4")/all1,4)*100)
response.write("% ["&rs("tickets4")&"票]</td></tr>")
end if
if rs("option6")<>"" then
response.write("<tr bgcolor="&c4&"><td width=300 height=22><img src='images/mfk21.gif'>"&rs("option5")&"</td>")
response.write("<td width=300 height=22> <img src=images/vote_01.gif><img src=images/vote_02.gif width=")
response.write(round(rs("tickets5")/all1,4)*100)
response.write(" height=9><img src=images/vote_03.gif>")
response.write(round(rs("tickets5")/all1,4)*100)
response.write("% ["&rs("tickets5")&"票]</td></tr>")
end if
if rs("option6")<>"" then
response.write("<tr bgcolor="&c4&"><td width=300 height=22><img src='images/mfk21.gif'>"&rs("option6")&"</td>")
response.write("<td width=300 height=22> <img src=images/vote_01.gif><img src=images/vote_02.gif width=")
response.write(round(rs("tickets6")/all1,4)*100)
response.write(" height=9><img src=images/vote_03.gif>")
response.write(round(rs("tickets6")/all1,4)*100)
response.write("% ["&rs("tickets6")&"票]</td></tr>")
end if
response.write("<tr bgcolor="&c4&"><td width=300 height=24> 投票总数:")
response.write all1
closers(rs)
response.write("</td><td width=300 height=24 align=center></td></tr></table>")
response.write("<table width=755 border=0 cellspacing=0 cellpadding=0><tr><td height=5></td></table>")
end sub
pageend
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -