
<!--#INCLUDE FILE="fupload.inc"-->
<!--#include file="../SQLconn.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">

<title>保存文件</title>

<link rel="stylesheet" href="../css/style.css">

<style type="text/css">
<!--
.STYLE2 {color: #000000}
-->
</style>
</head>
<body  topmargin="5" leftmargin="5">
<p>
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'---------------------------
'response.write "开始发送<br>"
'---------------------------
Dim Fields
UploadSizeLimit=21212121
Set Fields = GetUpload()
dim Field
For Each Field In Fields.Items
if Field.name="grade" then grade=BinaryToString(Field.value)
if Field.name="subject" then subject=BinaryToString(Field.value)
if Field.name="guige" then guige=BinaryToString(Field.value)
if Field.name="danshuangmian" then danshuangmian=BinaryToString(Field.value)
if Field.name="banzhishu" then banzhishu=BinaryToString(Field.value)
if Field.name="yinjuanshu" then yinjuanshu=BinaryToString(Field.value)
if Field.name="file1" then
filename=field.FileName
fileContentType=field.ContentType
filevalue=field.value
flength=field.Length/1024/1024
end if
next

'系统提示文件大小超出范围
if flength>CINT(request.cookies("filelength"))  then
 %>  
<div align="center" class="STYLE1 STYLE3" title="提示信息框">
                <span style="BACKGROUND:#EEEEFF;COLOR:#FF6633;margin: 10px;border:1px dotted #FF6633;
				 font-weight:bold;padding:18px;width=540">
                附件 <%=FormatNumber(flength,2)%>M 太大，系统设定不能上传大于<%=request.cookies("filelength")%>M的文件。</span>                 </div>
<%   
else
			dim rsgonggaosql
			dim rsgonggao
			
			dim filename
			
			
			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") ="yishuaziliaoID"
			   .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")=filename
						rs("fileContentType")=fileContentType
						rs("filevalue").appendchunk filevalue
						rs("FileLength")= flength
						rs.update 
						rs.close 
			end if 
		
	
			Rsqingjia.close


			%>
</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>

    <%end if
end if
%><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>  



