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

📄 borrow_input_detail.inc.bak

📁 物业管理和办公自动化系统
💻 BAK
字号:
<%
'###############################################################################
'#
'#	文件名	 : borrow_input_detail.inc
'#	
'#      创建人	 : yaoxiaohui
'#      日期	 : 2002-11-06
'#
'#	修改历史  : ****年**月**日 ****** 
'#      修改内容  : *********************************
'#
'#	功能描述	 : 归还物品和设备入库函数文件
'#      版   本	 : v1.0
'#
'#      Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'###############################################################################
Function TableHeader()
	TableHeader = _
		"<table cellspacing=1 cellpadding=0 width=""100%"" align=center bgcolor=silver style=""table-layout:fixed"">" & vbLF & _
		"<tr style=""display:none"">" & vbLF & _
		"	<td width=80>这一行仅用于控制表格的宽度</td>" & vbLF & _
		"	<td width=40></td>" & vbLF & _
		"	<td width=80></td>" & vbLF & _
		"	<td width=80></td>" & vbLF & _
		"	<td width=80></td>" & vbLF & _
		"	<td width=60></td>" & vbLF & _
		"	<td width=60></td>" & vbLF & _
		"	<td width=120></td></tr>" & vbLF & _
		"<tr height=20>" & _
		"<td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"">待选归还物品一览</td></tr>" & _
		"<tr bgcolor=white>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "goods_id", "物品代码", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>选择</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "cargo_name", "物品名称", sFormParams, sSorting, sSorted) & 	"</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "sheet_id", "借用单编号", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "model", "型号规格", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "quantity", "数量", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "unit", "单位", sFormParams, sSorting, sSorted) & "</td>" & _
		"<td class=tdHead align=center>&nbsp;" & TableHeaderField(sFileName, "due_return_date", "预计归还日期", sFormParams, sSorting, sSorted) & "</td>" & _
		"</tr>"
End Function

'*********************************************************************************************
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp	: sTemp = ""	' 临时字符串变量
	dim j, sql,i,arrayID					' 临时循环变量
	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	Dim rowCount        : rowCount = 0

'	response.write sSQL & "<br>"
'	response.end
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
	dim rs	: set rs = Openrs(conn,sSQL)
	dim rs1

	dim sGoodsID, sGoodsName,sSheetID ,sModel, sUnit, sQuantity, sDueDate, sRealDate
	
	''response.write sSQL : response.end
	
	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
	if Not rs.EOF then		
		rs.move (iCurrentPage - 1) * iRecordsPerPage
	end if

	
	while not rs.EOF and iCounter <= iRecordsPerPage
	    rowCount = rowCount + 1
		sGoodsID			    = GetValue(rs,"goods_id")
		sGoodsName		    	= GetValue(rs,"goods_name")
		sSheetID			    = GetValue(rs,"sheet_id")
		sModel			        = GetValue(rs,"model")
		sQuantity	    		= GetValue(rs,"quantity")
		sUnit		        	= GetValue(rs,"unit")
		sDueDate                = GetValue(rs,"due_return_date")
		sRealDate				= GetValue(rs,"real_returned_date")
		
		sql = "select goods_id from t_stock_detail where goods_id =" & ToSQL(sGoodsID,"text") & _
		" and goods_name =" & ToSQL(sGoodsName,"text") & _
		" and model =" & ToSQL(sModel,"text") & _
		" and quantity =" & ToSQL(sQuantity,"text") & _
		" and unit =" & ToSQL(sUnit,"text") & _
		" and opdate =" & ToSQL(sRealDate,"text")
		rs1 = DLookUp(conn,sql)
		if rs1 = "" then
		sTemp = sTemp & "<tr bgcolor=white height=20>" & _
                "<td align=center title=""" & sGoodsID & """ nowrap>&nbsp;" & sGoodsID & "&nbsp;</td>" & _
				"<td align=center><input type=""checkbox"" id=choose1_" & rowCount & " name=""choose1"" value=""" & rowCount & """ style=""border-width:0""></td>" & vbLF & _
				"<input type=""hidden"" name=""goods_id1_" & rowCount & """ value=""" & sGoodsID & """>" & vbLF & _
				"<td align=center title=""" & sGoodsName & """ nowrap>&nbsp;" & sGoodsName & "&nbsp;</td>" & _
				"<td align=center title=""" & sSheetID & """ nowrap>&nbsp;" & sSheetID & "&nbsp;</td>" & _
				"<td align=center title=""" & sModel & """ nowrap>&nbsp;" & sModel & "&nbsp;</td>" & _								
				"<td align=center title=""" & sQuantity & """ nowrap>&nbsp;" & sQuantity & "&nbsp;</td>" & _
				"<td align=center title=""" & sUnit & """ nowrap>&nbsp;" & sUnit & "&nbsp;</td>" & _
				"<td align=center title=""" & sDueDate & """ nowrap>&nbsp;" & sDueDate & "&nbsp;</td>" & _
				"</tr>"
		else
		sTemp = sTemp & "<tr bgcolor=white height=20>" & _
                "<td align=center title=""" & sGoodsID & """ nowrap>&nbsp;(已归还)" & sGoodsID & "&nbsp;</td>" & _
				"<td align=center><input type=""checkbox"" id=choose1_" & rowCount & " name=""choose1"" value=""" & rowCount & """></td>" & vbLF & _
				"<input type=""hidden"" name=""goods_id1_" & rowCount & """ value=""" & sGoodsID & """>" & vbLF & _
				"<td align=center title=""" & sGoodsName & """ nowrap>&nbsp;" & sGoodsName & "&nbsp;</td>" & _
				"<td align=center title=""" & sSheetID & """ nowrap>&nbsp;" & sSheetID & "&nbsp;</td>" & _
				"<td align=center title=""" & sModel & """ nowrap>&nbsp;" & sModel & "&nbsp;</td>" & _								
				"<td align=center title=""" & sQuantity & """ nowrap>&nbsp;" & sQuantity & "&nbsp;</td>" & _
				"<td align=center title=""" & sUnit & """ nowrap>&nbsp;" & sUnit & "&nbsp;</td>" & _
				"<td align=center title=""" & sDueDate & """ nowrap>&nbsp;" & sDueDate & "&nbsp;</td>" & _
				"</tr>"
		end if
		iCounter = iCounter + 1
		rs.movenext
	wend
	rs.Close()
	set rs = nothing
	' 填补空白行
	sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)

	' 首页、前页、后页、尾页等分页信息
	sTemp = sTemp & "<tr bgcolor=white height=20><td colspan=" & iCols & " align=right>" & _
				Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
				"&nbsp;</td></tr>"
	TableRecords = _
	            "<form method=post name=""frmInput"" action=""" & sFileName & """>" & vbLF & _
				"<input type=""hidden"" name=""FormAction"" value=""input"">" & vbLF & _
				"<input type=""hidden"" name=""sheet_id"" value=""" & pSheetID & """>" & vbLF & _
				"<input type=""hidden"" name=""i_id"" value=""" & pGoodsID & """>" & vbLF & _
				sTemp & vbLF & _
				ActionLink1 & vbLF
End Function
'*********************************************************************************************
Function TableRecords2(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp	: sTemp = ""	' 临时字符串变量
	dim j					' 临时循环变量

	call PrepareListData(conn,sSQL, Join(arrayFields, sDelimiter), sDelimiter)
	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	Dim rowCount        : rowCount = 0

'	response.write sSQL & "<br>"
'	response.end
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
	dim rs	: set rs = Openrs(conn,sSQL)

	dim sGoodsID, sGoodsName,sSheetID ,sModel, sUnit, sQuantity, sDueDate
	
	''response.write sSQL : response.end

	if rs.EOF then
    iCols			= 8 
	iCounter        = 5
	sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)
	end if
	
	''response.write sSQL : response.end
	
	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
	if Not rs.EOF then		
		rs.move (iCurrentPage - 1) * iRecordsPerPage
	end if

	
	while not rs.EOF and iCounter <= iRecordsPerPage
	    rowCount = rowCount + 1
		sGoodsID			    = rs("goods_id")
		sGoodsName		    	= rs("goods_name")
		sSheetID			    = rs("sheet_id")
		sModel			        = rs("model")
		sQuantity	    		= rs("quantity")
		sUnit		        	= rs("unit")
		sDueDate                = rs("due_return_date")		

		sTemp = sTemp & "<tr bgcolor=white height=20>" & _
                "<td align=center title=""" & sGoodsID & """ nowrap>&nbsp;" & sGoodsID & "&nbsp;</td>" & _
				"<td align=center><input type=""checkbox"" id=choose2_" & rowCount & " name=""choose2"" value=""" & rowCount & """ style=""border-width:0""></td>" & vbLF & _
				"<input type=""hidden"" name=""goods_id2_" & rowCount & """ value=""" & sGoodsID & """>" & vbLF & _
				"<td align=center title=""" & sGoodsName & """ nowrap>&nbsp;" & sGoodsName & "&nbsp;</td>" & _
				"<td align=center title=""" & sSheetID & """ nowrap>&nbsp;" & sSheetID & "&nbsp;</td>" & _
				"<td align=center title=""" & sModel & """ nowrap>&nbsp;" & sModel & "&nbsp;</td>" & _								
				"<td align=center title=""" & sQuantity & """ nowrap>&nbsp;" & sQuantity & "&nbsp;</td>" & _
				"<td align=center title=""" & sUnit & """ nowrap>&nbsp;" & sUnit & "&nbsp;</td>" & _
				"<td align=center title=""" & sDueDate & """ nowrap>&nbsp;" & sDueDate & "&nbsp;</td>" & _
				"</tr>"
		iCounter = iCounter + 1
		rs.movenext
	wend
	rs.Close()
	set rs = nothing

	' 填补空白行
	sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)

	' 首页、前页、后页、尾页等分页信息
	sTemp = sTemp & "<tr bgcolor=white height=20><td colspan=" & iCols & " align=right>" & _
				Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
				"&nbsp;</td></tr>"
	
	TableRecords2 = _
			"<table cellspacing=1 cellpadding=0 width=""100%"" align=center bgcolor=silver style=""table-layout:fixed"">" & vbLF & _
		    "<tr style=""display:none"">" & vbLF & _
		    "	<td width=80>这一行仅用于控制表格的宽度</td>" & vbLF & _
			"	<td width=40></td>" & vbLF & _
			"	<td width=80></td>" & vbLF & _
			"	<td width=80></td>" & vbLF & _
			"	<td width=80></td>" & vbLF & _
			"	<td width=60></td>" & vbLF & _
			"	<td width=60></td>" & vbLF & _
			"	<td width=120></td></tr>" & vbLF & _
			"<tr height=20>" & _
			"<td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"">决定归还物品</td></tr>" & _
			sTemp & vbLF & _
			ActionLink2 & vbLF
End Function
'*********************************************************************************************
Function ActionLink1
		ActionLink1 = _
			"<img height=2>" & _
			"<table cellspacing=0 cellpadding=1 width=""100%"" align=center bgcolor=""#0099cc"" style=""color:white"">" & vbLF & _
			"<tr height=20>" & vbLF & _
			"		<td align=right" & _
						" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""CheckAllRows1();"">全部选中</td>" & vbLF & _
			"		<td align=center" & _
						" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnInput_OnClick();"">添加</td>" & vbLF & _
			"</tr>" & vbLF & _
			"</table>" & vbLF
End Function
'*********************************************************************************************
Function ActionLink2
		ActionLink2 = _
			"<img height=2>" & _
			"<table cellspacing=0 cellpadding=1 width=""100%"" align=center bgcolor=""#0099cc"" style=""color:white"">" & vbLF & _
			"<tr height=20>" & vbLF & _
			"		<td align=right" & _
						" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""CheckAllRows2();"">全部选中</td>" & vbLF & _
			"		<td align=center" & _
						" style=""cursor:hand"" onmouseover=""mover();"" onmouseout=""mout();"" onclick=""btnOutput_OnClick();"">剔除</td>" & vbLF & _
			"</tr>" & vbLF & _
			"</table>" & vbLF
End Function

function TableAction()
	TableAction = _
		"<table width=""100%"" cellspacing=0 cellpadding=5 height=30 align=center>" & vbLF & _
		"	<tr>" & vbLF & _
		"	<td align=center>" & _
		"		<a style=""color:blue;cursor:hand"" onclick=""btnNext_OnClick();""><img border=0 src=""../images/arrowr.gif"">&nbsp;进入物品归还页面</a>" & vbLF & _
		"		&nbsp;&nbsp;&nbsp;" & vbLF & _
		"		<a style=""color:blue;cursor:hand;"" onclick=""btnCancel_OnClick();""><img border=0 src=""../images/delete.gif"">&nbsp;返回选择入库方式页面</a>" & vbLF & _
		"   </td>" & vbLF & _
		"	</tr>" & vbLF & _
		"</table></form>"
end function
'*********************************************************************************************
sub Input(choose1)
	dim arrayInput, sGoodsID, j
	dim InputID : InputID = session("goods_id_for_input")
	session.contents.remove "goods_id_for_input"

'	response.write choose & "<br>"
'	response.end

	arrayInput = split(choose1, ",")
'	response.Write arrayInput(0) & "<br>"
'	response.end
	for j = 0 to UBound(arrayInput) step 1
		sGoodsID = GetParam("goods_id1_" & Trim(arrayInput(j))) 
		InputID = InputID & "," & sGoodsID
	next
	session("goods_id_for_input") = InputID
end sub
'*********************************************************************************************
sub Output(choose2)
	dim arrayOutput, sGoodsID, j, i
	dim arrayID, InputID
	dim sOutputID : sOutputID = session("goods_id_for_input")
    session.contents.remove "goods_id_for_input"
    arrayID = split(sOutputID,",")
	arrayOutput = split(choose2, ",")
	
	for j = 0 to UBound(arrayOutput) step 1
		InputID = arrayID(0)
		sGoodsID = GetParam("goods_id2_" & Trim(arrayOutput(j)))		
		for i = 1 to UBound(arrayID) step 1				
			if arrayID(i) <> sGoodsID then
				InputID = InputID & "," & arrayID(i)
			end if
		next
		arrayID = split(InputID,",")
	next
	session("goods_id_for_input") = InputID
end sub
'*******************************************************************************
Sub NextStep()

response.redirect "borrow_input_master.asp?sheet_id=" & pSheetID

End Sub

Sub Cancel()
	session.contents.remove "goods_id_for_input"
	response.redirect "goods_input.asp"
	response.end
End Sub
%> 

⌨️ 快捷键说明

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