📄 news_e.inc
字号:
<%
Function FormNews()
dim sTitle, sActionLinks
if IsEmpty(pNewsSerial) then
sTitle = "新 增 大 楼 动 态" '' 显示新增、取消的链接
sActionLinks = _
"<tr bgcolor=white height=30>" & vbLF & _
" <td colspan=2 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/clear.gif"" onclick=""btnClear_OnClick()"" style=""cursor:hand"">" & vbLF & _
" </td>" & vbLF & _
"</tr>" & vbLF
else
sTitle = "编 辑 大 楼 动 态" '' 显示修改、删除、取消的链接
sActionLinks = _
"<tr bgcolor=white height=30>" & vbLF & _
" <td colspan=2 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
end if
FormNews = _
"<table cellspacing=0 cellpadding=0 bgcolor=silver border=0 width=""100%"" style=""table-layout:fixed"">" & vbLF & _
"<tr style=""display:none"">" & vbLF & _
" <td width=80>这一行仅用于控制表格宽度</td>" & vbLF & _
" <td width=""*"">这一行仅用于控制表格宽度</td></tr>" & vbLF & _
"<form method=post name=formNews action=""news_e.asp"">" & vbLF & _
"<input type=""hidden"" name=""FormAction"">" & vbLF & _
"<input type=""hidden"" name=""serial"" value=""" & pNewsSerial & """>" & vbLF & _
"<tr height=20 bgcolor=white>" & vbLF & _
" <td colspan=2 background=""../images/bg/bnbg.gif"" style=""color:white;font-weight:600"" align=center>" & sTitle & "</td></tr>" & vbLF & _
"<tr height=30 bgcolor=white>" & vbLF & _
" <td align=center>标 题:</td>" & vbLF & _
" <td><input type=""text"" name=""subject"" value=""" & sNewsTitle & """ size=83 maxlength=100></td></tr>" & vbLF & _
"<tr bgcolor=white>" & vbLF & _
" <td width=80 align=center>内 容:</td>" & _
" <td><textarea name=""content"" rows=22 cols=81 style=""color:blue;"">" & sNewsContent & "</textarea></td></tr>" & vbLF & _
sActionLinks & vbLF & _
"</form>" & _
"</table>" & vbLF & _
""
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> " & _
" <img src=""../images/goto.gif""> <a href=""news.asp"">大楼动态列表</a>" & _
" " & _
" <img src=""../images/goto.gif""> <a href=""../common/main.asp"">回到首页</a></td>" & _
"</tr>" & _
"</table>"
End Function
sub AddNews()
dim sSQL
sSQL = "insert into t_news(subject, content, record_time)" & _
" values(" & ToSQL(sNewsTitle, "Text") & _
", " & ToSQL(sNewsContent, "Text") & _
", " & ToSQL(now, "Text") & _
")"
call ExecuteSQL(dbLocal, sSQL)
response.redirect "news.asp"
' pNewsSerial = empty '' 重新置成新增状态
' sNewsTitle = ""
' sNewsContent = ""
end sub
sub UpdateNews()
dim sSQL
sSQL = "update t_news" & _
" set subject = " & ToSQL(sNewsTitle, "Text") & _
", content = " & ToSQL(sNewsContent, "Text") & _
", record_time = " & ToSQL(now, "Text") & _
" where serial = " & ToSQL(pNewsSerial, "Number")
call ExecuteSQL(dbLocal, sSQL)
response.redirect "newsdetail.asp?serial=" & pNewsSerial & "&"
' pNewsSerial = empty
' sNewsTitle = "" '' 重新置成新增状态
' sNewsContent = ""
end sub
sub DeleteNews()
dim sSQL
sSQL = "delete from t_news where serial = " & ToSQL(pNewsSerial, "Number")
call ExecuteSQL(dbLocal, sSQL)
response.redirect "news.asp"
' pNewsSerial = empty '' 重新置成新增状态
' sNewsTitle = ""
' sNewsContent = ""
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -