⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vote.asp

📁 一个有用的东西 希望大家喜欢 谢谢大家对本站的支持
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="mfk_body.asp"-->
<title><%=title1%>--投票项目</title>
<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
closeconn
response.Redirect("error.asp?errormsg=<li>系统参数错误!</li><br><li>请从合法的链接进入!</li>")
end sub
sub voteadd
if trim(request("vote"))="" then
closeconn
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
%>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="27"><img src="skins/mfk_skin(<%=skin%>)/mfk_lefttitle1.gif"></td>
    <td width="701" background="skins/mfk_skin(<%=skin%>)/mfk_midtitle1.gif">&nbsp;</td>
    <td width="27"><img src="skins/mfk_skin(<%=skin%>)/mfk_righttitle1.gif"></td>
  </tr>
</table>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0" class="lefttablebox">
  <tr>
    <td><table width=751 border=0 align=center cellpadding=0 cellspacing=0>
      <tr>
        <td height=30 align=center>
          <%
if trim(request("msg"))="" then
%>
          您没有投票,但选择了查看投票。以下是全部情况,请查看:
          <%
else
response.write(trim(request("msg")))
end if
%>        </td>
      </tr>
      <%	sqlcmd2 = ("select * from vote")
	set rs=conn.execute(sqlcmd2)
	if rs.eof and rs.bof then
	closers(rs)
	closerconn
	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
%>
    </table>      </td>
  </tr>
  <tr>
    <td class="titletable"><table width=600 border=0 cellspacing=1 cellpadding=0 align=center>
      <tr align=center>
        <td height=24 colspan=2><img src='images/mfk20.gif'> <b><%=rs("topic")%></b></td>
      </tr>
      <%
if rs("option1")<>"" then
response.write("<tr><td width=300 height=22><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><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><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><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><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><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
%>
      <tr>
        <td width=300 height=24> 投票总数:<%=all1%> </td>
        <td width=300 height=24 align=center></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="755" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="7"><img src="skins/mfk_skin(<%=skin%>)/mfk_lefttitle1_1.gif"></td>
    <td width="741" background="skins/mfk_skin(<%=skin%>)/mfk_midtitle1_1.gif">&nbsp;</td>
    <td width="7"><img src="skins/mfk_skin(<%=skin%>)/mfk_righttitle1_1.gif"></td>
  </tr>
</table>
<%
closers(rs)
end sub
pageend
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -