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

📄 orderreport.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 "report","read"
set objcheck=nothing%>
<%

if Request.Form("selusername")<>"" then
	strwhere =strwhere&" and userid='"&Request.Form("selusername")&"'"
else
	strwhere =strwhere &"and (userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"
end if

strwhere=strwhere&" and ordernum like '%"&Request.Form("Contain")&"%'"

if Request.Form("accountlevel")<>"" then
	strwhere=strwhere&" and accountlevel="&Request.Form("accountlevel")
end if

strwhere=strwhere&getcondition(Request.Form("selmethod1"),Request.Form("condition1"),1)
strwhere=strwhere&getcondition(Request.Form("selmethod2"),Request.Form("condition2"),2)
strwhere=strwhere&getcondition(Request.Form("selmethod3"),Request.Form("condition3"),3)

if Request.Form("status")<>"" then
	strwhere=strwhere&" and status='"&Request.Form("status")&"'"
end if

if Request.Form("startdate")<>"" then
	strwhere=strwhere&" and createdate>='"&Request.Form("startdate")&"'"
end if


if  Request.Form("enddate")<>"" then
	strwhere=strwhere&" and createdate<='"&Request.Form("enddate")&"'"
end if

dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring

sql="select * from v_order where 1=1 "&strwhere

rs.Open sql,conn,1,1

%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>合同报表</title>
</head>
<script language="JavaScript">
function window_onload()
{
window.moveTo(-2,-2);
window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
<body leftmargin="10" rightmargin="10" topmargin="10" onload="window_onload()">
<form name="form1" method="post" action="account.asp">
  <table align="center" width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
    <tr align="left"> 
      <td> 
        <div align="left"><strong><em><font size="4" face="黑体">合同报表</font></em></strong></div></td>
    </tr>
  <tr> 
    <td height=2 colspan="3" bgcolor="#4A699C"></td>
  </tr>
	<tr><td  colspan="3" height=4></td></tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
    <tr> 
      <td width="10%"> 
        <div align="right"><em>所有者:</em></div></td>
      <td width="10%"> 
        <div align="center"><%=getfieldvalue("usertable","loginid",Request.Form("selusername"),"username")%></div></td>
      <td width="10%"> 
        <div align="right"><em>合同状态:</em></div></td>
      <td width="10%"><div align="center"><%=request.form("status")%></div></td>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr> 
      <td width="10%"> 
        <div align="right"><em>统计条件1:</em></div></td>
      <td width="10%"> 
        <div align="center"><%=Request.Form("condition1name")%></div></td>
      <td width="10%"> 
        <div align="right"><em>创建时间(从):</em></div></td>
      <td width="10%">
<div align="center"><%=request.form("startdate")%></div></td>
      <td width="4%"> <div align="center"><em>(至)</em></div></td>
      <td width="10%">
<div align="center"><%=request.form("enddate")%></div></td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td width="10%"> 
        <div align="right"><em>统计条件2:</em></div></td>
      <td width="10%">
<div align="center"><%=Request.Form("condition2name")%> </div></td>
      <td width="10%">&nbsp;</td>
      <td width="10%">&nbsp;</td>
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr> 
      <td width="10%"> 
        <div align="right"><em>统计条件3:</em></div></td>
      <td width="10%"> 
        <div align="center"><%=Request.Form("condition3name")%></div></td>
      <td width="10%"> 
        <div align="right"></div></td>
      <td width="10%">
<div align="center"></div></td>
      <td colspan="3">&nbsp;</td>
    </tr>
  </table>  
  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
    <tr bgcolor="#006699"> 
      <td height=18 align=center><font color="#FFFFFF">序号</font></td>
      <td height=18 align=center><font color="#FFFFFF">合同</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF"><%=Request.Form("selmethod1")%></font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF"><%=Request.Form("selmethod2")%></font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF"><%=Request.Form("selmethod3")%></font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">签订日期</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">金额</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">销售员</font></td>
    </tr>
    <%
    i=1
    totalamount=0
  do while not rs.EOF%>
    <tr bgcolor="#99CCCC"> 
      <td align=center><%=i%></td>
      <td height=18 align=center><%=rs("ordernum")%></td>
      <td align=center><%=rs(session("reportfield1"))%></td>
      <td align=center><%=rs(session("reportfield2"))%></td>
      <td align=center><%=rs(session("reportfield3"))%></td>
      <td align=center><%=rs("signeddate")%></td>
      <td align=right><%=formatnumber(rs("totalamount"),2)%></td>
      <td align=center><%=rs("owner")%></td>
    </tr>
    <%
    totalamount=totalamount+ccur(rs("totalamount"))
  i=i+1
  rs.MoveNext
  loop
  
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
  %>
    <tr bgcolor="#99CCCC"> 
      <td align=center>合计</td>
      <td height=18 align=center></td>
      <td align=center></td>
      <td align=center></td>
      <td align=center></td>
      <td align=center></td>
      <td align=right><%=formatnumber(totalamount,2)%></td>
      <td align=center></td>
    </tr>
  </table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td><div align="left"><%=getfieldvalue("company","id","1","company")%>&nbsp;&nbsp;<%=getfieldvalue("company","id","1","address")%></div></td>
  </tr>
  <tr> 
    <td height=2 bgcolor="#4A699C"></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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