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

📄 yearpower.asp

📁 ASPTest 网络基础网页设计
💻 ASP
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title> </title>
<style>
<!--
td           { font-size: 12px }
-->
</style>
</head>

<body background="MusicBG.gif"> 

<!-- #include file="cnOpen.asp" -->

<%
Session("type") = Request("type")
Session("name") = Request("name")
Session("yYear1") = Request("yYear1")
Session("yYear2") = Request("yYear2")
Session("yYear3") = Request("yYear3")

Dim rsTerm,rsData
Dim strSQL
Dim year1,year2,year3
Dim yArray1(12),yArray2(12),yArray3(12)

year1 = CInt(Session("yYear1"))
year2 = CInt(Session("yYear2"))
year3 = CInt(Session("yYear3"))

Set rsTerm = Server.CreateObject("ADODB.RecordSet")
Set rsData = Server.CreateObject("ADODB.RecordSet")

If Session("Type") = "Term" Then
  strSQL = "SELECT TermNo FROM TermTable WHERE TermName='"&Session("Name")&"'"
ElseIf Session("Type") = "Buss" Then
  strSQL = "SELECT TermNo FROM TermTable WHERE BussName='"&Session("Name")&"'"
ElseIf Session("Type") = "Line" Then
  strSQL = "SELECT TermNo FROM TermTable WHERE LineName='"&Session("Name")&"'"
ElseIf Session("Type") = "All" Then
  strSQL = "SELECT TermNo FROM TermTable"
End If    

rsTerm.Open strSQL,cn
Do While Not rsTerm.Eof

  '取第一年数据
  rsData.Open "SELECT * FROM YearDataTable WHERE TermNo="&rsTerm(0)&" AND "&_
    "DataYear="&year1,cn       
  If Not rsData.Eof Then
    For i = 1 to 12 
      strField = "Data"&Cstr(i)
      If Not IsNull(rsData(strField)) Then 
        yArray1(i) = yArray1(i)+rsData(strField)
      End if
    Next
  End if
  rsData.Close

  '取第二年数据
  rsData.Open "SELECT * FROM YearDataTable WHERE TermNo="&rsTerm(0)&" AND "&_
    "DataYear="&year2,cn       
  If Not rsData.Eof Then
    For i = 1 to 12 
      strField = "Data"&Cstr(i)
      If Not IsNull(rsData(strField)) Then 
        yArray2(i) = yArray2(i)+rsData(strField)
      End if
    Next
  End if
  rsData.Close
  
  '取第三年数据
  rsData.Open "SELECT * FROM YearDataTable WHERE TermNo="&rsTerm(0)&" AND "&_
    "DataYear="&year3,cn       
  If Not rsData.Eof Then
    For i = 1 to 12 
      strField = "Data"&Cstr(i)
      If Not IsNull(rsData(strField)) Then 
        yArray3(i) = yArray3(i)+rsData(strField)
      End if
    Next
  End if
  rsData.Close
  
  rsTerm.MoveNext
Loop

rsTerm.Close
Set rsTerm = Nothing
Set rsData = Nothing
%>

<p align="center"><img src="YearPowerGraph.asp" align="center">

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700" align="center">
  <tr>
    <td width="79" align="center" bgcolor="#E3E3EC">年份\月份</td>
    <td width="51" align="center" bgcolor="#E3E3EC">1</td>
    <td width="51" align="center" bgcolor="#E3E3EC">2</td>
    <td width="51" align="center" bgcolor="#E3E3EC">3</td>
    <td width="51" align="center" bgcolor="#E3E3EC">4</td>
    <td width="51" align="center" bgcolor="#E3E3EC">5</td>
    <td width="51" align="center" bgcolor="#E3E3EC">6</td>
    <td width="52" align="center" bgcolor="#E3E3EC">7</td>
    <td width="52" align="center" bgcolor="#E3E3EC">8</td>
    <td width="52" align="center" bgcolor="#E3E3EC">9</td>
    <td width="52" align="center" bgcolor="#E3E3EC">10</td>
    <td width="52" align="center" bgcolor="#E3E3EC">11</td>
    <td width="52" align="center" bgcolor="#E3E3EC">12</td>
  </tr>
  <tr>
    <td width="79" align="center" bgcolor="#E3E3EC">
      <%=Session("yYear1")%>
    </td>
    <%
    For i=1 To 12
     If Not IsEmpty(yArray1(i)) Then
     %>
       <td width="51"><font color="red"><%=yArray1(i)%></font></td>
     <%
     Else
     %>
       <td width="52">-</td>
     <%
     End If
   Next
   %>
  </tr>
  <tr>
    <td width="79" align="center" bgcolor="#E3E3EC">
       <%=Session("yYear2")%> 
    </td>
    <%
    For i = 1 To 12
     If Not IsEmpty(yArray2(i)) Then
     %>
       <td width="51"><font color="blue"><%=yArray2(i)%></font></td>
     <%
     Else
     %>
       <td width="52">-</td>
     <%
     End If
   Next
   %>
  </tr>
  <tr>
    <td width="79" align="center" bgcolor="#E3E3EC">
       <%=Session("yYear3")%> 
    </td>
    <%
    For i = 1 To 12
     If Not IsEmpty(yArray3(i)) Then
     %>
       <td width="51"><font color="green"><%=yArray3(i)%></font></td>
     <%
     Else
     %>
       <td width="52">-</td>
     <%
     End If
   Next
   %>
  </tr>
</table>

<!-- #include file="cnOpen.asp" -->

</body>

</html>

⌨️ 快捷键说明

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