?? editmsg.asp
字號:
<!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 + -