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

📄 pollresult.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "poll","read"
set objcheck=nothing

dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
rs.Open "select * from poll where pollid="&request("pollid"),conn,1,1
if rs.EOF then
	Response.Write "记录不存在"
	Response.End 
end if

if request.Form("polllineid")<>""  then
	set rs3=conn.execute("select * from pollresult where userid='"&session("username")&"'")
	if not rs3.eof then
	%>
	<script language="JavaScript">alert('您已经透过票咯');</script>
	<%
	else
		conn.execute("insert into pollresult(polllineid,userid)values("&request.Form("polllineid")&",'"&session("username")&"')")
	end if
end if
%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs("subject")%></title>
</head>
<body>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="2"><b><font  class="title">主题:<%=rs("subject")%></font></b> &nbsp;&nbsp; 
    </td>
  </tr>
  <tr > 
    <td height="16" colspan="2" background="../images/title.gif"></td>
  </tr>
  <tr> 
    <td height=4></td>
  </tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF">
  <tr> 
    <td width="12%" height=20 align=center bgcolor="DEDFDE">状态:</td>
    <td width="88%" colspan="5" align=center bgcolor="EFEFEF"> <div align="left"><%=rs("status")%></div></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td align=center height=18  bgcolor="DEDFDE">投票时段:</td>
    <td colspan="5" align=center bgcolor="EFEFEF"> <div align="left"><%=rs("fromdate")%>-<%=rs("todate")%></div></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td align=center height=18  bgcolor="DEDFDE">描述</td>
    <td colspan="5" align=center bgcolor="EFEFEF"> <div align="left"><%=rs("description")%></div></td>
  </tr>
</table>

  
<br><form name="form1" method="post" action="">
  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF">
    <%
  set rs2=conn.execute("select polllineid,subject,count(*) as count from v_pollresult where pollid="&rs("pollid")&" group by subject,polllineid order by count desc")
  set rs3=conn.execute("select count(*) as totalcount from v_pollresult where pollid="&rs("pollid"))
  
  do while not rs2.eof
  bwidth=rs2("count")/rs3("totalcount")*300
   bpercent=int(rs2("count")/rs3("totalcount")*10000)/100
  %>
    <tr> 
      <td width="30%" height=20 align=center bgcolor="DEDFDE"> <a href="javascript:opensubwin3('polllinedetail.asp?polllineid=<%=rs2("polllineid")%>','poll<%=pollid%>','toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=600,height=450,top=170,left=180');"><%=rs2("subject")%></a></td>
      <td width="10%" align=center bgcolor="EFEFEF"><%=rs2("count")%></td>
      <td colspan="5" align=center bgcolor="EFEFEF"> 
        <div align="left"><img src="b.bmp" width="<%=bwidth%>" height="20"> <%=bpercent%>%</div></td>
    </tr>
    <%
  rs2.movenext
  loop
  %>
  </table>
  </form>
<%
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
  %>
</body>
</html>

⌨️ 快捷键说明

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