?? editmsg.asp
字號(hào):
<!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" -->
<%'檢驗(yàn)用戶
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,能否發(fā)送 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("能否發(fā)送")
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>修改已發(fā)送信息</title>
<!--#include file="css.css" -->
<script LANGUAGE="javascript">
<!--
function form1_onsubmit() {
var i, n;
if (document.form1.zt.value=="")
{
alert("對(duì)不起,請(qǐng)輸入發(fā)送信息的主題!")
document.form1.zt.focus()
return false
}
else if (document.form1.zt.value.length < 2)
{
alert("您的主題能不能長(zhǎng)一點(diǎn)!")
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"))%>
<%'檢驗(yàn)是否發(fā)送人
str="select 發(fā)文者 from woa where id="&edit_id&""
set rs=conn.execute(str)
if rs("發(fā)文者")<>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("附件說(shuō)明"),defjsm,"")
if fjsm="" then fjsm=" "
rs.close
str="update woa set 附件='"&fjname&"',附件說(shuō)明='"&fjsm&"',附件數(shù)=附件數(shù)-1 where id="&edit_id&" and 發(fā)文者='"&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 '發(fā)送給全部人員
usr_all="1"
else '發(fā)給部分人員
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
'得到職務(wù)人員
for each temp in sele_zhuwu
temp1="|"&temp&"|"
str="select 姓名 from user_teacher where 職務(wù) 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 發(fā)文者='"&user_name&"'"
rs.open sql,conn,2,3
rs("接收者")=jsz
rs("已看者")="|"
rs("已清除者")="|"
rs("發(fā)文日期")=date
rs("發(fā)文時(shí)間")=time
rs("所有人")=usr_all
rs.update
rs.close
end if
%>
<%'修改數(shù)據(jù)庫(kù)信息
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
session("fj_sm")=empty
fj_count=int(len(fj_name)/24)
sql="select * from woa where id="&edit_id&" and 發(fā)文者='"&user_name&"'"
rs.open sql,conn,2,3
rs("標(biāo)題")=zt
rs("內(nèi)容")=nr
rs("發(fā)文日期")=date
rs("發(fā)文時(shí)間")=time
rs("已看者")="|"
rs("已清除者")="|"
rs("附件數(shù)")=rs("附件數(shù)")+fj_count
if fj_sm<>"" then rs("附件說(shuō)明")=rs("附件說(shuō)明")&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">
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -