<!--#include file="../checkLogin.asp"-->
<!--#include file="../SQLconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>保存文件</title>

<link rel="stylesheet" type="text/css" href="../images/<%=request.cookies("imgdir")%>/css/style.css" media="all"/>
</head>
<body  topmargin="5" leftmargin="5">

<p>
<%
Set Upload=Server.createobject("Persits.Upload.1") 
uploadlimitsize=request.cookies("filelength")                             '改变这个设置可以改变上传文件的大小限制，单位兆。
Upload.SetMaxSize uploadlimitsize*1024*1024, True 
Upload.Save  
if err.number <> 0 then 
response.write  "出现错误: " & err.number & "、" & err.description &"" 
end if 
if err.number = 8 then 
response.write " 你上传的文件超过限制（"& uploadlimitsize &"兆）<a href=""javascript:history.go(-1)"">重新上传</a>" 
response.end 
end if 

fid=Upload.Form("id").value
sendto=Upload.Form("sendto").value
chuliren=Upload.Form("chuliren").value
content=Upload.Form("content").value





	'检查系统有无 名单 
	if sendto<>"" then
	dim mysendto1
	mysendto1=split(sendto,"|",-1,1)
	for each sendtoinf in mysendto1
		  set rscheck=server.createobject("adodb.recordset")
		  rscheckSQL="select * from teachers where TName ='"&sendtoinf&"'" 
		  rscheck.open rscheckSQL,conn,1,3
		  if  rscheck.eof and  rscheck.bof then
			  response.redirect   "FindError.asp?tname="&sendtoinf
		  end if 
	next
	



	  set rssended=server.createobject("adodb.recordset")
		rssendedsql="select * from GongWenSee where (sid is null)" 
		rssended.open rssendedsql,conn,1,3
	
		dim mysendto
		mysendto=split(sendto,"|",-1,1)
		for each sendtoinf in mysendto
				set Rscheck=Conn.Execute("select * from GongWenSee where  fid='"&fid&"' and  处理人='"&sendtoinf&"'")
				if   Rscheck.eof and   Rscheck.bof then  '检查是否重发
					rssended.addnew
					rssended("fid")=fid
					rssended("处理人")=sendtoinf
					rssended("处理IP")="" 
					rssended.update
				end if
		next
		rssended.close
     
  
   end if
        


 	set rsgonggao=server.createobject("adodb.recordset")
			rsgonggaosql="select * from GongWenSee where   fid='"&fid& "' and  处理人='"&chuliren& "' " 			
			rsgonggao.open rsgonggaosql,conn,1,3 	
						
            rsgonggao("处理人")=chuliren
			rsgonggao("处理结果")=content
			rsgonggao("处理日期")=now()					
            rsgonggao("处理IP")=Request.ServerVariables("REMOTE_ADDR")
			rsgonggao.update				
			rsgonggao.close 
   
   
   
    
			Upload.Dispose ' 释放内存 
			Set Upload = Nothing    
   
   
			%>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div align="center">



  <table border="1" cellspacing="0" width="700" bordercolorlight="#11B1FF" bordercolordark="#F0F8FF">
    <tr>
      <td width="100%" height="32">
      <p align="center" class="STYLE1 STYLE2">公文成功处理</td>
    </tr>
    <tr>
      <td width="100%">
        <p align="center"><br>
          <span class="STYLE1 STYLE2">
          </span><span class="STYLE3"></span></p>
        <p align="left"><span class="STYLE1 STYLE2"><br>
          处理结果为：<%=content%></span> <br>
		  <span class="STYLE1"><%=sendto%> </span>
          <br>
          <br>
          
    <center>
    <form name="form1" method="post" action="">
      <label>
	
        <div align="center" class="STYLE1">
		<input name="button" type="button" class="topanniu" onClick="window.close();" value="关闭" />
		&nbsp;</div>
      </label>
      
    </form>
    <p align="center"><br>
    <br>
    </p>      </td>
    </tr>
  </table>
</div>
 
<script language="Jscript"> {   //刷新母窗口
   window.opener.location.reload();
	 } 
</script>

</body>  
  
</html>  



