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

📄 eaprint.inc.bak

📁 物业管理和办公自动化系统
💻 BAK
字号:
<%

''*******************************************************************************
'********************************************************************************************************
	Dim gSid : gSid = GetParam("id")
	Dim gEid : gEid = GetParam("eid")

If IsEmpty(gEid) Then
	werr("参数不足")
End If

' 建立数据库连接
dim conn
Set conn=DBConnection

'-------------------------------------------------------------------------------------------------------------------------------
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby		:
Dim sFileName				: sFileName = "eaccessory.asp"
Dim iTotalRecords			: iTotalRecords = 0			' 分页
Dim iRecordsPerPage			: iRecordsPerPage = 5
Dim iTotalPages				: iTotalPages = 0
Dim iCols				: iCols = 5
Dim iCurrentPage			: iCurrentPage = GetParam("Page")
Dim sSorting				: sSorting = GetParam("Sorting")
Dim sSorted				: sSorted = GetParam("Sorted")
Dim sSortParams				: sSortParams = ""
Dim sFormParams				: sFormParams = "eid=" & gEid & "&"
Dim sDirection				: sDirection = ""


''*******************************************************************************
'' 构造分页的SQL语句
''*******************************************************************************
sSQL = "select * from t_accessory where equi_id=" & gEid
'sOrderby = " order by name asc"
'sWhere = 
''*******************************************************************************
'' 构造Where子句
'-------------------------------------------------------------------------------------------------------------------------------
' 定义全局变量 ---- 查询参数


'response.write sSQL & sWhere & sOrderby & "<br>"
'response.end
''*******************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'-------------------------------------------------------------------------------------------------------------------------------
dim nf			:	nf		= Array("名称","型号规格","启用时间","数量","保养商")
dim arrayFields		:	arrayFields	= Array("name","model","starttime","quantity","maintainer")
dim sDelimiter		:	sDelimiter	= "*"
dim lb			:	lb		= LBound(nf)
dim ub			:	ub		= UBound(nf)
'call PrepareListData(conn, sSQL, Join(arrayFields, sDelimiter), sDelimiter)
''*******************************************************************************


Function VarTable(eid)
	dim en(14),ev(14)
	dim en1(14),ev1(14)
	dim sql
	dim rs
	dim s1,s2,s3
	dim i,j

	
	s3 = ListTableHeader 
	s3 = s3 & ListTableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
	s3 = s3& ListTableTailer
	
	dim sTemp
	sTemp = "<table width=600 cellspacing=0 rules=none cellpadding=3 border=1 align=center >"
	sTemp = sTemp & "<tr><td>" & EqTable(eid) &"</td></tr>"
	sTemp = sTemp & "<tr><td>"  & s3 & "</td></tr>"
	sTemp = sTemp & "</table>"
	VarTable = TitleTable(eid) & sTemp & ToolTable	
	
'	VarTable = TitleTable(eid) & EqTable(eid) & TableHeader & s3 & wtbe & ToolTable
End Function
' 

Function TitleTable(eid)
	dim f1,f2,f3
	dim sql

	TitleTable= wtbas(wra(wdas("上海信息大楼设备台帐(设备附件)","style=""font:20px"" width=600 align=center")),"border=0 align=center ")
	
	sql = "select department from t_equipment where equi_id=" & eid
	f1 = DLookup(conn,sql)
	f1 = "部门: " & f1 
	

	sql = "select sys_desc from t_sys a,t_equipment b where a.sys_id=b.sys_id and b.equi_id=" & eid
	f2 = DLookup(conn,sql)

	f2 = "系统: "  & f2

'	sql = "select sys_desp from t_sys a,t_equipment b where a.sys_id=b.sys_id and equi_id=" & eid
	f3 = "设备代码:" & eid & " "

	f1 = wdas(f1," width=100 ")
	f2 = wdas(f2," width=100 ")
	f3 = wdas(f3," width=400 align=right ")
	
	
	TitleTable = TitleTable & wtbas(wra(f1&f2&f3),"border=0 align=center ")

	
	
