<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Server.ScriptTimeOut=5000
dbs="../"
%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<!--#include file="uc.asp"-->
<!--#include FILE="../inc/UpLoadClass.asp"-->
<!--#include file="../inc/Code2Info.en.asp"-->
<%
	set rs=Server.CreateObject("Adodb.Recordset")
	sql="select id from H_hr where UID="&UID&""
	rs.open sql,conn,1,1
	if not rs.eof then
	response.Write "<script >alert('提示：\n\n对不起，你已经登记过商家了！...');history.back(-1);</script>"
	response.End()
	end if
dim request2 
'建立上传对象
set request2=New UpLoadClass
'设置为手动保存模式
request2.AutoSave=2
'打开对象，默认为 gb2312 字符集，故没有显示设置
request2.Open()
'对象打开结束
H_name=Replace(Replace(Left(request2.Form("H_name"),100),"<","["),">","]")
H_px=Replace(Replace(Left(request2.Form("H_px"),3),"<","["),">","]")
H_Address=Replace(Replace(Left(request2.Form("H_Address"),100),"<","["),">","]")
H_txt=Left(request2.Form("H_txt"),20000)
H_txt=replace(H_txt,"table","表格")
H_txt=replace(H_txt,"TABLE","表格")
H_txt=replace(H_txt,"<tr","表格")
H_txt=replace(H_txt,"<td","表格")
H_txt=replace(H_txt,"</tr","表格")
H_txt=replace(H_txt,"</td","表格")
H_txt=replace(H_txt,"</DIV","表格")
if H_name="" then
response.Write "<script >alert('提示：\n\n对不起，请填写知名企业名称！...');history.back(-1);</script>"
response.End()
end if
if H_Address="" then
response.Write "<script >alert('提示：\n\n对不起，请填写楼盘所的地址！...');history.back(-1);</script>"
response.End()
end if
'图片上传写入
request2.FileType="gif/jpg"
request2.MaxSize=153600000
request2.SavePath="../UpLoadUC/"
if request2.Save("H_pic",0) then
	H_pic=request2.Form("H_pic")
end if
if H_pic="" then
response.Write "<script >alert('提示：\n\n对不起，上传企业标志！...');history.back(-1);</script>"
response.End()
end if
''开始写入数据
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_hr"
	rs.open sql,conn,1,3
	rs.addnew
	rs("UID")=UID
	rs("H_name")=H_name
	rs("H_Address")=H_Address
	rs("H_TXT")=H_TXT
	rs("H_PIC")=H_PIC
	rs("H_Recommend")=0
	rs("H_union")=0
	rs("RDate")=now()
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n登记成功,立即返回...');location.href='hr_edit.asp';</script>"
	response.End()
	'释放上传对象
	set request2=nothing
%>