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

📄 editmsg.asp

📁 流溪网络办公系统:管理员: 用户名:admin 密码:
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="connsf.asp" -->
<!--#include file="md5.inc" -->
<!--#include file="checkstr.asp" -->
<!--#include file="config.asp" -->
<%'检验用户
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,能否发送 from user_teacher where 用户名='"&user&"' and 密码='"&pass1&"'"
set rs=conn.execute(str)
if rs.eof then
    response.redirect("user_login.asp")
else
    user_name=rs("姓名")
	sendyesno=rs("能否发送")
end if
rs.close
if sendyesno="0" then response.redirect("list.asp")
%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改已发送信息</title>
<!--#include file="css.css" -->



<script LANGUAGE="javascript">
<!--
function form1_onsubmit() {
var i, n;
if (document.form1.zt.value=="")
	{
	  alert("对不起,请输入发送信息的主题!")
	  document.form1.zt.focus()
	  return false
	 }
else if (document.form1.zt.value.length < 2)
	{
	  alert("您的主题能不能长一点!")
	  document.form1.zt.focus()
	  return false
	 }
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}
//-->
</script>

<SCRIPT>
// Begin upload1
      function upload1(upload1)
      {
        url ='upload1.asp';
        window.open(url,upload1,"width=520,height=180,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no");
      }
    // End adduser-->
</script>

</head>

<%doing=Trim(Request.QueryString("doing"))
  edit_id=Trim(Request.QueryString("edit_id"))
  list=Trim(Request.QueryString("list"))%>

<%'检验是否发送人
  str="select 发文者 from woa where id="&edit_id&""
  set rs=conn.execute(str)
  if rs("发文者")<>user_name then response.redirect("list.asp")
  rs.close
%>

<%'删除附件
if doing="delefj" then
    delefile=Trim(Request.QueryString("delefile"))
	           del_file=delefile
			   del_file=Server.MapPath(del_file)
               Set fs=Server.CreateObject("Scripting.FileSystemObject")
               if fs.FileExists(del_file) then
                  fs.DeleteFile del_file,True
               end if
	defjsm=Trim(Request.QueryString("defjsm"))&"|"
	str="select * from woa where id="&edit_id&""
	set rs=conn.execute(str)
	delefile=delefile&"|"
	fjname=replace(rs("附件"),delefile,"")
	  if fjname="" then fjname=" "
	fjsm=replace(rs("附件说明"),defjsm,"")
	  if fjsm="" then fjsm=" "
    rs.close
	str="update woa set 附件='"&fjname&"',附件说明='"&fjsm&"',附件数=附件数-1 where id="&edit_id&" and 发文者='"&user_name&"'"
	conn.execute(str)
end if
%>

<%'修改接收人
if doing="rejsr" then
  usr_all=Trim(Request.Form("usr_all"))
  set sele_bumeng=Request.Form("sele_bumeng")
  set sele_zhuwu=Request.Form("sele_zhuwu")
  set sele_name=Request.Form("sele_name")
  sure_user=Trim(Request.Form("sure_user"))

     jsz="|"
	  
  if usr_all="1" then           '发送给全部人员
     usr_all="1"
  else       '发给部分人员
     usr_all="0"
	 
	      '得到部门人
	       for each temp in sele_bumeng
	             str="select 姓名 from user_teacher where 部门='"&temp&"'"
				 set rs=conn.execute(str)
                 if not rs.eof then
				    do while not rs.eof
					    jsz=jsz&rs("姓名")&"|"
						rs.movenext
				    loop
				 end if
				 rs.close
	       next

		   '得到职务人员
		   for each temp in sele_zhuwu
		         temp1="|"&temp&"|"
		         str="select 姓名 from user_teacher where 职务 like '%"&temp1&"%'"
				 set rs=conn.execute(str)
                 if not rs.eof then
				    do while not rs.eof
					    jsz=jsz&rs("姓名")&"|"
						rs.movenext
				    loop
				 end if
				 rs.close
		   next
		   	   
		   '得到选择人员
		   for each temp in sele_name
				jsz=jsz&temp&"|"
		   next
		   
		   '得到指定人
		   if sure_user<>"" then jsz=jsz&sure_user&"|"
  end if

        sql="select * from woa where id="&edit_id&" and 发文者='"&user_name&"'"
          rs.open sql,conn,2,3

	      rs("接收者")=jsz
	      rs("已看者")="|"
	      rs("已清除者")="|"
		  rs("发文日期")=date
	      rs("发文时间")=time
		  rs("所有人")=usr_all
          rs.update
          rs.close

end if
%>

<%'修改数据库信息
if doing="sendto" then
  zt=Trim(Request.Form("zt"))
  zt=checkstr(zt)
  nr=Request.Form("nr")
  nr=checkstr(nr)
    if nr="" then nr=" "
  fj_name=session("fj_name")
     session("fj_name")=empty
  fj_sm=session("fj_sm")
     session("fj_sm")=empty
  fj_count=int(len(fj_name)/24)

        sql="select * from woa where id="&edit_id&" and 发文者='"&user_name&"'"
          rs.open sql,conn,2,3

          rs("标题")=zt
          rs("内容")=nr
	      rs("发文日期")=date
	      rs("发文时间")=time
	      rs("已看者")="|"
	      rs("已清除者")="|"
	      rs("附件数")=rs("附件数")+fj_count
	      if fj_sm<>"" then rs("附件说明")=rs("附件说明")&fj_sm
		  if fj_name<>"" then rs("附件")=rs("附件")&fj_name
          rs.update
          rs.close

end if
%>

<body topmargin="1">
<div align="center">
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tabletblg">
    <tr>
      <td><!--#include file="top.asp" --></td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td height="30" bgcolor="#6699FF">   

⌨️ 快捷键说明

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