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

<title>教师业务档案</title>

<body>

<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 

  
   xingming=Upload.Form("xingming").value

   leibie=Upload.Form("leibie").value
   jibie=Upload.Form("jibie").value
   datetime=Upload.Form("datetime").value
   shuoming=Upload.Form("shuoming").value
   fazhengjiguan=Upload.Form("fazhengjiguan").value
   dengjidate=Upload.Form("dengjidate").value
   
   set FileObj1=Upload.Files("file1")  

dim rsgonggaosql
dim rsgonggao

dim filename

'dim strtype 
dim strdateandtime
if  dateandtime<>"" then
   strdate=cdate(dateandtime)
else  
   strNow=now()
 end if
 
		
		Set rscheck=Server.CreateObject("Adodb.Recordset")
		sqlcheck="Select * from Employee where  姓名='"&xingming& "'"
		rscheck.open sqlcheck,conn,1,1
	   	
		TID=rscheck("id")
		
		Set rscheck=Server.CreateObject("Adodb.Recordset")
		sqlcheck="select vname from varset where name='当前人事年度'"
		rscheck.open sqlcheck,conn,1,1
		renshiniandu=rscheck("vname")



set rsgonggao=server.createobject("adodb.recordset")
rsgonggaosql="select * from EmployeeZhengshu where (id is null)" 

rsgonggao.open rsgonggaosql,conn,1,3
rsgonggao.addnew

rsgonggao("TID")=TID
rsgonggao("Tname")=xingming
rsgonggao("leibie")=leibie
rsgonggao("jibie")=jibie
rsgonggao("datetime")=datetime
rsgonggao("shuoming")=shuoming
rsgonggao("发证机关")=fazhengjiguan
rsgonggao("登记日期")=dengjidate
rsgonggao("登记人")=request.cookies("tname")

rsgonggao("学期")=request.cookies("nowxueqi")
rsgonggao("人事年度")=renshiniandu


rsgonggao("filename")=FileObj1.FileName
rsgonggao("fileContentType")=FileObj1.ContentType
rsgonggao("filevalue").appendchunk  FileObj1.Binary
rsgonggao.update


rsgonggao.close


  ' response.redirect   "ZhengSHuList.asp?xingming="&xingming


%>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div align="center">新增数据保存成功！
</div>
<p align="center">&nbsp;</p>
<div align="center">
  <p><a href="ZhengShuList.asp?xingming=<%=xingming%>">返回证书列表</a>
      
      </p>
      </p>
</div>
<p>&nbsp;</p>
</body> 
</html>
