📄 diarydetail.inc
字号:
<%
'************************************************************************************************
' 函数名 : FormUpdateDiary()
' 输 入 :
' 输 出 : 一个用于新添或者更新日志的表单
' 功能描述: 根据fromaction参数的值,给出相应的表单
' 调用模块: diarydetail.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-06-06
' 版 本 :
'************************************************************************************************
Function FormUpdateDiary()
'-----------------------------------------------------------------
' 新添或者更新日志所采用的表单,根据formAction的值来判断是哪种类型的表单
' 如果是updtype,则显示日志内容,给用户提供维护(修改删除)的界面
' 如果是其它值,如addtype,deltype,则显示空的表单,给用户提供新添日志的界面
'-----------------------------------------------------------------
dim sTemp, sFormAction, sTempButtons, sSubject, sContent, sRecord_time, sEmp_Serial, iSerial
dim crs, rs, sSQL
sFormAction = GetParam("formaction")
iSerial = GetParam("serial")
if sFormAction = "updtype" then
sSQL = "select * from T_Diary where serial = "& iSerial
set crs = New CRecordset
set rs = crs.open(dbLocal,sSQL)
sSubject = crs.GetValue("subject")
sContent = crs.GetValue("content")
sRecord_Time = crs.GetValue("record_time")
sEmp_Serial = crs.GetValue("emp_serial")
crs.Close()
sTemp = TableTitle("日志维护", 600, "#FFFFFF", "#0040a0")
sTempButtons = _
" <img border=0 src=""../images/button/update.gif"" style=""cursor:hand"" name=btnUpdate>" & _
" " & _
" <img border=0 src=""../images/button/reset.gif"" style=""cursor:hand"" name=btnReset>" & _
" " & _
" <img border=0 src=""../images/button/delete.gif"" style=""cursor:hand"" name=btnDelete>" & _
" " & _
" <img border=0 src=""../images/button/cancel.gif"" style=""cursor:hand"" name=btnCancel>"
else
sSubject = ""
sContent = ""
sRecord_time = date
sEmp_Serial = iEmpSerial
sTemp = TableTitle("新添日志", 600, "#FFFFFF", "#0040a0")
sTempButtons = _
" <img border=0 src=""../images/button/add.gif"" style=""cursor:hand"" name=btnAdd>" & _
" " & _
" <img border=0 src=""../images/button/clear.gif"" style=""cursor:hand"" name=btnClear>"
end if
sTemp = sTemp & _
"<table cellspacing=0 cellpadding=0 width=600 align=center border=0 class=tableform>" & _
"<form name=""frmUpdateDiary"" method=post action=""diarydetail.asp"">" & _
"<tr height=20>" & _
" <td width=600 >" & DrawCal("记录日期", sRecord_time, "record_time", "dateimg1") & "</td>" & _
" <input type=""hidden"" name=""serial"" value=""" & iSerial & """>" & _
" <input type=""hidden"" name=""day1"" value=""" & pDay1 & """>" & _
" <input type=""hidden"" name=""day2"" value=""" & pDay2 & """>" & _
" <input type=""hidden"" name=""page"" value=""" & iPage & """>" & _
" <input type=hidden name=formAction>" & _
"<tr height=20><td width=600 ><span style=""vertical-align:middle"">日志名称:</span><input type=""text"" name=""subject"" value=""" & sSubject & """ size=87 maxlength=100 style=""text-align:left""> </td>" & _
"<tr height=2><td width=600 ></td></tr>" & _
"<tr ><td width=600 ><span style=""vertical-align:top"">日志内容:</span><textarea name=""content"" rows=20 cols=85 style=""font-family:宋体;font-size:9pt;border:1px solid gray;"">" & sContent & "</textarea></td>" & _
"<tr height=30px><td width=600 align=center>" & _
sTempButtons & _
" </td></tr>" & _
"</form>" & _
"</table>"' & _
FormUpdateDiary = sTemp
End Function
'************************************************************************************************
' 函数名 : TableLink()
' 输 入 :
' 输 出 : 页面下方提供的链接
' 功能描述:
' 调用模块: diarydetail.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-06-06
' 版 本 :
'************************************************************************************************
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> " & _
" <img src=""../images/goto.gif"" width=11 height=11> <a href=""diaryquery.asp"">查询工作日志</a>" & _
" " & _
"</tr>" & _
"</table>"
End Function
'************************************************************************************************
' 函数名 : UpdateDiary()
' 输 入 :
' 输 出 :
' 功能描述: 更新日志的数据处理,根据formAction的值,采取不同的操作:
' addtype:新添
' updtype:更新
' deltype:删除
' 调用模块: diarydetail.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-06-06
' 版 本 :
'************************************************************************************************
Sub UpdateDiary()
dim sSQL, iEmpSerial, sAction, iSerial, sSubject, sContent, sRecord_Time, sError, pDay1, pDay2
sAction = GetParam("formAction")
iSerial = GetParam("Serial")
sSubject = GetParam("subject")
sContent = GetParam("content")
sRecord_Time = GetParam("record_time")
pDay1 = GetParam("day1")
pDay2 = GetParam("day2")
iEmpSerial = GetEmpSerial
sAction = LCase(sAction)
select case sAction
case "addtype"
sSQL = "insert into T_Diary(subject, content, record_time, emp_serial) " & _
" values(" & ToSQL(sSubject,"Text") & ", " & ToSQL(sContent,"Text") & "," & ToSQL(sRecord_Time,"Text") & "," & ToSQL(iEmpSerial,"Number") &")"
case "updtype"
sSQL = "update T_Diary" & _
" set subject = " & ToSQL(sSubject, "Text") & ", content = " & ToSQL(sContent,"Text") & _
" , record_time = " & ToSQL(sRecord_Time,"Text") & "where serial = " & ToSQL(iSerial,"Number")
case "deltype"
sSQL = "delete from T_Diary where serial = " & ToSQL(iSerial,"Number")
case "cancel"
response.write "<script language=vbscript>window.navigate(""diaryquery.asp?day1="&pday1&"&day2="&pday2&"&page="&iPage&"&"")</script>"
response.end
end select
sError = ExecuteSQL(dbLocal, sSQL)
if sError <> "" then
if sAction = "addtype" then
Response.Write "<script language=""javascript"">alert('对不起,不能新增该日志!')</script>"
end if
if sAction = "deltype" then
Response.Write "<script language=""javascript"">alert('对不起,不能删除该日志!')</script>"
end if
' Response.Write "<script language=""javascript"">alert('对不起,操作中发生错误,请查阅帮助文件!')</script>"
end if
if sAction = "updtype" or sAction = "deltype" then
response.write "<script language=vbscript>window.navigate(""diaryquery.asp?day1="&pday1&"&day2="&pday2&"&page="&iPage&"&"")</script>"
end if
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -