📄 book_in2.inc
字号:
<%
Sub Maintain(id)
'-------------------------------------------------------
'Declares
'-------------------------------------------------------
Dim sAction, sSQL, sError
dim sAuthor,sPublisher,sPrice,sTitle,sPur_time,sDisc,sDis,sStatus,sKeeper,sBorrow_time,sReturn_time,sMemo,sStatus_id,sCategory_id,sKeeper_id
'-------------------------------------------------------
'Get parameters
'--------------------------------------------------------
sAction = GetParam("formAction")
sAction = LCase(sAction)
'---------------------------------------------------------
' Operate according to sAction
'---------------------------------------------------------
select case sAction
case "addtype"
'------------------------------
' add
'------------------------------
sAuthor = GetParam("author")
sPublisher = GetParam("publisher")
sPrice = GetParam("price")
sTitle = GetParam("title")
sPur_time = GetParam("pur_time")
sDisc = GetParam("disc")
sDis = GetParam("dis")
sStatus = GetParam("status")
sKeeper = GetParam("keeper")
sBorrow_time = GetParam("borrow_time")
sReturn_time = GetParam("return_time")
sMemo = GetParam("memo")
'sCategory_id = DLookUp(dbLocal, "t_library_books_category", "category_id", "title = " & ToSQL(sTitle, "Text"))
'sStatus_id = DLookUp(dbLocal, "t_library_books_status", "status_id", "status = " & ToSQL(sStatus, "Text"))
'sKeeper_id = DLookUp(dbLocal, "t_employee", "emp_id", "name = " & ToSQL(sKeeper, "Text"))
sSQL = "update t_library set author=" & ToSQL(sAuthor,"Text") & "," & _
" publisher=" & ToSQL(sPublisher,"Text") & "," & _
" price="& ToSQL(sPrice,"Text") & "," & _
" category_id=" & ToSQL(sTitle,"Number") & "," & _
" status_id="&ToSQL(sStatus,"Number") & "," & _
" disc=" & ToSQL(sDisc,"Text") & "," & _
" keeper=" & ToSQL(sKeeper,"Text") & "," & _
" memo=" & ToSQL(sMemo,"Text") & "," & _
" pur_time=" & ToSQL(sPur_time,"Text") & "," & _
" borrow_time=" & ToSQL(sBorrow_time,"Text") & "," & _
" return_time=" & ToSQL(sReturn_time,"Text") & "," & _
" where no=" & ToSQL(id, "Number")
case "deltype"
'-------------------------------
' del --- delete
'-------------------------------
sSQL = "delete from t_library where no =" & ToSQL(id, "Number")
end select
sError = ExecuteSQL(dbLocal, sSQL)
'-----------------------------------------
' error handling
'-----------------------------------------
if sError <> "" then
Response.Write "<script language=""javascript"">alert('对不起,操作中发生错误,请查阅帮助文件!')</script>"
end if
End Sub
'***************************************************************************************************
'***************************************************************************************************
' Name : TableAdd
' Function : Form Table to Implement Insert, Modify, Delete According to the Post Action
' In : No
' Out : No
' Return : Table Add, Modify, Delete
' Comment : No
'
'---------------------------------------------------------------------------------------------------
Function TableAdd()
'---------------------------------------------------
' declares
'---------------------------------------------------
Dim sFormName, sTemp
dim sAuthor,sPublisher,sPrice,sTitle,sPur_time,sDisc,sDis,sStatus,sKeeper,sBorrow_time,sReturn_time,sMemo
sTemp = "<table width=600 cellspacing=0 cellpadding=0 border=0><tr><td width=600 align=center>"
sPublisher = ""
sPrice = ""
sDis = ""
sAuthor = ""
sMemo = ""
sPur_time = date
sBorrow_time = date
sReturn_time = date
sTemp = sTemp & _
"<span id=btnAdd style=""cursor:hand"" title=""新增按钮""><img border=0 src=""../images/button/add.gif"" style=""vertical-align:bottom""></span>" & _
" " & _
"<span id=btnDel style=""cursor:hand"" title=""取消按钮""><img border=0 src=""../images/button/cancel.gif"" style=""vertical-align:bottom""></span>" & _
" " & _
"<span id=btnClear style=""cursor:hand"" title=""清空按钮""><img border=0 src=""../images/button/clear.gif"" style=""vertical-align:bottom""></span>"
sTemp = sTemp & "</td></tr></table>"
'----------------------------------------------------
' draw add table and return
'----------------------------------------------------
TableAdd = _
TableTitle("详细信息", 600, "", "") & _
"<table cellspacing=0 cellpadding=0 width=600 align=center border=0>" & _
"<form name=frmInfoMgr method=post action=""book_in2.asp"">" & _
"<tr height=10><td colspan=4> </td></tr>"&_
"<tr height=30>" & _
" <td width=115 align=right>作 者:</td>"&_
" <td width=200><input type=""text"" name=""author"" value=""" & sAuthor & """ size=30 maxlength=50></td>"& _
" <td width=80 align=right>类 别:</td>" & _
" <td width=205><select name=""title"" style=""width:86px"">"& _
SelectOptions(dbLocal,"t_Library_books_category","category_id","title",sTitle,"") & _
" </select></td></tr>" & _
"<tr height=30>" & _
" <td width=115 align=right>出版社:</td>"&_
" <td width=200><input type=""text"" name=""publisher"" value=""" & sPublisher & """ size=30 maxlength=50></td>"& _
" <td width=80 align=right>有无磁盘:</td>" & _
" <td width=205><select name=""disc"" style=""width:86px"">" & _
" <option value=1>有</option>" & vbLF & _
" <option value=2>无</option>" & vbLF & _
" </select></td></tr>" & _
"<tr height=30>" & _
" <td width=115 align=right>价 格:</td>"&_
" <td width=195><input type=""text"" name=""price"" value=""" &sPrice & """ size=30 maxlength=50></td>"& _
" <td width=80 align=right>购买日期</td>" & _
" <td width=210 align=left>"& DrawCal("", sPur_time, "pur_time", "dateimg3") & "" & _
" </td></tr>" & _
"<tr height = 1><td colspan=2> </td></tr>"&_
"<tr>" & _
" <td width=115 align=right>描述:</td>" & _
" <td width=485 colspan=4><textarea name=""dis"" cols=""64"" rows=""5"" value=""" &sDis & """></textarea></td>"&_
"</tr>" & _
"<tr height = 1><td colspan=2> </td></tr>"&_
"<tr height=30>" & _
" <td width=115 align=right>状态:</td>" & _
" <td width=200><select name=""status"" style=""width:86px"">"&_
SelectOptions(dbLocal,"t_Library_books_status","status_id","status",sStatus,"") & _
" </select></td>" & _
" <td width=80 align=right>借阅人:</td>" & _
" <td width=205><select name=""keeper"" style=""width:86px"">"&_
SelectOptions(dbLocal,"t_employee","emp_id","name",sKeeper,"") & _
" </select></td></tr>" & _
"<tr height=30>" & _
" <td width=105 align=right>借阅日期</td>" & _
" <td width=210>"& DrawCal("", sBorrow_time, "borrow_time", "dateimg2") & "</td>" & _
" <td width=80 align=right>归还日期</td>" & _
" <td width=205>"& DrawCal("", sReturn_time, "return_time", "dateimg1") & "</td>" & _
" </tr>" & _
"<tr height = 1><td colspan=2> </td></tr>"&_
"<tr height=30>" & _
" <td width=115 align=right>备注:</td>" & _
" <td width=485 colspan=4><textarea name=""memo"" cols=""64"" rows=""5"" value=""" &sMemo & """>" & _
" </textarea></td>" & _
" <input type=hidden name=formAction>" & _
" </tr>" & _
"<tr height=10><td colspan=4> </td></tr>"&_
"<tr height=30 align=center>" & _
sTemp & _
"</tr>" & _
"<tr height=10><td colspan=4> </td></tr>" & _
"</form>" & _
"</table>"
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -