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

📄 cardlist.inc

📁 物业管理和办公自动化系统
💻 INC
📖 第 1 页 / 共 2 页
字号:
		"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & _
		"<tr height=10>" & _ 
		"	<td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
		"</tr>" & _
		"<tr height=20>" & _
		"	<td width=600>&nbsp;"


	if IsOfficer() then
		if not IsEmpty(sPart) then TableLink = TableLink & _
			"	<img src=""../images/goto.gif"">&nbsp;<a href=""cardlist.asp"">我的卡片</a>&nbsp;&nbsp;&nbsp;"

		if sPart <> "forpass" then TableLink = TableLink & _
			"	<img src=""../images/goto.gif"">&nbsp;<a href=""cardlist.asp?part=forpass&"">等待审批的卡片</a>&nbsp;&nbsp;&nbsp;" 

		if sPart <> "passed" then TableLink = TableLink & _
			"	<img src=""../images/goto.gif"">&nbsp;<a href=""cardlist.asp?part=passed&"">已发放的卡片</a>&nbsp;&nbsp;&nbsp;"
	end if

	TableLink = TableLink & _
		"	</td>" & _
		"</tr>" & _
		"</table>"
End Function


Function TableHeader()
	TableHeader = _
		"<table cellspacing=0 cellpadding=0 width=600 align=center class=tablelist>" & _
		"	<tr>" & _
		"		<td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"" height=20 >" & sHeader & "</td>" & _
		"	</tr>" & _
		"	<tr>" & _
		"		<td class=tdHead width=100>&nbsp;<img src=""../images/bg/ar-y.gif"" width=8 height=8>&nbsp;" & TableHeaderField(sFileName, "Serial", "卡片编号", sFormParams, iSort, iSorted) & "</td>" & _
		"		<td class=tdHead width=180>&nbsp;" & TableHeaderField(sFileName, "Name", "资产名称", sFormParams, iSort, iSorted) & 	"</td>" & _
		"		<td class=tdHead width=80>&nbsp;" & TableHeaderField(sFileName, "Department", "使用部门", sFormParams, iSort, iSorted) & "</td>" & _
		"		<td class=tdHead width=80>&nbsp;" & TableHeaderField(sFileName, "UserName", "使用人", sFormParams, iSort, iSorted) & "</td>" & _
		"		<td class=tdHead width=80>&nbsp;" & TableHeaderField(sFileName, "ApplyDate", "建卡日期", sFormParams, iSort, iSorted) & "</td>" & _
		"		<td class=tdHead width=80>&nbsp;" & TableHeaderField(sFileName, "Status", "状态", sFormParams, iSort, iSorted) & "</td>" & _
		"	</tr>"
End Function
					
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp				: sTemp = ""	' 临时字符串变量
	dim j					' 临时循环变量

	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter			: iCounter = 1
	Dim iPrevPage, iNextPage
	
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
	dim crs					: set crs = New CRecordset
	dim rs					: set rs = crs.open(dbLocal,sSQL)
	dim ID, sSerial, sName, sType, sUnit, sDepartment, sUserName, sApplyDate, sStatus

	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
	if Not rs.EOF then	
		rs.Move (iCurrentPage - 1) * iRecordsPerPage
	end if
	while not rs.EOF and iCounter <= iRecordsPerPage
		ID					= crs.GetValue("ID")
		sSerial				= crs.GetValue("Serial")
		sName				= crs.GetValue("Name")
		sDepartment			= crs.GetValue("Department")
		sUserName			= crs.GetValue("UserName")
		sApplyDate			= crs.GetValue("ApplyDate")
		sStatus				= crs.GetValue("Status")

		sTemp = sTemp & _
			"<tr bgcolor=white>" & _
			"	<td class=tdlist title=""" & sSerial & """ style=""cursor:hand"" onclick=""javascript:location.href='cardlist.asp?" & sFormParams & "part=" & sPart & "&action=edit&id=" & ID & "';"">&nbsp;<img src=""../images/bg/ar-g.gif"" width=8 height=8>&nbsp;" & Bref(sSerial,10) & "&nbsp;</td>" & _
			"	<td class=tdlist title=""" & sName & """ align=left>&nbsp;" & Bref(sName,20) & "&nbsp;</td>" & _
			"	<td class=tdlist title=""" & sDepartment & """ align=left>&nbsp;" & Bref(sDepartment, 10) & "&nbsp;</td>" & _
			"	<td class=tdlist title=""" & sUserName & """ align=left>&nbsp;" & Bref(sUserName, 8) & "&nbsp;</td>" & _
			"	<td class=tdlist title=""" & sApplyDate & """ align=left>&nbsp;" & sApplyDate & "&nbsp;</td>" & _
			"	<td class=tdlist title=""" & sStatus & """ align=left>&nbsp;" & Bref(sStatus, 8) & "&nbsp;</td>" & _
				"</tr>"

		iCounter = iCounter + 1
		rs.movenext
	wend
	crs.Close()

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

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

end Function

' ====================================================================================
'  实现数据库操作的功能函数
'			AddCard()
'			UpdateCard()
'			DeleteCard()
'			PassCard()
'			BackCard()
' ====================================================================================
Function AddCard()
	dim strSQL
	dim sSerial				: sSerial			= GetParam("serial")
	dim sName				: sName				= GetParam("name")
	dim sType				: sType				= GetParam("type")
	dim sUnit				: sUnit				= GetParam("unit")
	dim sAmount				: sAmount			= GetParam("amount")
	dim sDepartment			: sDepartment		= GetParam("department")
	dim sUserName			: sUserName			= GetParam("username")
	dim sApplyDate			: sApplyDate		= date
	dim sStatus				: sStatus			= "等待审批"


	strSQL = "insert into T_Expendable(Serial, Name, Type, Unit, Amount, Department, UserName" & _
			", ApplyDate, Signer, Status)" & _
			" values(" & ToSQL(sSerial, "Text") & ", " & ToSQL(sName, "Text") & ", " & ToSQL(sType, "Text") & _
			", " & ToSQL(sUnit, "Text") & ", " & ToSQL(sAmount, "Text") & ", " & ToSQL(sDepartment, "Text") & _
			", " & ToSQL(sUserName, "Text") & ", " & ToSQL(sApplyDate,"Text") & ", " & ToSQL(sEmpName, "Text") & _
			", " & ToSQL(sStatus, "Text") & ")"

	call ExecuteSQL(dbLocal, strSQL)

	iCardID = DLookUp(dbLocal, "T_Expendable", "max(ID)", "Signer=" & ToSQL(sEmpName, "Text"))
	
	call CommonSendMsg(MSG_APPROVE,"","请审批:低值易耗品","请审批低值易耗品卡片!",iEmpSerial,GetOfficer())

	Response.Redirect "cardlist.asp?id=" & iCardID & "&"
	Response.end
End Function

Function UpdateCard()
	dim sSQL
	dim sSerial				: sSerial			= GetParam("serial")
	dim sName				: sName				= GetParam("name")
	dim sType				: sType				= GetParam("type")
	dim sUnit				: sUnit				= GetParam("unit")
	dim sAmount				: sAmount			= GetParam("amount")
	dim sDepartment			: sDepartment		= GetParam("department")
	dim sUserName			: sUserName			= GetParam("username")

	sSQL = "update T_Expendable" & _
				" set Serial = " & ToSQL(sSerial, "Text") & _
				", Name = " & ToSQL(sName, "Text") & _
				", Type = " & ToSQL(sType, "Text") & _
				", Unit = " & ToSQL(sUnit, "Text") & _
				", Amount = " & ToSQL(sAmount, "Number") & _
				", Department = " & ToSQL(sDepartment, "Text") & _
				", UserName = " & ToSQL(sUserName, "Text") & _
				", Status = '等待审批'" & _ 
				" where ID = " & ToSQL(iCardID, "Number")
	call ExecuteSQL(dbLocal, sSQL)
	
	call CommonSendMsg(MSG_APPROVE,"","请审批:低值易耗品","请审批低值易耗品卡片!",iEmpSerial,GetOfficer())

	Response.Redirect "cardlist.asp?id=" & iCardID & "&"
	Response.end
End Function

Function DeleteCard()
	dim strSQL

	strSQL = "delete from T_Expendable where ID = " & ToSQL(iCardID, "Number")
	call ExecuteSQL(dbLocal, strSQL)
	
	Response.Redirect "cardlist.asp"
	Response.end
End Function

Function PassCard()
	dim strSQL, sSigner, iSigner
	
	strSQL = "update T_Expendable set Status = '已经发放' where ID = " & ToSQL(iCardID, "Number")
	call ExecuteSQL(dbLocal, strSQL)

	sSigner = DLookUp(dbLocal, "T_Expendable", "Signer", "ID=" & iCardID)
	iSigner = DLookUp(dbLocal, "T_Employee", "Serial", "Name='" & sSigner & "'")

	call CommonSendMsg(MSG_APPROVE,"","审批通过并发放:低值易耗品","你提交的低值易耗品卡片已获批准并发放!",GetOfficer(),iSigner)
	Response.Redirect "cardlist.asp"
	Response.end
End Function

Function BackCard()
	dim strSQL, sSigner, iSigner
	
	strSQL = "update T_Expendable set Status = '不通过!' where ID = " & ToSQL(iCardID, "Number")
	call ExecuteSQL(dbLocal, strSQL)
	
	sSigner = DLookUp(dbLocal, "T_Expendable", "Signer", "ID=" & iCardID)
	iSigner = DLookUp(dbLocal, "T_Employee", "Serial", "Name='" & sSigner & "'")

	call CommonSendMsg(MSG_APPROVE,"","审批未通过:低值易耗品","对不起,你提交的低值易耗品卡片未获批准!",GetOfficer(),iSigner)
	Response.Redirect "cardlist.asp"
	Response.end
End Function
%>

⌨️ 快捷键说明

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