📄 hotspot_b.inc
字号:
<%
Function CardForm()
dim sSQL, crs, rs
dim sDept, sSubject, sContent, sHappen_Time
dim sActionLinks
dim sRecord_Time : sRecord_Time=now()
dim sRecorder_ID
'' 如果是更新操作,则根据HotSpot序列号获取详细信息
if sAction = "modify" then
sSQL = "select * from T_Hotspot where Serial = " & iHotSerial
set crs = New CRecordset
set rs = crs.Open(dbLocal, sSQL)
'' 居然找不到大事记信息的记录,那肯定是个莫名的错误
if rs.EOF then
Server.Transfer("../common/error.asp")
Response.end
end if
'' 获取大事记信息的各种数据
sDept = crs.GetValue("Dept")
sSubject = crs.GetValue("Subject")
sContent = crs.GetValue("Content")
sRecorder_ID = crs.GetValue("Recorder_ID")
sRecord_Time = crs.GetValue("Record_Time")
sHappen_Time = crs.GetValue("Happen_Time")
sRecorder_ID = TransEmpSerial(dbLocal, sRecorder_ID)
crs.Close()
end if
if sAction = "modify" then '' 显示修改和删除的链接
sActionLinks = _
"<tr bgcolor=white height=30>" & vbLF & _
" <td colspan=8 align=center>" & vbLF & _
" <img border=0 src=""../images/button/update.gif"" onclick=""btnUpdate_OnClick()"" style=""cursor:hand"">" & vbLF & _
" " & vbLF & _
" <img border=0 src=""../images/button/delete.gif"" onclick=""btnDelete_OnClick()"" style=""cursor:hand"">" & vbLF & _
" " & vbLF & _
" <img border=0 src=""../images/button/cancel.gif"" onclick=""btnCancel_OnClick()"" style=""cursor:hand"">" & vbLF & _
" </td>" & vbLF & _
"</tr>" & vbLF
else
sActionLinks = _
"<tr bgcolor=white height=30>" & vbLF & _
" <td colspan=8 align=center>" & vbLF & _
" <img border=0 src=""../images/button/add.gif"" onclick=""btnAdd_OnClick()"" style=""cursor:hand"">" & vbLF & _
" " & vbLF & _
" <img border=0 src=""../images/button/cancel.gif"" onclick=""btnReturn_OnClick()"" style=""cursor:hand"">" & vbLF & _
" </td>" & vbLF & _
"</tr>" & vbLF
end if
CardForm = _
"<form method=""post"" name=""frmEdit"" action=""HotSpot_b.asp"">" & vbLF & _
"<input type=""hidden"" name=""serial"" value=""" & iHotSerial & """>" & vbLF & _
"<table cellspacing=1 cellpadding=0 width=600 border=0 align=center bgcolor=silver>" & vbLF & _
"<tr height=20 style=""color:white;font-weight:600"">" & vbLF & _
" <td background=""../images/bg/bnbg.gif"" align=center colspan=8>编 辑 大 事 记 信 息</td></tr>" & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>部 门:</td>" & vbLF & _
" <td colspan=3><input type=""text"" name=""dept"" value=""" &sDept& """ size=60 maxlength=10></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>主 题:</td>" & vbLF & _
" <td colspan=3 class=tdvalue><input type=""text"" name=""subject"" value=""" & sSubject & """ size=85 maxlength=25></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>内 容:</td>" & vbLF & _
" <td colspan=3 class=tdvalue><textarea name=""content"" row=5 cols=84>" & sContent & "</textarea></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>记 录 人:</td>" & vbLF & _
" <td colspan=3 class=tdvalue><input type=""text"" name=""recorder_ID"" value=""" & sRecorder_ID & """ size=85 maxlength=8></td></tr>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>记录时间:</td>" & vbLF & _
" <td class=tdvalue width=250><input type""text"" name=""record_Time"" value=""" & sRecord_Time & """ size=50 maxlength=25></td>" & vbLF & _
"<tr bgcolor=white height=30>" & vbLF & _
" <td align=center width=70>发生时间:</td>" & vbLF & _
" <td class=tdvalue width=250><input type=""text"" name=""happen_Time"" value=""" & sHappen_Time & """ size=39 maxlength=25></td></tr>" & vbLF & _
sActionLinks & vbLF & _
"</table>" & vbLF & _
"</form>" & vbLF & _
"<br>"
End Function
Function TableLink()
TableLink = _
"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
"<tr height=10>" & vbLF & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
"</tr>" & vbLF & _
"<tr height=20>" & _
" <td width=600> " & vbLF & _
" <img src=""../images/goto.gif""> <a href=""HotSpot_a.asp"">大事记信息查询</a></td>" & vbLF & _
" " & vbLF & _
"</tr>" & _
"</table>"
End Function
Function AddCard()
dim sSQL, crs, rs
dim sDept, sSubject, sContent, sRecorder_ID, sRecord_Time, sHappen_Time
sDept = GetParam("dept")
sSubject = GetParam("subject")
sContent = GetParam("content")
sRecorder_ID = GetParam("recorder_ID")
sRecord_Time = GetParam("record_Time")
sHappen_Time = GetParam("happen_Time")
sSQL = "select Serial from T_Employee where Name="& ToSQL(sRecorder_ID, "Text")
'response.write sSQL : response.end
set crs = New CRecordset
set rs = crs.Open(dbLocal, sSQL)
sRecorder_ID =crs.GetValue("Serial")
crs.close()
sSQL = "insert into T_Hotspot(Dept, Subject, Content, Recorder_ID, Record_Time, Happen_Time)" & _
" values(" & ToSQL(sDept, "Text") & ", " & ToSQL(sSubject,"Text") & ", " & ToSQL(sContent, "Text") & _
", " & ToSQL(sRecorder_ID, "Text") & ", " & ToSQL(sRecord_Time, "Date") & ", " & ToSQL(sHappen_Time, "Date") & ")"
'response.write sSQL : response.end
call ExecuteSQL(dbLocal, sSQL)
iHotSerial = DLookUp(dbLocal, "T_HotSpot", "max(Serial)", "")
Response.Redirect "HotSpot_a.asp?Serial=" & iHotSerial & "&"
Response.end
End Function
Function UpdateCard()
dim sSQL
dim sDept, sSubject, sContent, sRecorder_ID, sRecord_Time, sHappen_Time
sDept = GetParam("dept")
sSubject = GetParam("subject")
sContent = GetParam("content")
sRecorder_ID = GetParam("recorder_ID")
sRecord_Time = GetParam("record_Time")
sHappen_Time = GetParam("happen_Time")
sSQL = "update T_HotSpot" & _
" set Dept = " & ToSQL(sDept, "Text") & _
", Subject = " & ToSQL(sSubject, "Text") & _
", Content = " & ToSQL(sContent, "Text") & _
", Recorder_ID = " & ToSQL(sRecorder_ID, "Text") & _
", Record_Time = " & ToSQL(sRecord_Time, "Date") & _
", Happen_Time = " & ToSQL(sHappen_Time, "Date") & _
" where serial = " & ToSQL(iHotSerial, "Number")
' response.write sSQL : response.end
call ExecuteSQL(dbLocal, sSQL)
Response.Redirect "HotSpot_a.asp?serial=" & iHotSerial & "&"
Response.end
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -