<!-- #include file="../conn.asp" -->
<!-- #include file="../const.asp" -->
<%
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 

call chksunzom()
if instr(quanxs,"m"&mxid&"x")<=0 and nowuserid<>1 then call sunzomqx()


sExport=requestA("export")
If sExport = "excel" Then
	Response.ContentType = "application/vnd.ms-excel"
	Response.AddHeader "Content-Disposition", "attachment; filename="&mxname&".xls"
End If
If sExport = "word" Then
	Response.ContentType = "application/vnd.ms-word"
	Response.AddHeader "Content-Disposition:", "attachment; filename="&mxname&".doc"
End If
If sExport = "csv" Then
	Response.ContentType = "application/csv"
	Response.AddHeader "Content-Disposition:", "attachment; filename="&mxname&".csv"
End If
mxname="系统数据总统计"

%>
<html>
<head>
<title><%=mxname%> -详情</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/sunzom.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../inc/jquery.js"></script>
<script type="text/javascript" src="../xheditor.js"></script>
<meta http-equiv="pragma" content="no-cache">
<META http-equiv="Cache-Control" CONTENT="no-cache, must-revalidate">
<META http-equiv="expires" CONTENT="0">
<style media="print" type="text/css"> .NoPrint{DISPLAY:none}</style>
<script language=javascript>
function doPrint() { 
bdhtml=window.document.body.innerHTML; 
sprnstr="<!--startprint-->"; 
eprnstr="<!--endprint-->"; 
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
window.document.body.innerHTML=prnhtml; 
window.print(); 
window.document.body.innerHTML=bdhtml;
}
function killErrors() {return true;}
window.onerror = killErrors;
</script>

</HEAD>
<BODY>
<%
'统计条数
Function tong1(fs,tian,dats)
if fs=1 then
whtj="  where DATEDIFF('D',tjsj,now())<"&tian&"  "
elseif fs=3 then
whtj="  where DATEDIFF('yyyy',tjsj,now())=0 "
else
whtj=" "
end if
tong=conn.execute("select COUNT(id) from "&dats&"   "&whtj&"")(0)
tong1=chk0(tong)
End Function

'统计总和
Function tong2(fs,tian,txiang,dats)
if fs=1 then
whtj="  where DATEDIFF('D',tjsj,now())<"&tian&"  "
elseif fs=3 then
whtj="  where DATEDIFF('yyyy',tjsj,now())=0 "
else
whtj=" "
end if
tong=conn.execute("select sum("&txiang&") from "&dats&"  "&whtj&"")(0)
tong2=chk0(tong)
End Function

Function tong3(fs,tian)
if fs=1 then 
whtj=" where DATEDIFF('D',tjsj,now())<"&tian&" " 
elseif fs=3 then
whtj="  where DATEDIFF('yyyy',tjsj,now())=0 "
else 
whtj=""
end if
e1=chk0(conn.execute("select sum(ZD_JEY) from MX_SFFY "&whtj&"")(0))
e2=chk0(conn.execute("select sum(ZD_JEY) from MX_SFFY "&whtj&"")(0))
e3=chk0(conn.execute("select sum(ZD_JEY) from MX_SFFY "&whtj&"")(0))
e4=chk0(conn.execute("select sum(ZD_JEY) from MX_SFFY "&whtj&"")(0))
e5=chk0(conn.execute("select sum(ZD_JEY) from MX_SFFY "&whtj&"")(0))
e6=chk0(conn.execute("select sum(ZD_JEY) from MX_SFFY "&whtj&"")(0))
e7=chk0(conn.execute("select sum(ZD_JEY) from MX_SFFY "&whtj&"")(0))
tong=e1+e2+e3+e4+e5+e6+e7
tong3=chk0(tong)
End Function

%>

<!--startprint-->

<h2 align="center"><%=gsname%>-<%=mxname%></h2><!--class="NoPrint"-->
<b>一、业务总统计</b>
<table border="1" width="100%" cellspacing="0" cellpadding="4" style="border-collapse: collapse" bordercolor="#000000">
	<tr>
		<td rowspan="2" style="border-color: #000000" bgcolor="#F3F3F3">业务/周期</td>
		<td colspan="4" align="center" style="border-color: #000000" bgcolor="#F3F3F3">基本业务</td>
		<td colspan="3" align="center" style="border-color: #000000" bgcolor="#F3F3F3">请批车</td>
	</tr>
	<tr>
		<td style="border-color: #000000" bgcolor="#F3F3F3">业务量</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">提单数</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">过磅吨</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">亏吨数</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">请车数</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">批车数</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">发车数</td>
	</tr>
	<tr>
		<td style="border-color: #000000">最近一周</td>
		<td style="border-color: #000000"><%=tong1(1,7,"MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_TSS","MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_SJD","MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_KDS","MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_BJS","MX_BC")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_PJS","MX_BC")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_ZJS","MX_BC")%></td>
	</tr>
	<tr>
		<td style="border-color: #000000">最近一月</td>
		<td style="border-color: #000000"><%=tong1(1,30,"MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_TSS","MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_SJD","MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_KDS","MX_YWGL")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_BJS","MX_BC")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_PJS","MX_BC")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_ZJS","MX_BC")%></td>
	</tr>
	<tr>
		<td style="border-color: #000000"><b>本年度内</b></td>
		<td style="border-color: #000000"><b><%=tong1(3,365,"MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_TSS","MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_SJD","MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_KDS","MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_BJS","MX_BC")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_PJS","MX_BC")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_ZJS","MX_BC")%></b></td>
	</tr>
	<tr>
		<td style="border-color: #000000"><b>系统总数据</b></td>
		<td style="border-color: #000000"><b><%=tong1(0,0,"MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_TSS","MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_SJD","MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_KDS","MX_YWGL")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_BJS","MX_BC")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_PJS","MX_BC")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_ZJS","MX_BC")%></b></td>
	</tr>
</table>
<br>
<b>二、财务总统计</b>
<table border="1" width="100%" cellspacing="0" cellpadding="4" style="border-collapse: collapse" bordercolor="#000000">
	<tr>
		<td rowspan="2" style="border-color: #000000" bgcolor="#F3F3F3">款项/周期</td>
		<td colspan="3" align="center" style="border-color: #000000" bgcolor="#F3F3F3">收款</td>
		<td colspan="3" align="center" style="border-color: #000000" bgcolor="#F3F3F3">付款</td>
		<td colspan="2" align="center" style="border-color: #000000" bgcolor="#F3F3F3">利润</td>
	</tr>
	<tr>
		<td style="border-color: #000000" bgcolor="#F3F3F3">应收款</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">实收款</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">未收款</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">应付款</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">实付款</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">未付款</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">应得利润</td>
		<td style="border-color: #000000" bgcolor="#F3F3F3">实际利润</td>
	</tr>
	<tr>
		<td style="border-color: #000000">最近一周</td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_HJ","MX_YSJE")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_JE","MX_YSRZ")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_HJ","MX_YSJE")-tong2(1,7,"ZD_JE","MX_YSRZ")%></td>
		<td style="border-color: #000000"><%=tong3(1,7)%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_JEY","MX_SFCZ")%></td>
		<td style="border-color: #000000"><%=tong3(1,7)-tong2(1,7,"ZD_JEY","MX_SFCZ")%></td>
		<td style="border-color: #000000"><%=tong3(1,7)-tong2(1,7,"ZD_JEY","MX_SFCZ")%></td>
		<td style="border-color: #000000"><%=tong2(1,7,"ZD_HJ","MX_YSJE")-tong2(1,7,"ZD_JEY","MX_SFCZ")%></td>
	</tr>
	<tr>
		<td style="border-color: #000000">最近一月</td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_HJ","MX_YSJE")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_JE","MX_YSRZ")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_HJ","MX_YSJE")-tong2(1,30,"ZD_JE","MX_YSRZ")%></td>
		<td style="border-color: #000000"><%=tong3(1,30)%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_JEY","MX_SFCZ")%></td>
		<td style="border-color: #000000"><%=tong3(1,30)-tong2(1,30,"ZD_JEY","MX_SFCZ")%></td>
		<td style="border-color: #000000"><%=tong3(1,30)-tong2(1,30,"ZD_JEY","MX_SFCZ")%></td>
		<td style="border-color: #000000"><%=tong2(1,30,"ZD_HJ","MX_YSJE")-tong2(1,30,"ZD_JEY","MX_SFCZ")%></td>
	</tr>
	<tr>
		<td style="border-color: #000000"><b>本年度内</b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_HJ","MX_YSJE")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_JE","MX_YSRZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_HJ","MX_YSJE")-tong2(3,365,"ZD_JE","MX_YSRZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong3(3,365)%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_JEY","MX_SFCZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong3(3,365)-tong2(3,365,"ZD_JEY","MX_SFCZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong3(3,365)-tong2(3,365,"ZD_JEY","MX_SFCZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(3,365,"ZD_HJ","MX_YSJE")-tong2(3,365,"ZD_JEY","MX_SFCZ")%></b></td>
	</tr>
	<tr>
		<td style="border-color: #000000"><b>系统总数据</b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_HJ","MX_YSJE")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_JE","MX_YSRZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_HJ","MX_YSJE")-tong2(0,0,"ZD_JE","MX_YSRZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong3(0,0)%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_JEY","MX_SFCZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong3(0,0)-tong2(0,0,"ZD_JEY","MX_SFCZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong3(0,0)-tong2(0,0,"ZD_JEY","MX_SFCZ")%></b></td>
		<td style="border-color: #000000"><b><%=tong2(0,0,"ZD_HJ","MX_YSJE")-tong2(0,0,"ZD_JEY","MX_SFCZ")%></b></td>
	</tr>
</table>

<hr>请及时更新系统数据有利于更准确的统计！<span style="float: right">制表人：<%=nowuser%></span><b><%'=gszhang%></b>
<%if sExport="" then%>
<!--endprint--><br><br><p align="center"><%=dayin%>  &nbsp;&nbsp;<a title="数据导出为Excel" href="baoZ.asp?mxid=<%=mxid%>&m1id=<%=m1id%>&xxid=<%=xxid%>&sid=<%=sid%>&export=excel"><img src="../images/exportxls.gif" width="16" height="16" border="0" class="NoPrint"></a>
&nbsp;&nbsp;<a  title="数据导出为WORD" href="baoZ.asp?mxid=<%=mxid%>&m1id=<%=m1id%>&xxid=<%=xxid%>&sid=<%=sid%>&export=word"><img src="../images/exportdoc.gif" width="16" height="16" border="0" class="NoPrint"></a>
&nbsp;&nbsp;<a  title="数据导出为CSV" href="baoZ.asp?mxid=<%=mxid%>&m1id=<%=m1id%>&xxid=<%=xxid%>&sid=<%=sid%>&export=csv"><img src="../images/exportcsv.gif" width="16" height="16" border="0" class="NoPrint"></a></p>
<%end if%>
</body>
</html>