找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 69|回复: 2

投票问题

[复制链接]
发表于 2010-1-19 05:19:50 | 显示全部楼层 |阅读模式 IP:江苏扬州
做个投票程序,遇到两个问题
一是投票的选项占总人数的百分比都是0
一是投票的柱状图,不显示:
下面是程序
<script>
function window.onload(){
var ObjStr='<object id="Cls" classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11 type=application/x-oleobject><param name="Command" value="CloseX"></object>'
document.body.insertAdjacentHTML("BeforeEnd",ObjStr)
if(parseInt(window.navigator.appVersion.split(";")[1].substr(5))>=6){
window.opener=''
setTimeout("self.close();",8000)
}
else Cls.Click()
}
</script>
<!--#include file="dbconn.asp"-->
<%
dim rs
dim sql
dim selecta
dim selectb
dim selectc
dim selectd
dim total
set rs=server.createobject("adodb.recordset")
sql="select * from research where id=3"
rs.open sql,conn,1,1
if not rs.eof then
total=rs("selecta")+rs("selectb")+rs("selectc")+rs("selectd")+rs("selecte")+rs("selectf")+rs("selectg")+rs("selecth")+rs("selecti")+rs("selectj")+rs("selectk")+rs("selectl")+rs("selectm")+rs("selectn")+rs("selecto")+rs("selectp")+rs("selectq")+rs("selectr")+rs("selects")+rs("selectt")+rs("selectu")+rs("selectv")+rs("selectw")+rs("selectx")
selecta=(rs("selecta")/total)*100
selectb=(rs("selectb")/total)*100
selectc=(rs("selectc")/total)*100
selectd=(rs("selectd")/total)*100
selectd=(rs("selecte")/total)*100
selecta=(rs("selectf")/total)*100
selectb=(rs("selectg")/total)*100
selectc=(rs("selecth")/total)*100
selectd=(rs("selecti")/total)*100
selectd=(rs("selectj")/total)*100
selecta=(rs("selectk")/total)*100
selectb=(rs("selectl")/total)*100
selectc=(rs("selectm")/total)*100
selectd=(rs("selectn")/total)*100
selectd=(rs("selecto")/total)*100
selecta=(rs("selectp")/total)*100
selectb=(rs("selectq")/total)*100
selectc=(rs("selectr")/total)*100
selectd=(rs("selects")/total)*100
selectd=(rs("selectt")/total)*100
selecta=(rs("selectu")/total)*100
selectb=(rs("selectv")/total)*100
selectc=(rs("selectw")/total)*100
selectd=(rs("selectx")/total)*100
%>
<STYLE type=text/css>
body, td { FONT-FAMILY: "宋体"; FONT-SIZE: 9pt }
</STYLE>
<title>投票结果</title>
<div align="center">
<center>
<table width="469" height="148" border="0" cellpadding="2" cellspacing="0">
<tr>
<td height="16" colspan="3"> <p align="center"><strong><font color="#003399"><span class="style31">您对本网站的看法</span></font></strong></td>
</tr>
<tr>
<td width="122" height="22" >1号作品</td>
<td width="240" ><img src=bar.gif width=<%=int(selecta*24)%> height=10> </td>
<td width="95" ><%=rs("selecta")%>人占:<%=round(selecta,2)%>%</td>
</tr>
<tr>
<td height="22" >2号作品</td>
<td ><img src=bar.gif width=<%=int(selectb*24)%> height=10></td>
<td><%=rs("selectb")%>人占:<%=round(selectb,2)%>%</td>
</tr>
<tr>
<td height="22" >3号作品</td>
<td ><img src=bar.gif width=<%=int(selectc*24)%> height=10></td>
<td><%=rs("selectc")%>人占:<%=round(selectc,2)%>%</td>
</tr>
<tr>
<td height="22" >4号作品</td>
<td ><img src=bar.gif width=<%=int(selectd*24)%> height=10></td>
<td><%=rs("selectd")%>人占:<%=round(selectd,2)%>%</td>
</tr>
<tr>
<td height="22" >5号作品</td>
<td ><img src=bar.gif width=<%=int(selecte*24)%> height=10></td>
<td><%=rs("selecte")%>人占:<%=round(selecte,2)%>%</td>
</tr>
<tr>
<td width="122" height="22" >6号作品</td>
<td width="240" ><img src=bar.gif width=<%=int(selectf*24)%> height=10> </td>
<td width="95" ><%=rs("selectf")%>人占:<%=round(selectf,2)%>%</td>
</tr>
<tr>
<td height="22" >7号作品</td>
<td ><img src=bar.gif width=<%=int(selectg*24)%> height=10></td>
<td><%=rs("selectg")%>人占:<%=round(selectg,2)%>%</td>
</tr>
<tr>
<td height="22" >8号作品</td>
<td ><img src=bar.gif width=<%=int(selecth*24)%> height=10></td>
<td><%=rs("selecth")%>人占:<%=round(selecth,2)%>%</td>
</tr>
<tr>
<td height="22" >9号作品</td>
<td ><img src=bar.gif width=<%=int(selecti*24)%> height=10></td>
<td><%=rs("selecti")%>人占:<%=round(selecti,2)%>%</td>
</tr>
<tr>
<td height="22" >10号作品</td>
<td ><img src=bar.gif width=<%=int(selectj*24)%> height=10></td>
<td><%=rs("selectj")%>人占:<%=round(selectj,2)%>%</td>
</tr>
<tr>
<td width="122" height="22" >11号作品</td>
<td width="240" ><img src=bar.gif width=<%=int(selectk*24)%> height=10> </td>
<td width="95" ><%=rs("selectk")%>人占:<%=round(selectk,2)%>%</td>
</tr>
<tr>
<td height="22" >12号作品</td>
<td ><img src=bar.gif width=<%=int(selectl*24)%> height=10></td>
<td><%=rs("selectl")%>人占:<%=round(selectl,2)%>%</td>
</tr>
<tr>
<td height="22" >13号作品</td>
<td ><img src=bar.gif width=<%=int(selectm*24)%> height=10></td>
<td><%=rs("selectm")%>人占:<%=round(selectm,2)%>%</td>
</tr>
<tr>
<td height="22" >14号作品</td>
<td ><img src=bar.gif width=<%=int(selectn*24)%> height=10></td>
<td><%=rs("selectn")%>人占:<%=round(selectn,2)%>%</td>
</tr>
<tr>
<td height="22" >15号作品</td>
<td ><img src=bar.gif width=<%=int(selecto*24)%> height=10></td>
<td><%=rs("selecto")%>人占:<%=round(selecto,2)%>%</td>
</tr>
<tr>
<td width="122" height="22" >16号作品</td>
<td width="240" ><img src=bar.gif width=<%=int(selectp*24)%> height=10> </td>
<td width="95" ><%=rs("selectp")%>人占:<%=round(selectp,2)%>%</td>
</tr>
<tr>
<td height="22" >17号作品</td>
<td ><img src=bar.gif width=<%=int(selectq*24)%> height=10></td>
<td><%=rs("selectq")%>人占:<%=round(selectq,2)%>%</td>
</tr>
<tr>
<td height="22" >18号作品</td>
<td ><img src=bar.gif width=<%=int(selectr*24)%> height=10></td>
<td><%=rs("selectr")%>人占:<%=round(selectr,2)%>%</td>
</tr>
<tr>
<td height="22" >19号作品</td>
<td ><img src=bar.gif width=<%=int(selects*24)%> height=10></td>
<td><%=rs("selects")%>人占:<%=round(selects,2)%>%</td>
</tr>
<tr>
<td height="22" >20号作品</td>
<td ><img src=bar.gif width=<%=int(selectt*24)%> height=10></td>
<td><%=rs("selectt")%>人占:<%=round(selectt,2)%>%</td>
</tr>
<tr>
<td width="122" height="22" >21号作品</td>
<td width="240" ><img src=bar.gif width=<%=int(selectu*24)%> height=10> </td>
<td width="95" ><%=rs("selectu")%>人占:<%=round(selectu,2)%>%</td>
</tr>
<tr>
<td height="22" >22号作品</td>
<td ><img src=bar.gif width=<%=int(selectv*24)%> height=10></td>
<td><%=rs("selectv")%>人占:<%=round(selectv,2)%>%</td>
</tr>
<tr>
<td height="22" >23号作品</td>
<td ><img src=bar.gif width=<%=int(selectw*24)%> height=10></td>
<td><%=rs("selectw")%>人占:<%=round(selectw,2)%>%</td>
</tr>
<tr>
<td height="22" >24号作品</td>
<td ><img src=bar.gif width=<%=int(selectx*24)%> height=10></td>
<td><%=rs("selectx")%>人占:<%=round(selectx,2)%>%</td>
</tr>
<tr>
<td height="22" colspan="3">
<div align="center">谢谢您的参与。共有:<%=total%>人参加调查
<%
else
response.write "还没有人参与调查"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</div> </td>
</tr>
</table>
</center>
</div>
发表于 2010-1-19 05:19:54 | 显示全部楼层 IP:江苏扬州
还有:&lt;%=round(selecta,2)%&gt;这是啥意思
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 23:32 , Processed in 0.266354 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表