End Function
Function EqTable(eid)
	dim up : up = 6
	dim en,ev
	dim en1(6),ev1(6)
	dim i,j
	dim sql,rs
	dim s1,s2,s3

	up=6

	en = Array("设备名称","型号规格","机房","设备编号","控制对象","安装位置")
	ev = Array("name","model","room_no","number","control","site")

	sql = "select * from t_equipment where equi_id= "& eid
	set rs = openrs(conn,sql)

	If not rs.eof Then
		for i = 1 to up
			en1(i-1) = en(i-1)
			ev1(i-1) = getvalue(rs,ev(i-1))
			if(IsEmpty(ev1(i-1))) Then
				ev1(i-1)="&nbsp;"
			End If
		Next
	Else
		werr("系统中不存在该设备!")
	End If
	closers(rs)
	for i = 1 to up
		en1(i-1)=wdas(en1(i-1)," class=tdHead width=100 ")
		if(ev1(i-1) = "" ) tHEN
			ev1(i-1) = "&nbsp;"
		End if
		ev1(i-1)=wdas(ev1(i-1)," align=center width=100 ")
	Next
	
	s3 = ""
	For i = 1 to 4 step 3
		s2=""
		For each j in Array(i,i+1,i+2)
			
			s1 = en1(j-1) & ev1(j-1)
			s2 = s2 & s1
		Next

		s3 = s3 & wra(s2)
	
	Next
	
	s3 = wras(wdas("基本信息列表"," width=600 colspan=6 class=tdHead")," align=center ") & s3

	EqTable = "<center>" & wtbas(s3," width=600 cellspacing=0 cellpadding=3 width=600 border=1 align=center style=""table-layout:fixed"" bgcolor=""white"" border=1 ")
	
End Function
	
'************************************************************************************************
' 函数名 : TableHeader()
' 输 入 : 
' 输 出 : 一个用于显示角色列表的表头
' 功能描述: 
' 调用模块: list_role.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-08-01
' 版 本 : 
'		wras(TableTitle("技术参数列表", 600, "", "#0040a0")," colspan=5 ") & _

'************************************************************************************************
Function TableHeader()
	TableHeader = _
		"<table cellspacing=0 cellpadding=3 width=600 align=center style=""table-layout:fixed"" bgcolor=""white"" border=1>" & _
		"<tr align=center  >" & _
		"<td colspan=6 class=tdHead width=600 align=center>技术参数列表</td>" & _
		"</tr>" & _
		"<tr align=center >" & _
		"<td class=tdHead width=100 align=center>参数名</td>" & _
		"<td  width=100 align=center>参数值</td>" & _
		"<td class=tdHead width=100 align=center>参数名</td>" & _
		"<td  width=100 align=center>参数值</td>" & _
		"<td class=tdHead width=100 align=center>参数名</td>" & _
		"<td  width=100 align=center>参数值</td>" & _
		"</tr>"
End Function

