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

📄 bookinfo.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%
'#############################################################################################
'#
'#	文件名	 : bookinfo.inc
'#	Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'#	创建人	 : BinZha
'#  日 期	 : 2002-07-19
'#
'#	修改历史  : ****年**月**日 ****** 修改内容:**********************************************
'#
'#	功能描述	 : 察看图书信息函数文件
'#  版   本	 :
'#
'#############################################################################################

Function BookDetail(sSQL)
	dim crs, rs
	dim sName, sISBN, sPrice, sBuyDate, iTypeID, sAuthor, sPublisher, iDisc, sMemo, sStatus
	dim iUserName, sBorrowDate, sReturnDate, sRealDate
	dim sType, sDisc, sLink, sUserName
	dim ActionStatus

	if not IsEmpty(iBookID) then
	
		set crs = New CRecordset
		set rs = crs.Open(dbLocal, sSQL)

		if rs.EOF then
			Server.Transfer("../common/error.asp")
			Response.end
		end if

		'' 获取任务信息的各种数据
		sName				= crs.GetValue("Name")
		sISBN				= crs.GetValue("ISBN")
		sPrice				= crs.GetValue("Price")
		sBuyDate			= crs.GetValue("BuyDate")
		iTypeID				= crs.GetValue("TypeID")
		sAuthor				= crs.GetValue("Author")
		sPublisher			= crs.GetValue("Publisher")
		iDisc				= crs.GetValue("Disc")
		sMemo				= crs.GetValue("Memo")
		sStatus				= crs.GetValue("Status")
		iUserName			= crs.GetValue("UserName")
		sBorrowDate			= crs.GetValue("BorrowDate")
		sReturnDate			= crs.GetValue("ReturnDate")
		sRealDate			= crs.GetValue("RealDate")

		
		sType = DLookUp(dbLocal, "T_Library_Type", "Title", "ID=" & iTypeID)
		sDisc = DLookUp(dbLocal, "T_Library_Disc", "Disc", "ID=" & iDisc)
		
		crs.Close()

		'' 如果是图书借出,则显示借阅信息
		if sStatus = "借阅" then
		sUserName = DLookUp(dbLocal, "T_Employee", "Name", "serial=" & iUserName)
			sLink = _
				"<tr bgcolor=white height=30>" & _
				"		<td width=75 align=center>借 阅 人:</td><td colspan=3 class=tdvalue>&nbsp;" & sUserName & "</td>" & _
				"		<td width=75 align=center>借出时间:</td><td width=75 class=tdvalue>&nbsp;" & sBorrowDate & "</td>" & _
				"		<td width=75 align=center>应还时间:</td><td width=75 class=tdvalue>&nbsp;" & sReturnDate & "</td>" & _
				"</tr>" 
		end if
			
		'' 如果是图书管理员,则可以进行借阅管理。
		if IsLibraryAdmin() then 
			sLink = sLink & _
				"<form method=""post"" name=""frmBook"" action=""bookinfo.asp"">" & _
				"<tr bgcolor=white height=30>" & _
				"	<td colspan=8 align=center>" & _
				"		<input type=""hidden"" name=""id"" value=""" & iBookID & """>" & _
				"		<input type=""hidden"" name=""FormAction"">" & _
				"		<span style=""cursor:hand;color:blue"" onclick=""btnEdit_OnClick()""><img border=0 src=""../images/edit.gif"">&nbsp;修改图书信息</span>" & _
				"		&nbsp;&nbsp;" & _
				"		<span style=""cursor:hand;color:blue"" onclick=""btnDelete_OnClick()""><img border=0 src=""../images/trash.gif"">&nbsp;删除图书信息</span>"
			
			if sStatus = "借阅" then
				sLink = sLink & _
					"		&nbsp;&nbsp;" & _
					"		<span style=""cursor:hand;color:blue"" onclick=""btnReturn_OnClick()""><img border=0 src=""../images/task.gif"">&nbsp;还书管理</span>"
			else
				sLink = sLink & _
					"		&nbsp;&nbsp;" & _
					"		<span style=""cursor:hand;color:blue"" onclick=""btnBorrow_OnClick()""><img border=0 src=""../images/task.gif"">&nbsp;借书管理</span>"
			end if

			sLink = sLink & _
				"	</td>" & _
				"</tr></form>" 
		end if

		BookDetail = _
		"<table cellspacing=1 cellpadding=0 width=600 border=0 align=center bgcolor=silver>" & _
		"<tr height=20 style=""color:white;font-weight:600"">" & _
		"		<td background=""../images/bg/bnbg.gif"" align=center colspan=8>图 书 详 细 信 息</td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=75 align=center>书  名:</td><td colspan=5 class=tdvalue>&nbsp;" & sName & "</td>" & _
		"		<td width=75 align=center>类  别:</td><td width=75 class=tdvalue>&nbsp;" & sType & "</td>" & _
		"</tr>" & _
		"<tr bgcolor=#ffffcc height=30>" & _
		"		<td width=75 align=center>作  者:</td><td colspan=7 class=tdvalue>&nbsp;" & sAuthor & "</td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=75 align=center>I S B N:</td><td colspan=7 class=tdvalue>&nbsp;" & sISBN & "</td>" & _
		"</tr>" & _
		"<tr bgcolor=#ffffcc height=30>" & _
		"		<td width=75 align=center>出 版 社:</td><td class=tdvalue colspan=7>&nbsp;" & sPublisher & "</td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=75 align=center>价  格:</td><td width=75 class=tdvalue>&nbsp;" & sPrice & "</td>" & _
		"		<td width=75 align=center>购买时间:</td><td width=75 class=tdvalue>&nbsp;" & sBuyDate & "</td>" & _
		"		<td width=75 align=center>有无磁盘:</td><td width=75 class=tdvalue>&nbsp;" & sDisc & "</td>" & _
		"		<td width=75 align=center>状  态:</td><td width=75 class=tdvalue>&nbsp;" & sStatus & "</td>" & _
		"</tr>" & _
		"<tr bgcolor=#ffffcc height=60>" & _
		"		<td align=center>备注信息:</td><td colspan=7 class=tdvalue>&nbsp;" & sMemo & "</td>" & _
		"</tr>" & _
				sLink  & _
		"</td></tr></table>" & _
		"<br>"
	end if
	
End Function

Function TableLink()
	TableLink = _
		"<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;" & _
		"		<img src=""../images/goto.gif"">&nbsp;<a href=""booklist.asp"">返回图书列表</a>&nbsp;&nbsp;&nbsp;"

	if IsLibraryAdmin() then
		TableLink = TableLink & _
		"		<img src=""../images/goto.gif"">&nbsp;<a href=""booktype.asp"">类别管理</a></td>"
	end if

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

Function FormBorrow

	FormBorrow = _
			TableTitle("借 书 管 理", 600, "", "") & _
			"<table  cellspacing=0 cellpadding=0 bgcolor=white border=0 width=600><tr><td class=tdlist>" & _
			"<table cellspacing=1 cellpadding=0 bgcolor=white border=0 width=600>" & _
			"<form method=post name=frmBorrow action=""bookinfo.asp"">" & _
			"<input type=""hidden"" name=""FormAction"">" & _
			"<input type=""hidden"" name=""id"" value=""" & iBookID & """>" & _
			"<tr height=20><td></td></tr>" & _
			"<tr bgcolor=white height=30>" & _
			"	<td width=200 align=right>借阅人:</td>" & _
			"	<td>&nbsp;<select name=""username"" style=""width:200"">" & _ 
					SelectOptions(dbLocal, "t_employee", "serial", "name", "", "co_id=" & GetCoId & " and isdummy=0 and dismissed=0")  & _
					"</select></td>" & _
			"</tr>" & _
			"<tr bgcolor=white height=30>" & _
			"	<td width=200 align=right>借出时间:</td>" & _
			"	<td>&nbsp;" & DrawCal2(date, "borrowdate", "dateimg11") & "</td>" & _
			"</tr>" & _
			"<tr bgcolor=white height=30>" & _
			"	<td width=200 align=right>应还时间:</td>" & _
			"	<td>&nbsp;" & DrawCal2(date, "returndate", "dateimg12") & "</td>" & _
			"</tr>" & _
			"<tr height=120><td></td></tr>" & _
			"<tr bgcolor=white height=30>" & _
			"	<td colspan=2 align=center><img border=0 src=""../images/button/add.gif"" onclick=""btnOKBorrow_OnClick()"" style=""cursor:hand""></td>" & _
			"</tr>" & _
			"<tr height=15><td></td></tr>" &  _
			"</form>" & _
			"</table>" & _
			"</td></tr></table>"
End Function

'/////////////============================================================================/////////////
Function DeleteBook()
	dim sSQL2
	
	sSQL2 = "delete from T_library where ID = " & iBookID
	call ExecuteSQL(dbLocal, sSQL2)
	
	Response.Redirect "booklist.asp"
	Response.end
End Function

Function BorrowBook()
	dim strSQL
	dim iUserName			: iUserName				= GetParam("username")
	dim sBorrowDate			: sBorrowDate			= GetParam("borrowdate")
	dim sReturnDate			: sReturnDate			= GetParam("returndate")
	dim sStatus				: sStatus				= "借阅"

	strSQL = "update T_Library" & _
				" set UserName = " & iUserName & _
				", BorrowDate = " & ToSQL(sBorrowDate,"Text") & _
				", ReturnDate = " & ToSQL(sReturnDate, "Text") & _
				", RealDate = " & ToSQL(sReturnDate, "Text") & _
				", Status = " & ToSQL(sStatus, "Text") & _
				" where ID = " & iBookID
	call ExecuteSQL(dbLocal, strSQL)
	
	Response.Redirect "bookinfo.asp?id=" & iBookID 
	Response.end
End Function

Function ReturnBook()
	dim strSQL
	dim sUserName			: sUserName				= ""
	dim sBorrowDate			: sBorrowDate			= ""
	dim sReturnDate			: sReturnDate			= ""
	dim sStatus				: sStatus				= "入库"

	strSQL = "update T_Library" & _
				" set UserName = " & ToSQL(sUserName, "Text") & _
				", BorrowDate = " & ToSQL(sBorrowDate,"Text") & _
				", ReturnDate = " & ToSQL(sReturnDate, "Text") & _
				", RealDate = " & ToSQL(sReturnDate, "Text") & _
				", Status = " & ToSQL(sStatus, "Text") & _
				" where ID = " & iBookID
	call ExecuteSQL(dbLocal, strSQL)
	
	Response.Redirect "bookinfo.asp?id=" & iBookID 
	Response.end
End Function

'************************************************************************************************
' 函数名 : DrawCal2
' 输 入 : sInputDesp	: 日期输入框左边的描述
'		d			: 日期输入框显示的日期
'		sInputId		: 日期输入框的名称,即 input 的 name
'		sImgId		: 日历图标的名称
' 输 出 : 字符串
' 功能描述: 画日期输入框,单击日历图标或双击输入框可以弹出日历以便选择日期
' 调用模块: 
' 作 者 : 周秋舫
' 日 期 : 2002-05-29
' 版 本 : 
'************************************************************************************************
Function DrawCal2(d, sInputId, sImgId)
	DrawCal2 = "<input maxlength=12 name=" & sInputId & " size=31 readonly value=""" & d & """" & _ 				
			" ondblclick=""javascript:document.all.href" &sImgId&".click();""" & _
			" title=""双击输入框或点击旁边的日历图标可以弹出日历"">" & _
		"<A id=href" & sImgId & _
			" href=""javascript:ShowCalendar(document.all." & sImgId & ",document.all." & sInputId & ",null)""" & _
			" onclick=""javascript:event.cancelBubble=true;""" & _
			" title=""点击图标可以选择购买时间"">" & _
		"<IMG border=0 id=" & sImgId & _
			" src=""../common/cal/calendar.gif""" & _
			" style=""position:relative;vertical-align:middle""></A>"
End Function
%>

⌨️ 快捷键说明

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