vote_show.asp

来自「这是一个学生毕业时做的教务系统」· ASP 代码 · 共 104 行

ASP
104
字号
<!--#include file=include/conn.asp -->
<%set rs6=server.CreateObject("adodb.recordset")
sql="select top 1 * from vote_bigclass order by ID DESC"
rs6.open sql,conn,1,1
id=rs6("id")
%>
<%set rsTp=server.CreateObject("adodb.recordset")
  sqlTp="select * from vote_bigclass where id="&id
  rsTp.open sqlTp,conn%>
  <%set rs=server.CreateObject("adodb.recordset")
    sql="select * from vote_smallclass where extends="&id&" order by id desc"
	rs.open sql,conn%>
	  <%set rsTotle=server.CreateObject("adodb.recordset")
    sqlTotle="select SUM(num) from vote_smallclass where extends="&id
	rsTotle.open sqlTotle,conn
	if rsTotle(0)=0 then
	   response.write "目前还没有投票数!"
	else%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=redcaff%></title>
<style type="text/css">
<!--

.style1 {color: #FFFFFF}
.style3 {color: #5284AD}
.style4 {color: #CC0000}

}
-->
</style>
<link href="news.css" rel="stylesheet" type="text/css">
</head>
<!--#include file=include/top.asp -->
<body bgcolor="#f4f4f4">
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="5" background="images/bgimg_left.gif">&nbsp;</td>
    <td bgcolor="#FFFFFF"><br>
      <table width="600" height="457"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="cccccc">
        <tr> 
          <td width="100%" height="455" valign="top" bgcolor="#FFFFFF"> 
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="45" valign="middle" bgcolor="f4f4f4"> 
                  <div align="center"><span class="style1"><font color="#000000">关于“</font></span><font color="#666666"><span class="style3"><%=rsTp("title")%></span><font color="#000000">”的主题投票结果如下:</font>
                    </font> </div></td>
              </tr>
            </table>
            <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="25">&nbsp;</td>
              </tr>
            </table>
            <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="179"> 
                  <%do while not rs.eof%>
                  <table width="100%"  border="0" cellspacing="4" cellpadding="0">
                    <tr> 
                      <td width="19%"><%=rs("choice")%></td>
                      <td width="61%"><img src="images/dot3.gif" width="<%=int(100*rs("num")/rsTotle(0))%>%" height="15"></td>
                      <td width="9%"><div align="right"><span class="style4"><%=int(100*rs("num")/rsTotle(0))%></span>%</div></td>
                      <td width="11%"><div align="right"><span class="style4"><%=rs("num")%></span>人</div></td>
                    </tr>
                  </table>
                  <%rs.movenext
		    loop
			rs.close
			set rs=nothing%>
                </td>
              </tr>
            </table>
            <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="46"><div align="right">共有<span class="style4"><%=rsTotle(0)%></span>张票数</div></td>
              </tr>
            </table>
            <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="25">&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      <br>
    </td>
    <td width="5" background="images/bgimg_right.gif">&nbsp;</td>
  </tr>
</table>


</body>
</html>
<%rsTotle.close

rs6.close
set rs6=nothing
  set rsTotle=nothing%>
  <%end if%>
  <!--#include file=include/bottom.asp -->

⌨️ 快捷键说明

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