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


<%
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="xingming" then xingming=BinaryToString(Field.value)
if Field.name="leibie" then leibie=BinaryToString(Field.value)
if Field.name="jibie" then jibie=BinaryToString(Field.value)
if Field.name="datetime" then datetime=BinaryToString(Field.value)
if Field.name="shuoming" then shuoming=BinaryToString(Field.value)
if Field.name="fazhengjiguan" then fazhengjiguan=BinaryToString(Field.value)
if Field.name="dengjidate" then dengjidate=BinaryToString(Field.value)

if Field.name="file1" then
filename=field.FileName

fileContentType=field.ContentType
filevalue=field.value
end if
next


 

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
	    if  rscheck.eof and  rscheck.bof then
	      response.redirect   "FindError.asp?tname="&xingming
	    end if 
		
		TID=rscheck("id")



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("leibie")=leibie
rsgonggao("jibie")=jibie
rsgonggao("datetime")=datetime
rsgonggao("shuoming")=shuoming
rsgonggao("发证机关")=fazhengjiguan
rsgonggao("登记日期")=dengjidate
rsgonggao("登记人")=request.cookies("tname")


rsgonggao("filename")=filename
rsgonggao("fileContentType")=fileContentType
rsgonggao("filevalue").appendchunk filevalue
rsgonggao.update









rsgonggao.close


response.redirect   "ZhengSHuList.asp?id="&Tid
end if%>



