⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oa_addnotice.asp

📁 网络办公系统源码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../config.asp"-->
<!--#include file="../checklogin.asp"-->
<%
	if  ChkAdmin("oa_notice")=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>
<%
did=replace(request.QueryString("did"),"'","")
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")
title=replace(trim(request.Form("title")),"'","")
notice_import=replace(trim(request.Form("notice_import")),"'","")
departid=replace(trim(request.Form("departid")),"'","")
content=replace(trim(request.Form("content")),"'","")
content=HTMLEncode(content)

insql="insert into oa_tongzhi(adduser,title,content,companyid,addtime,notice_import,departid,notice_flag) "& _
"values('"&uname&"','"&title&"','"&content&"',"&companyid&",'"&addtime&"','"&notice_import&"',"&departid&",1)"

upsql="update oa_tongzhi set title='"&title&"',content='"&content&"',addtime='"&addtime&"',notice_import='"&notice_import&"',departid="&departid&" where id="&request.Form("ids")
	
	if act="add" then
		if title="" then
			call Message("请选输入标题","back")
			call endexit()
		end if
		conn.execute(insql)
		call Message("发布成功","notice.asp")
	elseif act="edit" then
		if title="" then
			call Message("请选输入标题","back")
			call endexit()
		end if
		conn.execute(upsql)
		call Message("修改成功","notice.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_addnotice.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">
	<select name="departid" id="departid">
      <option value="0">所有部门</option>
	  <%
	  	sql="select * from oa_depart where companyid="&session("companyid")
		set rs=conn.execute(sql)
		do while not rs.eof
	  %>
      <option value="<%=rs("id")%>"><%=rs("departname")%></option>
	  <%
	  rs.movenext
	  loop
	  rs.close
	  set rs=nothing
	  %>
    </select>	</td>
  </tr>
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center">重要程度</td>
    <td height="25" align="left"><select name="notice_import" id="notice_import">
      <option value="重要">重要</option>
      <option value="普通" selected>普通</option>
    </select></td>
  </tr>
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center"> 标 题</td>
    <td height="25" align="left"><input name="title" type="text" class="tabel1" id="title" size="70">
      *</td>
    </tr>
  
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center"> 内 容</td>
    <td height="25" align="left"><textarea name="content" cols="90" rows="20" class="tabel1" id="content"></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_notice")=False then
  		call message("您没有管理公告的权限","back")
   		call endexit()
	end if

	if did=0 then
		sqle="select * from oa_tongzhi where id="&id
	else
		sqle="select a.*,b.departname,b.id from oa_tongzhi as a inner join oa_depart as b on a.departid=b.id where a.id="&id
 	end if
		set rs=conn.execute(sqle)
		if not rs.eof then
			addtime1=rs("addtime")
			title1=rs("title")
			content1=rs("content")
			content1=fHTMLEncode(content1)
			notice_import=rs("notice_import")
			departid=rs("departid")
			if did=0 then
			departname="所有部门"
			else
			departname=rs("departname")
			end if
		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_addnotice.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%>"></td>
  </tr>

  <tr bgcolor="#F9F9F9">
    <td height="25" align="center">接收部门</td>
    <td height="25" align="left"><select name="departid" id="departid">
	<option value="<%=departid%>" selected><%=departname%></option>
      <option value="0">所有部门</option>
      <%
	  	sql="select * from oa_depart where companyid="&session("companyid")
		set rs=conn.execute(sql)
		do while not rs.eof
	  %>
      <option value="<%=rs("id")%>"><%=rs("departname")%></option>
      <%
	  rs.movenext
	  loop
	  rs.close
	  set rs=nothing
	  %>
    </select></td>
  </tr>
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center">重要程度</td>
    <td height="25" align="left"><select name="notice_import" id="select">
	<option value="<%=notice_import%>" selected><%=notice_import%></option>
      <option value="重要">重要</option>
      <option value="普通" selected>普通</option>
    </select></td>
  </tr>
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center"> 标 题</td>
    <td height="25" align="left"><input name="title" type="text" class="tabel1" id="title" size="70" value="<%=title1%>">
      *</td>
    </tr>
  
  <tr bgcolor="#F9F9F9">
    <td height="25" align="center"> 内 容</td>
    <td height="25" align="left"><textarea name="content" cols="90" rows="20" class="tabel1" id="content"><%=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 + -