📄 oa_addnews.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<%
if ChkAdmin("oa_djs")=False then
call message("您没有管理大记事的权限","back")
call endexit()
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="../img/css1.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>
<%
id=replace(request.QueryString("id"),"'","")
act=request.QueryString("act")
uid=Session("AdminID")'发不者id
companyid=Session("companyid")'公司id
notice_addtime=date()
addtime=trim(request.Form("addtime"))
uname=session("truename")
oa_blogtitle=replace(trim(request.Form("oa_blogtitle")),"'","")
oa_blogtitle=CheckInfuse(oa_blogtitle,len(oa_blogtitle))'sql过滤
oa_blogcontent=replace(trim(request.Form("oa_blogcontent")),"'","")
oa_blogcontent=HTMLEncode(oa_blogcontent)
hits=1
insql="insert into oa_news(adduser,title,content,companyid,addtime,hits) "& _
"values('"&uname&"','"&oa_blogtitle&"','"&oa_blogcontent&"',"&companyid&",'"¬ice_addtime&"',1)"
upsql="update oa_news set title='"&oa_blogtitle&"',content='"&oa_blogcontent&"',addtime='"&addtime&"' where id="&request.Form("ids")
if act="add" then
if oa_blogtitle="" then
call Message("请选输入标题","back")
call endexit()
end if
conn.execute(insql)
call Message("发布成功","news.asp")
elseif act="edit" then
if oa_blogtitle="" then
call Message("请选输入标题","back")
call endexit()
end if
conn.execute(upsql)
call Message("修改成功","news.asp")
end if
%>
<body>
<%
if act="" then
%>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
<form name="form1" method="post" action="oa_addnews.asp?act=add">
<tr align="center">
<td height="25" colspan="2" bgcolor="#CC0000"><span class="style1">发布大记事</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td width="13%" height="25" align="center">时 间</td>
<td width="87%" height="25" align="left"><input name="addtime" type="text" class="tabel1" id="addtime" value="<%=date()%>" readonly="true"></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 标 题</td>
<td height="25" align="left"><input name="oa_blogtitle" type="text" class="tabel1" id="oa_blogtitle" size="70">
*</td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 内 容</td>
<td height="25" align="left"><textarea name="oa_blogcontent" cols="90" rows="20" class="tabel1" id="oa_blogcontent"></textarea></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" colspan="2" align="center"><input name="Submit2" type="submit" class="bon" value="提交">
<input name="Submit3" type="reset" class="bon" value="重置">
<span class="style1"><font style="font-size:15px ">
<input name="Submit" type="button" class="bon" value="返回上页" onClick="window.history.go(-1)">
</font></span></td>
</tr></form>
</table>
<%
elseif act="edits" then
if ChkAdmin("oa_djs")=False then
call message("您没有管理大记事的权限","back")
call endexit()
end if
sqle="select * from oa_news where id="&id
set rs=conn.execute(sqle)
if not rs.eof then
addtime1=rs("addtime")
title1=trim(rs("title"))
content1=trim(rs("content"))
content1=fHTMLEncode(content1)
end if
rs.close
set rs=nothing
%>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F2F2" class="tabel1">
<form name="form1" method="post" action="oa_addnews.asp?act=edit">
<tr align="center">
<td height="25" colspan="2" bgcolor="#CC0000"><span class="style1">修改大记事</span></td>
</tr>
<tr bgcolor="#F9F9F9">
<td width="13%" height="25" align="center">时 间</td>
<td width="87%" height="25" align="left"><input name="addtime" type="text" class="tabel1" id="addtime" value="<%=addtime1%>" readonly="true"></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 标 题</td>
<td height="25" align="left"><input name="oa_blogtitle" type="text" class="tabel1" id="oa_blogtitle" size="70" value="<%=title1%>">
*</td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" align="center"> 内 容</td>
<td height="25" align="left"><textarea name="oa_blogcontent" cols="90" rows="20" class="tabel1" id="oa_blogcontent"><%=content1%></textarea></td>
</tr>
<tr bgcolor="#F9F9F9">
<td height="25" colspan="2" align="center"><input name="Submit2" type="submit" class="bon" value="提交">
<input name="Submit3" type="reset" class="bon" value="重置">
<span class="style1"><font style="font-size:15px ">
<input name="Submit" type="button" class="bon" value="返回上页" onClick="window.history.go(-1)">
<input name="ids" type="hidden" id="ids" value="<%=id%>">
</font></span></td>
</tr></form>
</table>
<%
end if
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -