viewsurvey.asp

来自「asp的新闻网站」· ASP 代码 · 共 170 行

ASP
170
字号
<%
'programmer:潘树文
'date:2001-2-2
%>
<%
Response.Expires =0

%>
<!--#include file="../include/odbc.asp"-->

<%
surveyId=request("surveyId")
set rslooktopic=server.CreateObject ("adodb.recordset")
sql="select surveyid,surveytitle,voteNum from news2_survey where left(surveyid,8)='"&left(surveyId,8)&"' and right(surveyid,2)<>'00'and menuid='"&request("menuid")&"' and visible='1' order by surveyid"

rslooktopic.Open sql,conn,1,1

set rslooktopic2=server.CreateObject ("adodb.recordset")
sql1="select sum(voteNum) from news2_survey where left(surveyid,8)='"&left(surveyId,8)&"' and menuid='"&request("menuid")&"' and visible='1'"

set rslooktopic2=conn.Execute (sql1)

dim arr(99,2)

if not rslooktopic.EOF then 
for i=0 to rslooktopic.RecordCount-1 
	arr(i,0)=rslooktopic(0)
	arr(i,1)=rslooktopic(2) 
    if not rslooktopic.EOF then  rslooktopic.MoveNext 
	next
 	end if
dim last
for i=0 to rslooktopic.RecordCount-2
	last=last+arr(i,1)
next
%>
<HTML>
<HEAD>
<title>调查统计</title>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" type="text/css" href="../style.css">
</HEAD>
<BODY bgcolor="#f5f5f5">
<%if rslooktopic2(0)=0 then%> 
<center><table width=100% border="0"> 
<%rslooktopic.MoveFirst %>
<%do while not rslooktopic.EOF%>
<tr>
<%for i=0 to rslooktopic.Fields.Count-1%>
<td><%=rslooktopic(i)%>
</td>
<%next%>
</tr>
<%
rslooktopic.MoveNext 
loop%>
</table>
<a href="viewsurvey.asp?surveyId=<%=surveyId%>&menuid=<%=request("menuid")%>">刷新</a>
<br>
欢迎你把你的感受与观点在这里一起与大家探讨 <%else%> 
<%
set rslooktopictop=server.CreateObject ("adodb.recordset")
sql="select surveytitle from news2_survey where surveyid='"&surveyId&"' and menuid='"&request("menuid")&"' and visible='1'"
rslooktopictop.Open sql,conn
Response.Write "<font color=red>"&rslooktopictop(0)&"</font><br>"
%> <b>投票人数:共<%=rslooktopic2(0)%>人</b> 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC"> 
    <td style="border-bottom:1px solid;border-top:1px solid;border-color=#000000;font-size:9pt">◆投票人数统计</td>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <%rslooktopic.MoveFirst %> 
  <%do while not rslooktopic.EOF%> 
  <tr bgcolor="#dddddd">
<%for i=1 to rslooktopic.Fields.Count-2%>
<td style="font-size:9pt" width="30%" style="border-bottom:1px solid;border-color=#cccccc">
<font color="#555555">&nbsp;&nbsp;<%=rslooktopic(i)%></font>
</td>
<td style="font-size:9pt" width="70%" style="border-bottom:1px solid;border-color=#cccccc">
&nbsp;&nbsp;<%=rslooktopic(rslooktopic.Fields.Count-1)%>人次
</td>
<%next%>
</tr>
<%
rslooktopic.MoveNext 
loop%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC"> 
    <td style="border-bottom:1px solid;border-top:1px solid;border-color=#000000;font-size:9pt">◆投票支持条形统计</td>
  </tr>
</table>
<table width=100% cellpadding="0" cellspacing="0" border="0">
  <%
rslooktopic.MoveFirst 
arrss=-1
%> <%do while not rslooktopic.EOF
arrss=arrss+1
%> 
  <tr bgcolor="#dddddd">
<%for ii=1 to rslooktopic.Fields.Count-2%>
<td style="font-size:9pt" width="30%" style="border-bottom:1px solid;border-color=#cccccc">
<font color="#555555">&nbsp;&nbsp;<%=rslooktopic(ii)%></font>
</td>
<%next%>
<td width="70%" style="border-bottom:1px solid;border-color=#cccccc">
&nbsp;
<%if arrss=0 then%>
<%
for gzs=0 to ((arr(0,1)/rslooktopic2(0))*20)
Response.Write "<font size=1>█</font>"
next %>
<%else%>
<%
for gzs=0 to ((arr(arrss,1)/rslooktopic2(0))*20)
Response.Write "<font size=1>█</font>"
next %>
<%end if%>
</td>
</tr>
<%
rslooktopic.MoveNext 
loop%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC"> 
    <td style="border-bottom:1px solid;border-top:1px solid;border-color=#000000;font-size:9pt">◆投票支持图文统计</td>
  </tr>
</table>
<table width=100% cellpadding="0" cellspacing="0" border="0">
  <tr> 
  <%
        dim i
        i=1
        %>
    <td bgcolor="#000000" width="300"> <applet
		code=chart.class name=chart width=300 height=180 VIEWASTEXT id=Applet1 align=center >
        <param name=titleParam value=" 统计结果:共<%=rslooktopic2(0)%>人参与此调查">
        <param name=ptXLabelParam value="1 <%for j=1 to rslooktopic.RecordCount-1%>,<%
        i=i+1
        Response.Write i&" "
        %><%next%>">
        <param name=ptYParam value="<%=(arr(0,1)/rslooktopic2(0))*100%>
        <%for j=1 to rslooktopic.RecordCount-2%>,<%=(arr(j,1)/rslooktopic2(0))*100%><%next%>,<%=100-last/rslooktopic2(0)*100%>">
        <param name=ptYUnitParam value="">
        <param name=typeParam value="2">
        <param name=backgroundParam value="000000">
        <param name=foregroundParam value="00ff00">
        <param name=axisColorParam value="FFFFFF">
        <param name=labelColorParam value="FFFFFF">
        <param name=seperatorParam value=",">
      </applet> </td>
    <td bgcolor="#000000">
      <p><span style="font-size:9pt"><a href="viewsurvey.asp?surveyId=<%=surveyId%>&menuid=<%=request("menuid")%>"><font color="#FFFFFF">刷新</font></a><font color="#FFFFFF">|</font></span><span style="font-size:9pt"><a href="#" onClick="javascript:top.close()"><font color="#FFFFFF">关闭窗口</font></a> 
        </span></p>
      </td>
  </tr>
</table>
<%end if%> <%
''关闭数据库
rslooktopic.close
set rslooktopic=nothing
rslooktopic2.close
set rslooktopic2=nothing
%> 
<div align="center">欢迎参加www.1001n.com.cn的调查活动!</div>
</BODY>
</HTML>

⌨️ 快捷键说明

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