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

📄 sheet_goods0120.asp

📁 物业管理和办公自动化系统
💻 ASP
字号:
<%
'##############################################################################
'#
'#		文 件 名	 : sheet_goods.asp
'#
'#
'#		创 建 人	 : yaoxiaohui
'#  	日   期	 : 2002-11-28
'#
'#		修改历史  : ****年**月**日 ******
'#      修改内容  : **************************************************
'#
'#		功能描述	 : 仓库报表
'#  	版   本	 : v1.0
'#	
'#	    Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'##############################################################################
'------------------------------------------------------------------------------
'----   服务器端设置
'------------------------------------------------------------------------------
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- include files begin -->

<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/commonpage.inc" -->

<!-- #include file="sheet_goods.inc" -->

<!-- include files end -->
<%
call CheckSecurity()

if hasright(ID_STOCK) < RIGHT_READ  then
	Response.Clear
	Response.Redirect "../include/error.asp?error=你没有查询权限!"
	Response.end
end if

'##############################################################################
'----   服务器端代码
'##############################################################################
dim conn
set conn = DBConnection
'******************************************************************************
'----   分页相关的变量定义
'------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby
Dim sFileName			: sFileName			= "sheet_goods.asp"
Dim iTotalRecords		: iTotalRecords		= 0			                ' 分页
Dim iRecordsPerPage		: iRecordsPerPage	= 25                        ' 一页8行
Dim iTotalPages			: iTotalPages		= 0
Dim iCols				: iCols				= 9                         ' 9列
Dim iCurrentPage		: iCurrentPage		= GetParam("Page")
Dim sSorting			: sSorting			= GetParam("Sorting")
Dim sSorted				: sSorted			= GetParam("Sorted")
Dim sSortParams			: sSortParams		= ""
Dim sFormParams			: sFormParams		= ""
Dim sDirection			: sDirection		= ""
'******************************************************************************
'----   查询参数
'------------------------------------------------------------------------------
dim pSheetStyle		: pSheetStyle	= GetParam("sheet_style")
dim pMonth			: pMonth		= GetParam("month")
dim pYear			: pYear			= GetParam("year")
dim pDepotID		: pDepotID	= GetParam("depot_id")

if IsEmpty(pDepotID) then 
	pDepotID = -1
end if
if IsEmpty(pYear) then
	pYear		= year(date)
end if
if IsEmpty(pMonth) then 
	pMonth		= month(date)
end if

dim pOpdate1	: pOpdate1	= dateSerial(pYear, pMonth, 1)
dim pOpdate2	: pOpdate2	= dateAdd("m", 1, pOpdate1)
dim sDate
if IsEmpty(pSheetStyle) then 
	pSheetStyle = "月份"
	sDate = pYear & "年度" & pMonth & "月份"
else
	if pSheetStyle = "月份" then
		sDate = pYear & "年度" & pMonth & pSheetStyle
		pOpdate1	= dateSerial(pYear, pMonth, 1)
		pOpdate2	= dateAdd("m", 1, pOpdate1)
	else
		sDate = pYear & pSheetStyle
		pOpdate1	= dateSerial(pYear, 1, 1)
		pOpdate2	= dateSerial(pYear + 1, 1, 1)
	end if
end if
'response.write pOpdate1 & "<br>" & pOpdate2 & "<br>" : response.end
sFormParams = "sheet_style=" & pSheetStyle & "&month=" & pMonth & "&year=" & pYear & "&depot_id=" & pDepotID & "&"
'******************************************************************************
'----   构造分页的SQL语句
'------------------------------------------------------------------------------
sSQL = "select t1.goods_id,t1.goods_name,t1.model,t1.quantity,t1.unit,t1.goods_type,t2.depot_name" & _
" from t_goods t1" & _
" left join t_depot t2 on t1.depot_id = t2.depot_id"
sWhere = " where t1.goods_id = t1.goods_id"
sOrderby = " order by t1.goods_id"
'******************************************************************************
'----   查询条件限制
'------------------------------------------------------------------------------
if pDepotID > 0 then sWhere = sWhere & " and t1.depot_id = " & ToSQL(pDepotID, "number")

'******************************************************************************
'----   分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'------------------------------------------------------------------------------
dim arrayFields(5), sDelimiter
sDelimiter = "*"
arrayFields(0)	=	"goods_id"
arrayFields(1)	=	"goods_name"
arrayFields(2)	=	"model"
arrayFields(3)	=	"quantity"
arrayFields(4)	=	"unit"
arrayFields(5)	=	"depot_name"

'response.write pSheetID  &"<BR>"
'response.write sSQL & sWhere & sOrderby  &"<BR>"
'response.end

call PrepareListData(conn,sSQL & sWhere & sOrderby, Join(arrayFields, sDelimiter), sDelimiter)
'******************************************************************************
%>

<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../include/common.css" type="text/css">

<!-- 日历 -->
<IFRAME style="display:none;position:absolute;width:148;height:194;z-index=100" ID="CalFrame" MarginHeight=0 MarginWidth=0 noresize frameborder=0 scrolling=no src="../include/cal/calendar.htm"></IFRAME>
<script language="javascript" src="../include/cal/calendar.js"></script>
<script for=document event="onclick()">
<!--
document.all.CalFrame.style.display="none";
//-->
</script>
<!-- 日历 -->

<style type="text/css">
.tdlist		{border-width:0px}
.tdHead	    {border-width:0px}
</style>

<script language="javascript">
function btnSearch_OnClick()
{
	if(frmSearch.sheet_style.value == "-1")
	{
		alert("请选择报表类型!");
		frmSearch.sheet_style.focus();
		return;
	}
	if(frmSearch.depot_id.value == "-1")
	{
		alert("请选择仓库!");
		frmSearch.depot_id.focus();
		return;
	}
	frmSearch.submit()
}
</script>

</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg/bg0.jpg">
<br>

<%
Response.Write OuterTableHeader
Response.Write HeaderWithMenu
Response.Write InnerTableHeader
'******************************************************************************
'----   主体从这里开始
'------------------------------------------------------------------------------
Response.Write TableSearch

Response.Write TableHeader
Response.Write TableRecords(sSQL & sWhere & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.Write TableAction(sSQL & sWhere & sOrderby ,pDepotID)
Response.Write TableLink
'------------------------------------------------------------------------------
'----   主体到这里结束
'******************************************************************************
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
Disconnect(conn)
%>

</body>
</html> 

⌨️ 快捷键说明

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