📄 modifyfile.asp
字号:
<!--#include file="asp/opendb.asp"-->
<!--#include file="asp/checkuser.asp"-->
<!--#include file="asp/top.asp"-->
<script Language="JavaScript">
function form_check(){
if(document.form2.title.value==""){window.alert("文件名称不能为空");document.form2.title.focus();return (false);}
if(document.form2.fbdw.value==""){window.alert("发布单位不能为空");document.form2.fbdw.focus();return (false);}
if(document.form2.filename.value=="没有类型"){window.alert("文件类型不能没有");document.form2.filename.focus();return (false);}
if(document.form2.joinman.value==""){window.alert("接收单位不能为空");document.form2.joinman.focus();return (false);}
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="css/css.css">
</head>
<body topmargin="5" leftmargin="0">
<%
set conn=opendb("oabusy","conn","accessdsn")
if request("nid")<>"" then
count=0
condition=""
for each idno in request("nid")
count=count+1
condition=condition+"|" & idno
next
end if
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then
joinman=request("joinman")
title=trim(request("title"))
fbdw=trim(request("fbdw"))
filename=request("filename")
id=request("id")
if instr(joinman,oabusyusername) then
joinman=joinman&"|"
else
joinman="|"&oabusyusername&joinman&"|"
end if
sql="select * from filedata where id="&id
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,3
oldrev=rs2("joinman")
rs2.close
set rs2=nothing
sql="update filedata set title='"&title&"',fbdw='"&fbdw&"',typename='"&filename&"', joinman='"&joinman&"' where id="&id
conn.execute sql
sql="delete from fileuser where reid="&id
conn.execute sql
set rs=server.createobject("ADODB.recordset")
sql="select * from fileuser"
rs.Open sql,conn,1,3
mysendto=split(joinman,"|",-1,1)
for each sendtoinf in mysendto
if trim(sendtoinf)<>"" then
set rs1=server.createobject("ADODB.recordset")
sql="select * from userinf where username='"&trim(sendtoinf)&"'"
rs1.Open sql,conn,1,3
rs.addnew
rs("username")=sendtoinf
if not rs1.EOF then rs("name")=rs1("name")
if instr(1,oldrev,"|"&sendtoinf&"|") then
rs("qshou")=1
else
rs("qshou")=0
end if
rs("reid")=id
rs("title")=title
rs.update
rs1.Close
set rs1=nothing
end if
next
rs.close
set rs=nothing
Response.Write "修改成功"&"<br>"
Response.Write "<a href='managefile.asp'>返回</a>"
'正常提交
else
Set rs=Server.CreateObject("ADODB.recordset")
if instr(1,"||supermanage||chksuper|",oabusyuserpower)>1 then
sql="select * from filedata where id="&request("id")&" order by id desc"
else
sql="select * from filedata where manageman='"&oabusyusername&"'and id="&request("id")&" order by id desc"
end if
rs.Open sql,conn,1
%>
<P><center>
<b>修改文件</b> "<font color=red>*</font>"号的表示必须填写
</center>
<center>
<hr width="90%" size="1" noshade color="ff6633">
<form method=post name=form2 action="modifyfile.asp" >
<table width="85%" border="0" cellpadding="1" cellspacing="0" align="center">
<tr>
<td>
<table width="100%" border="0" bgcolor="#cccccc" cellpadding="0" cellspacing="1">
<tr bgcolor="#cccccc">
<td height="14" colspan="3"> </td>
</tr>
<tr bgcolor="#eeeeee">
<td width="12%" height="28">
<div align="center">文件标题:</div> </td>
<td width="59%">
<input type=text name="title" size=40 value="<%=rs("title")%>" style="border:1 solid #000000;background:#ffffff">
<font color=red>*</font> </td>
<td width="29%">
<%
set rs1=server.createobject("ADODB.recordset")
sql1="select * from fbgtype"
rs1.open sql1,conn,1,1
%>
<div align="left"> 文件类型:
<select name="filename" size="1" style="border:1 solid #000000;background:#ffffff">
<%
if not rs1.eof and not rs1.bof then
' i=0
do while not rs1.EOF
if instr(rs1("username"),oabusyusername)>1 or instr(1,"||supermanage||chksuper|",oabusyuserpower)>1 or instr(rs1("fbuser"),oabusyusername)>1 then
' i=i+1
%>
<option value="<%=rs1("typename")%>" <% if rs("typename")=rs1("typename") then%> selected <%end if%>><%=rs1("typename")%></option>
<%
end if
rs1.Movenext
loop
' if i=0 then Response.Write "<option value='没有类型'>无权发布或没有类型</option>"
else
%>
<option value="没有类型">没有类型</option>
<%
end if
rs1.Close
set rs1=nothing
'conn.close
'set conn=nothing%>
</select>
</div> </td>
</tr>
<tr bgcolor="#eeeeee">
<td height="28">
<div align="center">发布单位:</div> </td>
<td colspan="2" height="9">
<input type=text name="fbdw" size=50 value="<%=rs("fbdw")%>" style="border:1 solid #000000;background:#ffffff">
<font color=red>*</font>
<div align="center"></div>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td height="28">
<div align="center">收文单位:</div> </td>
<td colspan="2" height="4">
<textarea name="joinman" cols="60" rows="4" readonly=" " style="border:1 solid #000000;background:#ffffff"><% if request("nid")<>"" then
Response.Write condition
else
Response.Write rs("joinman")
end if
%></textarea>
<font color=red>*</font><a href="USERLIST.ASP?opper=modifyfile.asp&id=<%=rs("id")%>" >文件接收单位列表</a>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td height="5" colspan="3"> </td>
</tr>
</table>
</table> </table>
<br>
<input type="submit" name="submit" value="发布" onclick="return form_check();" style="border:1 solid #000000;background:#ffffff">
<input type="hidden" name="id" value="<%=rs("id")%>">
</form>
</center>
</body>
</html>
<%rs.Close
set rs=nothing
end if
conn.close
set conn=nothing
%><!--#include file="footer.htm"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -