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

📄 expensestat.asp

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

if request("statSearch")<>"" then
	strstatSearch=request.form("statSearch")
else
	strstatSearch="ownername"
end if

if Request.Form("namesearch")<>"" then
	strwhere =strwhere&" and owner='"&Request.Form("namesearch")&"'"
else
	if objcheck.CheckUserFunction2("payment","edit") or objcheck.CheckUserFunction2("expense","edit") then
		strwhere =strwhere
	else
		strwhere =strwhere &"and (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"
	end if
end if

if Request.Form("FdateSearch")<>"" then
	strFdate=Request.Form("FdateSearch")
	strwhere=strwhere&" and linedate>='"&cdate(strFdate)&"'"
else
	strFdate=date()-7
	strwhere=strwhere&" and linedate>='"&cdate(strFdate)&"'"
end if

if  Request.Form("EdateSearch")<>"" then
	strEdate=Request.Form("EdateSearch")
	strwhere=strwhere&" and linedate<'"&cdate(strEdate)+1&"'"
else
	strEdate=date()
	strwhere=strwhere&" and linedate<'"&cdate(strEdate)+1&"'"
end if

if Request.Form("ExpenseType")<>"" then
	strExpenseType=cint(Request.Form("ExpenseType"))
	strwhere=strwhere&" and expensetypeid='"&strExpenseType&"'"
end if

if request("statSearch2")="account" or request("statSearch")="account" then
	strwhere=strwhere&" and account<>''"
end if

Set rsexpreport=Server.CreateObject("ADODB.Recordset")
if request("statSearch2")="" then
	sql="SELECT "&strstatSearch&",COUNT(*) AS subnum,SUM(amount) AS subtamount FROM v_ExpenseLine where 1=1 "&strwhere&" and sysaccountid="&sysid
else
	sql="SELECT "&strstatSearch&","&request("statSearch2")&",COUNT(*) AS subnum, SUM(amount) AS subtamount FROM v_ExpenseLine where 1=1 "&strwhere&" and sysaccountid="&sysid
end if

if request("statSearch2")="" then
	sql=sql & " GROUP BY "&strstatSearch&" ORDER BY subtamount DESC "
else
	sql=sql & " GROUP BY "&strstatSearch&","&request("statSearch2")&" ORDER BY "&strstatSearch&" DESC "
end if
'response.write sql
rsexpreport.open sql,connexpreport,1,1
alls=rsexpreport.Recordcount

if request.form("statSearch")="expensetype" then
	dispname="费用类型"
elseif request.form("statSearch")="ownername" or request.form("statSearch")="" then
	dispname="销售员"
elseif request.form("statSearch")="expensestat" then
	dispname="费用状态"
elseif request.form("statSearch")="expensedate" then
	dispname="每日"
elseif request.form("statSearch")="expensemonth" then
	dispname="每月"
elseif request.form("statSearch")="account" then
	dispname="客户"
end if

if request.form("statSearch2")="expensetype" then
	dispname2="费用类型"
elseif request.form("statSearch2")="ownername" then
	dispname2="销售员"
elseif request.form("statSearch2")="expensestat" then
	dispname2="费用状态"
elseif request.form("statSearch2")="expensedate" then
	dispname2="每日"
elseif request.form("statSearch2")="expensemonth" then
	dispname2="每月"
elseif request.form("statSearch2")="account" then
	dispname2="客户"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../global.css" rel=stylesheet type=text/css>
