<!--#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 




 
			grade=Upload.Form("grade").value
			subject=Upload.Form("subject").value
			guige=Upload.Form("guige").value
			danshuangmian=Upload.Form("danshuangmian").value
			banzhishu=Upload.Form("banzhishu").value
			yinjuanshu=Upload.Form("yinjuanshu").value
			 
			set FileObj1=Upload.Files("file1") 
	            filename=FileObj1.FileName
 
			dim rsgonggaosql
			dim rsgonggao			
			 		
			
			dim strdateandtime
			if  dateandtime<>"" then
			   strdate=cdate(dateandtime)
			else  
			   strNow=now()
			 end if

			
			'从存储过程取得yishuaziliaoID
			dim fid 
			Set cmd = server.CreateObject("ADODB.Command")
			set Cmd.ActiveConnection = conn
			with Cmd
			   .CommandText = "incid"
			   .CommandType = 4
			   .parameters.Refresh
			   .parameters("@name") ="AllID"
			   .execute
			   fid = .parameters("@id")
			end with

			
	
	
	   set Rsqingjia=server.createobject("adodb.recordset")
       Rsqingjiasql="select * from yinshua where (id is null)" 
       Rsqingjia.open Rsqingjiasql,conn,1,3
       Rsqingjia.addnew
	   Rsqingjia("id")=fid
	   Rsqingjia("xueqi")=request.cookies("nowxueqi")
       Rsqingjia("grade")=grade
	   Rsqingjia("subject")=subject
	   Rsqingjia("guige")=guige
	   Rsqingjia("danshuangmian")=danshuangmian
	   Rsqingjia("banzhishu")=banzhishu
	   Rsqingjia("yinjuanshu")=yinjuanshu
	   Rsqingjia("shuoming")=shuoming
	
       Rsqingjia("teacher")=request.cookies("tname")
	   Rsqingjia("datetime")=now()
	  
	 
       Rsqingjia.update
       
			
			
			
			
			
			IF  filename<>"" THEN
						sql="select * from yinshuaFile where (id is null)"
						Set rs= Server.CreateObject("ADODB.Recordset")
						rs.open sql,conn,1,3
						rs.addnew 
						rs("ziliaoid")=fid
						rs("filename")=FileObj1.FileName
						rs("fileContentType")=FileObj1.ContentType
						rs("filevalue").appendchunk FileObj1.Binary
						rs("FileLength")= FormatNumber(FileObj1.Size/1024/1024,2)
						rs.update 
						rs.close 
			end if 
		
	
			Rsqingjia.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="left" class="STYLE1"><br>
          <span class="STYLE2">印刷数量为：
          <%response.write yinjuanshu%>
          <br>
        附件标题为：
        <%response.write filename%>
          </span></p>
    <center>
    <p align="center"><br>
    <br>
    </p>
      </td>
    </tr>
  </table>
</div>
<div align="center">
  <p>
&nbsp;&nbsp; </p>
  <p>   
    <input name="button" type="button" class="topanniu" onClick="location='main.asp?curpage=<%=curpage%>'" value="返回上页">
    </p>
</div>
</body>  
  
</html>  



