📄 vote.asp
字号:
<!--#include file="Inc/syscode.asp"-->
<%
'=================================
' 良精科技企业管理系统
' www.liangjing.net
' copyright(c)2001-2008 良精科技
'=================================
%>
<!-- #include file="Inc/Head.asp" -->
<%
'=================================
' 良精科技企业管理系统
' www.liangjing.net
' copyright(c)2001-2008 良精科技
'=================================
%>
<%
dim Action,ID,VoteType,VoteOption,sqlVote,rsVote
Action=trim(Request("Action"))
ID=Trim(request("ID"))
VoteType=Trim(request("VoteType"))
VoteOption=trim(request("VoteOption"))
If Action = "Vote" And Id<> "" And VoteOption<>"" And Session("Voted") = "" Then
if VoteType="Single" then
conn.execute "Update 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 Vote set answer" & cint(trim(arrOptions(i))) & "= answer" & cint(trim(arrOptions(i))) & "+1 where ID=" & Clng(ID)
next
else
conn.execute "Update Vote set answer" & VoteOption & "= answer" & VoteOption & "+1 where ID=" & Clng(ID)
end if
end if
session("Voted")="True"
End If
if ID<>"" then
sqlVote="Select * from Hover_Vote Where ID=" & Clng(ID)
else
sqlVote="select top 1 * from Hover_Vote order by ID desc"
end if
Set rsVote = Server.CreateObject("ADODB.Recordset")
rsVote.open sqlVote,conn,1,1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#9DBBD4"><table width="779" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="120" align="right" background="Skins/Default/CnImg/ServiceTop.jpg"><object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="778" height="120">
<param name="movie" value="Skins/Default/Cnimg/top.swf">
<param name="quality" value="High">
<param name="wmode" value="transparent">
<embed src="Skins/Default/Cnimg/top.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="778" height="120" quality="High" wmode="transparent"> </embed>
</object></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" background="Skins/Default/CnImg/naviBg2.gif"><table width="778" height="30" border="0" cellpadding="0" cellspacing="0" bgcolor="#E2E7ED">
<tr>
<td width="180" align="center" background="Skins/Default/CnImg/LeftBg.gif"><table width="172" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1" bgcolor="#999999"></td>
<td width="170" bgcolor="#E7E7E7"> </td>
<td width="1" bgcolor="#999999"></td>
</tr>
</table></td>
<td width="597" align="center"><table width="570" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="19" align="left"><img src="Skins/Default/CnImg/FlagLine.gif" width="4" height="21"></td>
<td width="277" class="12font"><span class="Regester_title">调查结果</span></td>
<td width="264" align="right"> </td>
</tr>
</table></td>
<td width="1" bgcolor="#CCCCCC"></td>
</tr>
</table></td>
</tr>
</table>
<table width="778" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="180" height="259" align="center" valign="top" bgcolor="#F5F5F5"><table width="172" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1" rowspan="3" bgcolor="#cccccc"></td>
<td width="142" height="1" bgcolor="#FFFFFF"></td>
<td width="1" rowspan="3" bgcolor="#cccccc"></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#F9F9F9" ><!----------------------栏目分类列表部分------------------------->
<!-- 客户服务 -->
<!-- #include file="L_vip.asp" --><br>
<!----------------------栏目分类列表部分END------------------------->
</td>
</tr>
<tr>
<td height="1" colspan="3" bgcolor="#cccccc"></td>
</tr>
</table> <table width="172" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5" bgcolor="#DEDEDE"></td>
</tr>
</table></td>
<td width="597" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="2" bgcolor="#D5DBE3"></td>
</tr>
</table>
<TABLE width="578" border=0 cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
<TR>
<TD width="578" height="27" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="Skins/Default/Cnimg/yytop_top.gif" width="570" height="27"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32" valign="top"><img src="Skins/Default/Cnimg/yytop_left.gif" width="32" height="315"></td>
<td width="506" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="6%"> </td>
<td width="94%"><a href="/">首 页</a> >> 调 查 结 果</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" style="line-height: 150%">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<%
if Action="Vote" and session("voted")<>"" then
response.write "<font color='#FF0000' size='4'>"
if Session("UserName")<>"" then response.write Session("UserName") & ","
response.write "<br><br> 非常感谢您的投票!</font><br>"
end if
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="border">
<tr align="center" class="title">
<td height="35" colspan="3"><strong><font color="#333333">调 查 结 果</font></strong></td>
</tr>
<tr class="tdbg">
<td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td width="140" align="right"><div align="center"><strong><font color="#333333">调查内容:</font></strong></div></td>
<td colspan="2"><font color="#333333"><%=rsVote("Title")%></font></td>
</tr>
<tr>
<td width="140" align="right"><div align="center"><strong><font color="#333333">总投票数:</font></strong></div></td>
<td colspan="2"
> <font color="#333333">
<%
dim totalVote
totalVote=0
for i=1 to 8
if rsVote("Select" & i)="" then exit for
totalVote=totalVote+rsVote("answer"& i)
next
response.Write(totalVote & "票")
if totalVote=0 then totalVote=1
%>
</font></td>
</tr>
<tr>
<td colspan="3" align="center"> </td>
</tr>
<tr>
<td width="140" align="center"><font color="#333333"><strong>投票选项</strong></font></td>
<td width="64" align="right"><div align="center"><font color="#333333"><strong>票数</strong></font></div></td>
<td width="388" align="center"><font color="#333333"><strong>百分比</strong></font></td>
</tr>
<%
for i=1 to 8
if trim(rsVote("Select" & i) & "")="" then exit for
%>
<tr>
<td width="140" align="right"><div align="center"><font color="#66CCFF"><%=rsVote("Select"& i)%></font> </div></td>
<td align="right">
<div align="center"><%
response.write rsVote("answer"& i)
%>
</div></td>
<td>
<%
dim perVote
perVote=round(rsVote("answer"& i)/totalVote,4)
response.write "<img src='Images/topBar_bg.gif' width='" & round(360*perVote) & "' height='15' align='absmiddle'>"
perVote=perVote*100
if perVote<1 and perVote<>0 then
response.write " 0" & perVote & "%"
else
response.write " " & perVote & "%"
end if
%>
</td>
</tr>
<% next %>
</table>
</td>
</tr>
</table>
<%
if session("voted")="" then
if Session("UserName")<>"" then
response.write Session("UserName") & ","
end if
response.Write "<br><br>您还没有投票,请您在此投下您宝贵的一票!"
response.write "<form name='VoteForm' method='post' action='vote.asp'>"
response.write " " & rsVote("Title") & "<br>"
if rsVote("VoteType")="Single" then
for i=1 to 8
if trim(rsVote("Select" & i) & "")="" then exit for
response.Write "<input type='radio' name='VoteOption' value='" & i & "'>" & rsVote("Select" & i) & "<br>"
next
else
for i=1 to 8
if trim(rsVote("Select" & i) & "")="" then exit for
response.Write "<input type='checkbox' name='VoteOption' value='" & i & "'>" & rsVote("Select" & i) & "<br>"
next
end if
response.write "<br><input name='VoteType' type='hidden'value='" & rsVote("VoteType") & "'>"
response.write "<input name='Action' type='hidden' value='Vote'>"
response.write "<input name='ID' type='hidden' value='" & rsVote("ID") & "'>"
response.write " <a href='javascript:VoteForm.submit();'><img src='Skins/Default/voteSubmit.gif' width='52' height='18' border='0'></a> "
response.write "<a href='Vote.asp?ID=" & rsVote("ID") & "&Action=Show' target='_blank'><img src='Skins/Default/voteView.gif' width='52' height='18' border='0'></a>"
response.write "</form>"
end if
dim sqlOtherVote,rsOtherVote
sqlOtherVote="Select * from Hover_Vote Where ID<>" & ID & " order by ID desc"
Set rsOtherVote = Server.CreateObject("ADODB.Recordset")
rsOtherVote.open sqlOtherVote,conn,1,1
rsOtherVote.close
set rsOtherVote=nothing
%>
<p align="center">【<a href="javascript:window.close();"><font color="#333333">关闭窗口</font></a>】<br>
<br></p>
</td>
</tr>
</table> </td>
</tr>
</table></td>
<td width="40" valign="top"><img src="Skins/Default/Cnimg/yytop_right.gif" width="32" height="263"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><img src="Skins/Default/Cnimg/yybottom_bottom.gif" width="570" height="85"></td>
</tr>
</table></td>
</tr>
</table></TD>
</TR>
</TABLE></td>
<td width="1" bgcolor="#CCCCCC"></td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</BODY></HTML>
<%
rsVote.Close()
Set rsVote = Nothing
call CloseConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -