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

📄 sta_1.asp

📁 这是去年开发的中移鼎讯手机进销存系统 大家
💻 ASP
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/ChkPurview.asp"-->
<%
'订单管理:SubOrder.asp
'用户限权检查
if GetUserGPower<>9999 then
	Call Msg("您没有访问权限",1,"")
end if

Dim Action,crs,csql
Dim fromTime,toTime
Dim t,t1,t2
Action = trim(Request("Action"))

fromTime = Request("fromTime")
toTime = Request("toTime")

if fromTime<>"" and toTime<>""  then
	fromTime = RequestTime(fromTime)
	toTime = RequestTime(toTime)
end if



%>
<html>
<head>
<title>(省)系统--市</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/mobile_sale.css" rel="stylesheet" type="text/css">
<script src="../js/ListOp.js" language=javascript></script>
<Script>
function getCorrectDateString(time)
  {
      var fbeg = time.indexOf("-", 0);
      var fend = time.indexOf("-",fbeg + 1);
      var fh = time.substring(0, fbeg);
      var fm = time.substring(fbeg + 1, fend);
      var fe = time.substring(fend + 1);
      var fhLen = fh.length;
      var fmLen = fm.length;
      var feLen = fe.length;
      if (fhLen < 4)
        fh = "20" + fh;
      if (fmLen < 2)
        fm = "0" + fm;
      if (feLen < 2)
        fe = "0" + fe;
      var tmp = fh + "-" + fm + "-" + fe;
      return tmp;
    }
function Checkfrm(){
	var fromTime = getCorrectDateString(document.all.fromTime.value);
	var toTime = getCorrectDateString(document.all.toTime.value);

		if(fromTime > toTime){
			alert('起始时间不能大于终止时间,请重新输入!');
			return false;
			}
		if(document.Frm2.fromTime.value==""){
			alert("请选择开始日期");
			document.Frm2.fromTime.focus();
			return false;
			}

}	

function dataExport()
{



//  document.Frm2.target = "_blank";
  document.Frm2.action = "sta_1.asp?Action=ExcelExport";
//  document.Frm2.submit();
//  return false;
}

</Script>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td height="22" colspan="2" align="center">统计</td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航:</strong></td>
    <td height="30">

<%
	Response.write "<a href=""Sta_0.asp"">我的统计</a> | "

	Response.write "<a href=""Sta_1.asp"">按地区统计</a> | "
	
	Response.write " <a href=""Sta_2.asp"">按县统计</a> | "
	
	Response.write " <a href=""Sta_3.asp"">按产品统计</a> | "
	
	Response.write " <a href=""Sta_4.asp"">回笼资金统计一</a> | "
	
	Response.write " <a href=""Sta_5.asp"">回笼资金统计二</a>"	
%>

	</td>
  </tr>
</table>
<br>
<form method="post" action="Sta_1.asp" name="Frm2" onsubmit="javascript:return Checkfrm();">
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr class="title"> 
      <td height="22" colspan="2"> <div align="center">按日期统计</div></td>
    </tr>
    <tr class="tdbg">
      <td width="20%" class="tdbg">统计日期</td>
      <td width="75%" class="tdbg"><input name=fromTime size=22  readonly>        &nbsp;
	    <img align=absMiddle alt="date picker" border=0 id=fromDivPos name=fromDivPos onMouseUp="toggleDatePicker('fromDiv','Frm2.fromTime')" src="../images/calendaricon.gif" width="34" height="21">
	    <div id=fromDiv style="POSITION: absolute; width: 50; left: 534px; top: 150px"></div>
	    <input name=toTime size=22  readonly value="<%=Format_Time(now(),2)%>">	    &nbsp;
	    <img align=absMiddle alt="date picker" border=0 id=toDivPos name=toDivPos onMouseUp="toggleDatePicker('toDiv','Frm2.toTime')" src="../images/calendaricon.gif" width="34" height="21">
	    <div id=toDiv style="POSITION: absolute; width: 50; left: 534px; top: 150px"></div>      
	    之间</td>
    </tr>
    <tr> 
      <td height="40" colspan="2" align="center" class="tdbg">
	  <input  type="Submit" name="Submit" value=" 统 计 " style="cursor:hand;"> &nbsp; 
	  <input type="submit" name="S2" value=" 导出到Execl中 " onClick="dataExport();"></td>
    </tr>

  </table>
</form>

<%

if Action="ExcelExport" then
	Call ExcelExport()
else
	Call Main()
end if

Sub main()
%>

<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr align="center" class="title">
    <td height="22">地区</td>
    <td colspan="2">申购数</td>
    <td colspan="2">进货货数</td>
    <td colspan="2">发货数</td>	
    <td colspan="2">回款数</td>
    <td>未回款</td>
    <td>库存数</td>
    <td>回款率</td>
  </tr>
  <tr align="center" class="topbg">
    <td height="22">&nbsp;</td>
    <td width="50">新增</td>
    <td width="80">累计</td>
    <td width="55">新增</td>
    <td width="80">累计</td>
    <td width="50">新增</td>
    <td width="80">累计</td>
    <td width="50">新增</td>
    <td width="80">累计</td>
    <td>未回款</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
<%
sql = "Select * from City order by CityID asc;"
Call sql_open(Rs,Sql,Conn,1,1)
if rs.eof and rs.bof then
	response.Write("地区市")
else
	Do while not rs.eof
%>	
  <tr align="center" class="tdbg" onmouseover="this.style.backgroundColor='#BFDFFF'" onmouseout="this.style.backgroundColor=''">
    <td height="22"><%=Rs("CityName")%></td> 
    <td><%response.Write Request_Num(999,"",Rs("CityID"),0,"",1,fromTime,toTime)%></td>
    <td><%response.Write Request_Num(999,"",Rs("CityID"),0,"",2,"","")%></td>
    <td><%response.Write InPro_Num(999,"",Rs("CityID"),0,"",1,fromTime,toTime)%></td>
    <td><%response.Write InPro_Num(999,"",Rs("CityID"),0,"",2,"","")%></td>
    <td><%response.Write OutPro_Num(999,"",Rs("CityID"),"","",1,fromTime,toTime)%></td>
    <td><%response.Write OutPro_Num(999,"",Rs("CityID"),"","",2,"","")%></td>
    <td><%response.Write Fund_Num(999,"",Rs("CityID"),"","",1,fromTime,toTime,0,1)%></td>
    <td><%response.Write Fund_Num(999,"",Rs("CityID"),"","",2,"","",0,1)%></td>
    <td><%
	t = 0
	t = clng(InPro_Num(999,"",Rs("CityID"),"","",2,"",""))-clng(Fund_Num(999,"",Rs("CityID"),"","",2,"","",0,1))
	response.Write t
	%></td>
    <td>
<%
	t = 0
	t = clng(InPro_Num(999,"",Rs("CityID"),"","",2,"",""))-clng(OutPro_Num(999,"",Rs("CityID"),"","",2,"",""))
	response.Write t
%>	
	</td>
    <td><%''未回款率
	t=0
	t1=0
	t2=0
	t1 = clng(Fund_Num(999,"",Rs("CityID"),"","",2,"","",0,1))
	t2 = clng(InPro_Num(999,"",Rs("CityID"),"","",2,"",""))
	if t1=0 or t2=0 then
		t=0
	else
		t =  100*(round((t1/t2),2))
	end if
		Response.write  t&"%"
		
		
	%>
	</td>
  </tr>
<%
	rs.movenext
	loop
end if

%>
</table>

<%
	call rs_end(rs)
End Sub
Sub ExcelExport()
dim sqlt
sqlt = "delete S_1"
conn.execute(sqlt)

'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Dim z0,z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11
Dim z11_1,z11_2
sql = "Select * from City order by CityID asc;"
Call sql_open(Rs,Sql,Conn,1,1)
if rs.eof and rs.bof then
	response.Write("地区市")
else
	Do while not rs.eof
'///////////////////////////////////////////////
z0 = Rs("CityName")
z1 = Request_Num(999,"",Rs("CityID"),0,"",1,fromTime,toTime)
z2 = Request_Num(999,"",Rs("CityID"),0,"",2,"","")
z3 = InPro_Num(999,"",Rs("CityID"),0,"",1,fromTime,toTime)
z4 = InPro_Num(999,"",Rs("CityID"),0,"",2,"","")
z5 = OutPro_Num(999,"",Rs("CityID"),"","",1,fromTime,toTime)
z6 = OutPro_Num(999,"",Rs("CityID"),"","",2,"","")
z7 = Fund_Num(999,"",Rs("CityID"),"","",1,fromTime,toTime,0,1)
z8 = Fund_Num(999,"",Rs("CityID"),"","",2,"","",0,1)
z9 = clng(InPro_Num(999,"",Rs("CityID"),"","",2,"",""))-clng(Fund_Num(999,"",Rs("CityID"),"","",2,"","",0,1))
z10 = clng(InPro_Num(999,"",Rs("CityID"),"","",2,"",""))-clng(OutPro_Num(999,"",Rs("CityID"),"","",2,"",""))
	z11=0
	z11_1=0
	z11_2=0
	z11_1 = clng(Fund_Num(999,"",Rs("CityID"),"","",2,"","",0,1))
	z11_2 = clng(InPro_Num(999,"",Rs("CityID"),"","",2,"",""))
	if z11_1=0 or z11_2=0 then
		z11=0
	else
		z11 =  100*(round((t1/t2),2))&"%"
	end if

csql = "Select * from S_1"

Call sql_open(crs,csql,Conn,3,3)
crs.addnew
crs("单位") = z0
crs("申购数量本期新增") = z1
crs("申购数量累计") = z2
'crs("") = z3
'crs("") = z4
crs("发货数量本期新增") = z5
crs("发货数量累计") = z6
crs("回款数量本期新增") = z7
crs("回款数量累计") = z8
crs("未回款") = z9
crs("库存数") = z10
crs("回款率") = z11
'rs("库存警戒量") = z12
crs.update
call rs_end(crs)
',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
	rs.movenext
	loop
end if
call rs_end(rs)
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'================================================
Dim objRS,objSql
Dim objExcel
Dim ExcelPath
objSql = "Select * from S_1;"
Call sql_open(objRS,objSql,Conn,3,3)

'ExcelPath = "Excel\" & SaveName & ".xls"
ExcelPath = "Excel\ExportData.xls"
Set objExcel = New ExcelGen

objExcel.RowOffset = 1
objExcel.ColumnOffset = 1
objExcel.GenerateWorksheet(objRS)
If objExcel.SaveWorksheet(Server.MapPath(ExcelPath)) then
	'Response.Write "<center> <a href='" & server.URLEncode(ExcelPath) & "'>已经导出,请下载</a></center>"
	Response.Redirect "Excel\ExportData.xls"
Else
	Response.Write "在保存过程中有错误!"
End If
Set objExcel = Nothing

call rs_end(objRS)
'==================================================

'	Call Main()
End Sub
%>	

⌨️ 快捷键说明

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