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

📄 bookedit.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 sUserName, sBorrowDate, sReturnDate, sRealDate
	dim sType, sDisc, sLink
	dim ActionStatus

	if not IsLibraryAdmin() then
		Server.Transfer("../common/error.asp")
		Response.end
	end if 

	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")

		sType = DLookUp(dbLocal, "T_Library_Type", "Title", "ID=" & iTypeID)
		sDisc = DLookUp(dbLocal, "T_Library_Disc", "Disc", "ID=" & iDisc)
		
		crs.Close()
	end if
	
	if IsEmpty(iBookID) then
		sLink = _
			"<tr bgcolor=white height=20>" & _
			"	<td colspan=8 align=center>" & _
			"		<img border=0 src=""../images/button/add.gif"" onclick=""btnAdd_OnClick()"" style=""cursor:hand"">&nbsp;&nbsp;&nbsp;&nbsp;" & _
			"		<img border=0 src=""../images/button/cancel.gif"" onclick=""btnCancelAdd_OnClick()"" style=""cursor:hand""></td>" & _
			"</tr>"
	else
		sLink = _
			"<tr bgcolor=white height=20>" & _
			"	<input type=""hidden"" name=""id"" value=""" & iBookID & """>" & _
			"	<td colspan=8 align=center>" & _
			"		<img border=0 src=""../images/button/update.gif"" onclick=""btnUpdate_OnClick()"" style=""cursor:hand"">&nbsp;&nbsp;&nbsp;&nbsp;" & _
			"		<img border=0 src=""../images/button/cancel.gif"" onclick=""btnCancel_OnClick()"" style=""cursor:hand""></td>" & _
			"</tr>"
	end if

	BookDetail = _
		"<table cellspacing=1 cellpadding=0 width=600 border=0 align=center bgcolor=silver>" & _
		"<form method=""post"" name=""frmAdd"" action=""bookedit.asp"">" & _
		"<input type=""hidden"" name=""FormAction"">" & _
		"<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><input type=""text"" name=""name"" value=""" & sName & """ size=50 maxlength=50></td>" & _
		"		<td width=75 align=center>类  别:</td><td width=75><select name=""type"" style=""width:86"">" & _ 
					SelectOptions(dbLocal, "t_library_type", "id", "title", iTypeID, "")  & _
					"</select></td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=75 align=center>作  者:</td><td colspan=7><input type=""text"" name=""author"" value=""" & sAuthor & """ size=50 maxlength=50></td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=75 align=center>I S B N:</td><td colspan=7><input type=""text"" name=""isbn"" value=""" & sISBN & """ size=50 maxlength=50></td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=75 align=center>出 版 社:</td><td colspan=7><input type=""text"" name=""publisher"" value=""" & sPublisher & """ size=50 maxlength=50></td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=30>" & _
		"		<td width=75 align=center>价  格:</td><td width=75><input type=""text"" name=""price"" value=""" & sPrice & """ size=10 maxlength=10></td>" & _
		"		<td width=60 align=center>购买时间:</td><td width=90 nowrap>" & DrawCal2(sBuyDate, "buydate", "dateimg11") & "</td>" & _	
		"		<td width=75 align=center>有无磁盘:</td><td width=75><select name=""disc"" style=""width:60"">" & _
					SelectOptions(dbLocal, "t_library_disc", "id", "disc", iDisc, "") & _
		"			</select></td>" & _
		"		<td width=75 align=center>状  态:</td><td width=75>&nbsp;" & sStatus & "</td>" & _
		"</tr>" & _
		"<tr bgcolor=white height=60>" & _
		"		<td align=center>备注信息:</td><td colspan=7><textarea name=""memo"" rows=5 cols=87>" & sMemo & "</textarea></td>" & _
		"</tr>" & _
				sLink  & _
		"</td></tr></form></table>" & _
		"<br>"
	
End Function

Function AddBook()
	dim strSQL', iTypeID, iDisc

	dim sName				: sName				= GetParam("name")
	dim sISBN				: sISBN				= GetParam("isbn")
	dim sPrice				: sPrice			= GetParam("price")
	dim sBuyDate			: sBuyDate			= GetParam("buydate")
	dim iTypeID				: iTypeID			= GetParam("type")
	dim sAuthor				: sAuthor			= GetParam("author")
	dim sPublisher			: sPublisher		= GetParam("publisher")
	dim iDisc				: iDisc				= GetParam("disc")
	dim sMemo				: sMemo				= GetParam("memo")
	dim sStatus				: sStatus			= "入库"

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

	strSQL = "insert into T_Library(Name, ISBN, Price, BuyDate, TypeID, Author, Publisher, Disc, Memo, Status)" & _
			" values(" & ToSQL(sName, "Text") & ", " & ToSQL(sISBN, "Text") & ", " & ToSQL(sPrice,"Number") & ", " & ToSQL(sBuyDate,"Text") & ", " & _
			iTypeID & ", " & ToSQL(sAuthor, "Text") & ", " & ToSQL(sPublisher, "Text") & ", " & iDisc & ", " & _
			ToSQL(sMemo, "Text") & ", " & ToSQL(sStatus, "Text") & ")" 

	call ExecuteSQL(dbLocal, strSQL)
	
	iBookID = DLookUp(dbLocal, "T_Library", "max(ID)", "")

	Response.Redirect "bookinfo.asp?id=" & iBookID & "&"
	Response.end
End Function

Function UpdateBook()
	dim strSQL', iTypeID, iDisc
	dim sName				: sName				= GetParam("name")
	dim sISBN				: sISBN				= GetParam("isbn")
	dim sPrice				: sPrice			= GetParam("price")
	dim sBuyDate			: sBuyDate			= GetParam("buydate")
	dim iTypeID				: iTypeID			= GetParam("type")
	dim sAuthor				: sAuthor			= GetParam("author")
	dim sPublisher			: sPublisher		= GetParam("publisher")
	dim iDisc				: iDisc				= GetParam("disc")
	dim sMemo				: sMemo				= GetParam("memo")

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

	strSQL = "update T_Library" & _
				" set Name = " & ToSQL(sName, "Text") & _
				", ISBN = " & ToSQL(sISBN, "Text") & _
				", Price = " & ToSQL(sPrice,"Number") & _
				", BuyDate = " & ToSQL(sBuyDate,"Text") & _
				", TypeID = " & iTypeID & _
				", Author = " & ToSQL(sAuthor, "Text") & _
				", Publisher = " & ToSQL(sPublisher, "Text") & _
				", Disc = " & iDisc & _
				", Memo = " & ToSQL(sMemo, "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=9 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 + -