writetzeweb.asp

来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 278 行

ASP
278
字号

<%
if request.servervariables("HTTP_REFERER")="tzok" then 
response.write("不能返回..")
end if%>
<!--#include file="../../Connections/oavbsconn.asp" -->
<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<!--#include file="../../Connections/leq.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="/index.asp"
MM_grantAccess=false
If Session("userssdfgfhtrh") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_oavbsconn_STRING
Recordset1.Source = "SELECT 部门名  FROM 部门用户关系  group by 部门名,排序  ORDER BY 排序,部门名 desc"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim getemailid__varuser
getemailid__varuser = "yp"
If (Session("userssdfgfhtrh")  <> "") Then 
  getemailid__varuser = Session("userssdfgfhtrh") 
End If
%>
<%
Dim getemailid
Dim getemailid_numRows
Set getemailid = Server.CreateObject("ADODB.Recordset")
getemailid.ActiveConnection = MM_oavbsconn_STRING
getemailid.Source = "SELECT max(ID)+1 as emailid  FROM infoall  WHERE 发送人帐号='" + Replace(getemailid__varuser, "'", "''") + "'"
getemailid.CursorType = 0
getemailid.CursorLocation = 2
getemailid.LockType = 1
getemailid.Open()
getemailid_numRows = 0
%>
<%
Dim user__MMColParam
user__MMColParam = "服装院"
If (Session("choosedbumenming") <> "") Then 
  user__MMColParam = Session("choosedbumenming")
End If
%>
<%
Dim user
Dim user_numRows

Set user = Server.CreateObject("ADODB.Recordset")
user.ActiveConnection = MM_oavbsconn_STRING
user.Source = "SELECT *  FROM 部门用户关系  WHERE 部门名 = '" + Replace(user__MMColParam, "'", "''") + "'"
user.CursorType = 0
user.CursorLocation = 2
user.LockType = 1
user.Open()

user_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_numRows
Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_oavbsconn_STRING
Recordset2.Source = "SELECT * FROM usertertggbng ORDER BY 排序 ASC"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()
Recordset2_numRows = 0
%>
<% if not getemailid.eof or not getemailid.bof then 
session("maxemailid")=getemailid("emailid")
end if 
%>

<html>
<head>
<script language="JavaScript">
<!--
function check() {
if (document.globe.标题.value=="") {
window.alert ("请您输入标题 !")
document.globe.标题.focus()
return false
}
if (document.globe.标题.value.length<4) {
window.alert ("标题需要4位或4位以上字符 !")
document.globe.标题.focus()
return false
}
if (document.globe.标题.value.length>30) {
window.alert ("标题需要30位以内字符 !")
document.globe.标题.focus()
return false
}

return true
}
//-->
</SCRIPT>




<script language = "JavaScript">

function CheckForm()
{
  if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
  else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 



if (document.myform.标题.value=="") {
window.alert ("请您输入标题 !")
document.myform.标题.focus()
return false
}
if (document.myform.标题.value.length<4) {
window.alert ("标题需要4位或4位以上字符 !")
document.myform.标题.focus()
return false
}
if (document.myform.标题.value.length>30) {
window.alert ("标题需要30位以内字符 !")
document.myform.标题.focus()
return false
}
  if (document.myform.Content.value=="")
  {
    alert("文章内容不能为空!");
	editor.HtmlEdit.focus();
	return false;
  }
  if (document.myform.Content.value.length>65536)
  {
    alert("文章内容太长,超出了ACCESS数据库的限制(64K)!建议将文章分成几部分录入。");
	editor.HtmlEdit.focus();
	return false;
  }
  return true;  
}
</script>






















<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>撰写通知</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
<link href="/css/link.css" rel="stylesheet" type="text/css">
<link href="/css/input.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {
	color: #CC6633;
	font-weight: bold;
}
.style4 {color: #CC6633}
-->
</style>
</head>

<body>
<div align="center">
  <form method="POST" action="writepost.asp" name="myform" onSubmit="return CheckForm();">
    <div align="center">
      <center>
        <table width="814" border="0" cellpadding="2" cellspacing="1" bgcolor="#AFDBFF">
          <tr>
            <td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr bgcolor="399CA0">
                <td colspan="2" bgcolor="#AFDBFF"><div align="center"><span class="style1 style2"><span class="style4">发布通知</span></span></div></td>
              </tr>
              <tr bgcolor="#FFFFFF">
                <td width="92">标题:</td>
                <td width="737" bgcolor="#FFFFFF"><input name="标题" type="text" id="标题" size="40"></td>
              </tr>
              <tr bgcolor="#FFFFFF">
                <td><div align="left"><br>
                        <table width="11" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td>内容:</td>
                          </tr>
                          <tr>
                            <td><img src="/toall/tz/img/gif/77.gif" width="77" height="56"></td>
                          </tr>
                        </table>
                </div></td>
                <td bgcolor="#FFFFFF"><textarea name="Content" style="display:none"></textarea> 
                                  <iframe ID="editor" src="/toall/tz/eweb/news/editor.asp" frameborder=1 scrolling=no width="600" height="405"></iframe> 

                </td>
              </tr>
              <tr bgcolor="#FFFFFF">
                <td><input name="信息属性" type="hidden" id="信息属性" value="通知">
                    <input name="发送人帐号" type="hidden" id="发送人帐号" value="<%= Session("userssdfgfhtrh") %>">
                    <input name="发送人姓名" type="hidden" id="发送人姓名" value="<%= Session("names") %>">
                    <input name="datas" type="hidden" id="datas" value="<%=date%>"></td>
                <td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="发   布">
        
        <input type="reset" name="Submit" value="清 空">
       
      <input type="button" name="Submit" value="取 消" onclick="javascript:history.go(-1)"></td>
              </tr>
            </table></td>
          </tr>
        </table>
        <p>&nbsp;</p>
      </center>
    </div>
  </form>
</div>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
getemailid.Close()
Set getemailid = Nothing
%>
<%
user.Close()
Set user = Nothing
%>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?