Function FormHead()
	dim s : s=""
	s = s &	"<form method=post name=frmMgr action=""evar.asp"">" & vbLF 
	s = s & "<input type=""hidden"" name=""FormAction"">" & vbLF
	s = s &	"<input type=""hidden"" name=""eid"" value=""" & gEid & """>" & vbLF
	FormHead = s

End Function


Function ToolTable()
	dim sActionLinks
	sActionLinks = _
			"<tr bgcolor=white height=30 > "& vbLF & _
			wdas("仲量联行上海信息大楼物业管理中心<br>"," colspan=6 align=right ") & wre &_
			"<tr bgcolor=white height=30>" & vbLF & _
			"	<td colspan=6 align=center>" & vbLF & _
		"		<img border=0 src=""../images/button/preview.gif"" class=""noprint"" style=""cursor:hand"" OnClick=""JavaScript:doPrintPreview();"" name=btnPreview>" & _
		"		<img border=0 src=""../images/button/return.gif"" class=""noprint"" style=""cursor:hand"" onclick=""javascript:window.close();"">"  & _
			"	</td>" & vbLF & _
			"</tr>" & vbLF
	ToolTable = "<center>" & wtbas(sActionLinks,"  width=600 ")

End Function

Sub UpdateVar(eid)
	dim en(14),ev(14)
	dim en1(14),ev1(14)
	dim sql
	dim rs
	dim s1,s2,s3
	dim i,j

	for i = 1 to 15
		en(i-1) = "sd" & i & "n"
		ev(i-1) = "sd" & i
	Next

	for i = 1 to 15
		en1(i-1) = en(i-1) & "=" & ToSQL(GetParam(en(i-1)),"Text")
		ev1(i-1) = ev(i-1) & "=" & ToSQL(GetParam(ev(i-1)),"Text")
	Next

	sql = "update t_equipment set " & Join(en1,",") & "," & Join(ev1,",") & " where equi_id=" & eid

	conn.Execute(sql)

End Sub

Function ListTableHeader()
	 dim s
	 dim s1
	 dim i
	 s =  		"<table cellspacing=0 cellpadding=3 width=600 align=center style=""table-layout:fixed"" bgcolor=""white"" border=1>" & vbLF & _
		"<tr style=""display:none"">" & vbLF & _
		"	<td width=160>这一行仅用于控制表格宽度</td>" & vbLF & _
		"	<td width=182></td>" & vbLF & _
		"	<td width=120></td>" & vbLF & _
		"	<td width=65></td>" & vbLF & _
		"	<td width='*'></td>" & vbLF & _
		"<tr><td colspan=5 class=tdHead width=600 align=center >设 备 附 件 列 表</td></tr>" & vbLF & _
		"<tr >" &  vbLF 
	
'	s1 = "	<td class=tdHead>&nbsp;<img src=""../images/bg/ar-y.gif"" width=8 height=8>&nbsp;" & _
'					TableHeaderField(sFileName, arrayFields(0), nf(0), sFormParams, sSorting, sSorted) & "</td>" & vbLF 


	for i = lb to ub
		s1 = s1 & "	<td class=tdHead align=center>" & nf(i) & "</td>" & vbLF 
	next

'	s1 = wdas("删除|更新"," class=tdHead ")

	s= s & s1 & "</tr>" & vbLF

	ListTableHeader = s

End Function

Function ListTableTailer()
	ListTableTailer = "</table>" & vbLF
End Function

Function ListTableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp	: sTemp = ""	' 临时字符串变量
	dim j,i				' 临时循环变量
	dim ne		: ne = nf
	dim s1,s2
	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
'	response.write sSQL
'	response.end
	dim rs	: set rs = Openrs(conn,sSQL)
	dim iEquiId, iSysId, iParentEquiId, sName, sNumber, sModel, sTypeDesc, sRoomno

	dim sty	: sty = ""
	dim a,t
	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
'	if Not rs.EOF then	
'		rs.Move (iCurrentPage - 1) * iRecordsPerPage
'	end if
'	while not rs.EOF and iCounter <= iRecordsPerPage
	while not rs.EOF
		for i = lb to ub
			ne(i)			= GetValue(rs, arrayFields(i))
		Next
		
		'baoyangshang
		if cint(ne(4)) = 0 Then
			ne(4)="未知"
		Else
			ne(4) = DLookup(conn,"select name from t_firm where id=" & ne(4))
		End IF

		a = GetValue(rs,"id")
		
'		If cint(a) = cint(gAid) Then
'			sty = "color:red"
''			t   = ModifyTable
'		Else
'			sty= "color:blue"
'			t=""
'		End If
		
		s1 = "<tr >" & vbLF
'		s1 = s1 & "	<td title=""" & ne(0) & """ style=""cursor:hand"" onclick=""javascript:location.href='eaccessory.asp?eid="&gEid & "&aid="&a&"';"">&nbsp;<img src=""../images/bg/ar-g.gif"" width=8 height=8>&nbsp;" & Bref(ne(0),16) & "&nbsp;</td>" & vbLF
		for i = lb to ub
			s1 = s1 & "	<td align=center>" & ne(i) & "</td>" & vbLF
		next
		sTemp = sTemp & s1 & "</tr>" & vbLF 
		iCounter = iCounter + 1
		rs.movenext
	wend

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

	' 首页、前页、后页、尾页等分页信息
'	sTemp = sTemp & "<tr bgcolor=white><td colspan=" & iCols & " align=right>" & vbLF & _
'				Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & vbLF & _
'				"&nbsp;</td></tr>" & vbLF

	ListTableRecords = sTemp
End Function

%>

⌨️ 快捷键说明

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