www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > showvote.asp
<!--#include file=conn.asp--> <!--#include file=Checkstr.asp--> <link rel="stylesheet" href="admin/admin.css" type="text/css"> <% if Checkstr(request.querystring("action"))<>"show" then if session("habitus")="true" then response.write"对不起,您不能重复投票":response.end for i=1 to request.form("ID").count conn.execute("update Vote set Count=Count+1 where ID="&request.form("ID")(i)) session("habitus")="true" next end if if Checkstr(request.querystring("VoteClassID"))="" then response.redirect"Votemanage.asp" set rs=server.createobject("adodb.recordset") sql="select title,type from VoteClass where VoteClassID="&Checkstr(request.querystring("VoteClassID")) rs.open sql,conn,1,1 set rs1=server.createobject("adodb.recordset") sql1="select VoteOper,Count,ID from Vote where VoteClassID="&Checkstr(request.querystring("VoteClassID")) rs1.open sql1,conn,1,1 while not rs1.eof AllCount=AllCount+rs1("Count") rs1.movenext wend rs1.movefirst if AllCount=0 then response.write"当前没有人投票":response.end %> <title><%=rs("title")%></title> <body bgcolor="#FFFFFF"> <table width="425" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="425" height="28" class=fl><b><%=rs("title")%></b><br> 共有 <font color="#FF0000"><%=AllCount%></font> 位朋友参加</td> </tr> <tr> <td width="425"> <table width="452" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#00AEEF"> <tr bgcolor="#00AEEF"> <td width="18" height="19" align="center" valign="middle"> </td> <td width="164" align="center" valign="middle"><font color="#FFFFFF">选项</font></td> <td width="211" align="center" valign="middle"><font color="#FFFFFF">比例</font></td> <td width="54" align="center" valign="middle"> <p><font color="#FFFFFF">票数</font></p></td> </tr> <%i=1:while not rs1.eof%> <tr bgcolor="#FFFFFF"> <td width="18" align="center" valign="middle"><%=i%></td> <td width="164" height="23" valign="middle"> <%=rs1("VoteOper")%></td> <td width="211"> <%=left((rs1("Count")/AllCount)*100,4)%>% <img src=images/space.gif width=<%=rs1("Count")/AllCount*150%> height=10></td> <td width="54" align="center" valign="middle"><%=rs1("Count")%></td> </tr> <%rs1.movenext:i=i+1:wend%> </table></td> </tr> </table> <% rs.close set rs=nothing rs1.close set rs1=nothing %>