<style type="text/css"></style>
<title>费用统计</title>
</head>
<SCRIPT language=JavaScript>
function opensubwin(attrstr,targ1)
{
	var tempwin=window.open(targ1,null,attrstr);
	tempwin.location.href=targ1;
	tempwin.opener=this;
}
function submit1(){
	window.form1.submit();
	return true;
}
</SCRIPT>
<script language=javascript src="../tools/newcalendar.js"></script>
<body leftmargin="10" rightmargin="10" topmargin="10">
<table align="center" border="0" cellPadding="0" width="100%"  style="font-size:10pt">
<form id=form1 name=form1 action="" method=post>
	<tr><td><select name=statSearch size=1 ID=Select1  LANGUAGE=javascript  onchange="submit1()">
	<option value="ownername" <%if request("statSearch")="ownername" then Response.Write " selected"%>>按销售员</option>
	<option value="expensetype" <%if request("statSearch")="expensetype" then Response.Write " selected"%>>按费用类型</option>
	<option value="expensestat" <%if request("statSearch")="expensestat" then Response.Write " selected"%>>按费用状态</option>
	<option value="account" <%if request("statSearch")="account" then Response.Write " selected"%>>按客户</option>
	<option value="expensedate" <%if request("statSearch")="expensedate" then Response.Write " selected"%>>按每日</option>
	<option value="expensemonth" <%if request("statSearch")="expensemonth" then Response.Write " selected"%>>按每月</option>
	</select>
	<select name=statSearch2 size=1 ID=Select1  LANGUAGE=javascript  onchange="submit1()">
	<option value="" <%if request("statSearch2")="" then Response.Write " selected"%>>--第二条件--</option>
	<option value="ownername" <%if request("statSearch2")="ownername" then Response.Write " selected"%>>按销售员</option>
	<option value="expensetype" <%if request("statSearch2")="expensetype" then Response.Write " selected"%>>按费用类型</option>
	<option value="expensestat" <%if request("statSearch2")="expensestat" then Response.Write " selected"%>>按费用状态</option>
	<option value="account" <%if request("statSearch2")="account" then Response.Write " selected"%>>按客户</option>
	<option value="expensedate" <%if request("statSearch2")="expensedate" then Response.Write " selected"%>>按每日</option>
	<option value="expensemonth" <%if request("statSearch2")="expensemonth" then Response.Write " selected"%>>按每月</option>
	</select>
	从<input name=FdateSearch size=9 language=javascript id=dupdatetime value='<%=strFdate%>' readonly><% call AddImg("date")%>
                <input type = hidden name=clicksource>
                <input type = hidden name=clickresult >
	到<input name=EdateSearch size=9 language=javascript id=dupdatetime2 value='<%=strEdate%>'  readonly><% call AddImg("date2")%>
	<select name=ExpenseType  LANGUAGE=javascript  onchange="submit1()">
		<option value="">--选择费用类型--</option>
		<%getdefine "费用类型",strExpenseType%>
	</select>
	<select name=nameSearch size=1 ID=Select1  LANGUAGE=javascript  onchange="submit1()">
	<option value="">--选择销售员--</option>
	<%getsubordinate Request.Form("namesearch")%>
	</select>
	<input type=submit name="Search" value="提交"></td></tr>
</form1>
</table>

<table cellspacing=0 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td> 
      <table cellspacing=0 cellpadding=0 width="100%" border=0>
    <tr> 
      <td height="25" colspan="4"><strong><font class=title><b>费用统计&nbsp;&nbsp;</b></font></strong>
		<select name=char size=1 ID=Select1 LANGUAGE=javascript  onchange="submit1()">
			<option value="" <%if request("char")="" then Response.Write " selected"%>>--查看图例--</option>
			<option value="pie" <%if request("char")="pie" then Response.Write " selected"%>>饼图</option>
			<option value="3dbar" <%if request("char")="3dbar" then Response.Write " selected"%>>3D柱形图</option>
			<option value="bar" <%if request("char")="bar" then Response.Write " selected"%>>柱形图</option>
			<option value="Line" <%if request("char")="Line" then Response.Write " selected"%>>线形图</option>
			<option value="filledline" <%if request("char")="filledline" then Response.Write " selected"%>>填充线形图</option>
		</select>
	  </td>
    </tr>
    <tr > 
      <td height="16" colspan="4" background="../images/title.gif">&nbsp;</td>
    </tr>
      </table>
    </td>
  </tr>
  <tr class="linecolor"><td height="2"></td></tr>
 <tr height="5px"><td></td></tr>
  </tbody>
 </table>
<%if request("statSearch2")="" then%>
<table align="center" cellspacing=1 cellpadding=1 width="100%" border=0 bgcolor="#ffffff" style="font-size:10pt">
              <tr bgcolor="#dedfde">
                <td align="center" width="5%" rowspan="2">排名</td>
                <td align="center" width="40%"><%=dispname%>数</td>
                <td align="center" width="10%">费用笔数</td>
                <td align="center" width="10%">占总费用</td>
                <td align="center" width="10%">费用</td>

⌨️ 快捷键说明

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