公文下发和上报管理:   在发布和上报文件时

源代码在线查看: modifyfile.asp

软件大小: 3016 K
上传用户: mengcong18
关键词: 发布
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
				
				
				 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);}
				                    }
				
				
				
				
				
				
				
				
				
				
				
								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 "修改成功"&""
					Response.Write "返回"
				
				'正常提交
				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
				
				%>
				
				  修改文件    "*"号的表示必须填写 
				
				
				
				
				  
				  
				   
				       
				         
				          
				            
				               
				            
				             
				               
				                文件标题:              
				               
				                 
				              * 
				               
				                				            set rs1=server.createobject("ADODB.recordset") 
							sql1="select * from fbgtype"
							rs1.open sql1,conn,1,1
							%>
				                 文件类型:
				                  
				                    				              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
				          
							  %>
				                    
				                    										 end if
										 rs1.Movenext
									loop
				           ' if i=0 then Response.Write "无权发布或没有类型"
				              else
				              %>
				                    没有类型
				                    				              end if
				              rs1.Close
				              set rs1=nothing
				            'conn.close
				            'set conn=nothing%>
				                  
				                            
				            
				             
				               
				                发布单位:              
				               
				                 
				                * 
				                
				              
				            
				             
				               
				                收文单位:              
				               
				                 											Response.Write condition 
									   else 
											Response.Write rs("joinman") 
									   end if
									 %>
				                *文件接收单位列表 
				              
				            
				             
				               
				            
				          
				         
				
				
				    
				  
				
				
				
				
				
				
								set rs=nothing
				
				end if
				
				conn.close
				set conn=nothing
				%>
				
				
				
				
				
				
				
				
							

相关资源