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

📄 yewuyuan.asp

📁 一个用asp实现简单的小型OA系统
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="session.asp"-->
<!--#include file="Connections/conn.asp" -->
<%
dates=request.QueryString("dates")
datee=request.QueryString("datee")
Dim Rs
Dim Rs_numRows

Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.ActiveConnection = MM_conn_STRING
Rs.Source = "SELECT realname,sum(fahuo) as sumfahuo,sum(daishou) as sumdaishou,sum(huikuan) as sumhuikuan,sum(fanli) as sumfanli,sum(qiankuan) as sumqiankuan,sum(alei) as sumalei,sum(blei) as sumblei  FROM Salesview where dates between #"&dates&"# and #"&datee&"# group by realname order by sum(fahuo) desc"
Rs.CursorType = 0
Rs.CursorLocation = 2
Rs.LockType = 1
Rs.Open()

Rs_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Rs_numRows = Rs_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Rs_total
Dim Rs_first
Dim Rs_last

' set the record count
Rs_total = Rs.RecordCount

' set the number of rows displayed on this page
If (Rs_numRows < 0) Then
  Rs_numRows = Rs_total
Elseif (Rs_numRows = 0) Then
  Rs_numRows = 1
End If

' set the first and last displayed record
Rs_first = 1
Rs_last  = Rs_first + Rs_numRows - 1

' if we have the correct record count, check the other stats
If (Rs_total <> -1) Then
  If (Rs_first > Rs_total) Then
    Rs_first = Rs_total
  End If
  If (Rs_last > Rs_total) Then
    Rs_last = Rs_total
  End If
  If (Rs_numRows > Rs_total) Then
    Rs_numRows = Rs_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (Rs_total = -1) Then

  ' count the total records by iterating through the recordset
  Rs_total=0
  While (Not Rs.EOF)
    Rs_total = Rs_total + 1
    Rs.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (Rs.CursorType > 0) Then
    Rs.MoveFirst
  Else
    Rs.Requery
  End If

  ' set the number of rows displayed on this page
  If (Rs_numRows < 0 Or Rs_numRows > Rs_total) Then
    Rs_numRows = Rs_total
  End If

  ' set the first and last displayed record
  Rs_first = 1
  Rs_last = Rs_first + Rs_numRows - 1
  
  If (Rs_first > Rs_total) Then
    Rs_first = Rs_total
  End If
  If (Rs_last > Rs_total) Then
    Rs_last = Rs_total
  End If

End If
%><!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>业务员业绩显示表</title>
<link href="sty.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="600" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="799ae1">
  <caption>
  <strong>  业务员业绩显示表
  </strong>
  </caption>
  <tr align="center" bgcolor="#FFFFFF">
    <td colspan="8">&nbsp; 记录 <%=(Rs_first)%> 到 <%=(Rs_last)%> (总共 <%=(Rs_total)%>条记录) </td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
    <td>姓名</td>
    <td>发货量</td>
    <td>代收款</td>
    <td>汇款</td>
    <td>返利</td>
    <td>欠款</td>
    <td>A类</td>
    <td>B类</td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT Rs.EOF)) 
%>
  <tr bgcolor="#FFFFFF">
    <td align="center"><%=(Rs.Fields.Item("realname").Value)%></td>
    <td align="right"><%=(Rs.Fields.Item("sumfahuo").Value)%></td>
    <td align="right"><%=(Rs.Fields.Item("sumdaishou").Value)%></td>
    <td align="right"><%=(Rs.Fields.Item("sumhuikuan").Value)%></td>
    <td align="right"><%=(Rs.Fields.Item("sumfanli").Value)%></td>
    <td align="right"><%=(Rs.Fields.Item("sumqiankuan").Value)%></td>
    <td align="right"><%=(Rs.Fields.Item("sumalei").Value)%></td>
    <td align="right"><%=(Rs.Fields.Item("sumblei").Value)%></td>
  </tr>
  <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Rs.MoveNext()
Wend
%>
  <tr bgcolor="#FFFFFF">
    <td colspan="8">&nbsp;
      </td>
  </tr>
</table>
</body>
</html>
<%
Rs.Close()
Set Rs = Nothing
%>

⌨️ 快捷键说明

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