<%
ServerName1=Cstr(Request.ServerVariables("HTTP_REFERER"))
ServerName2=Cstr(Request.ServerVariables("SERVER_NAME"))
If Mid(ServerName1,8,len(ServerName2))<>ServerName2 Then
    Response.Write "路径有误，禁止从网站外部提交表单！"
    response.end
End if
%>
<%
Public Function FilterHtml(Str)
    If Trim(Str) = "" Or IsNull(Str) Then
        FilterHtml=""
    Else
    Str = Replace(Str, ">", "&gt;")
    Str = Replace(Str, "<", "&lt;")
    Str = Replace(Str, Chr(32), "&nbsp;")
    Str = Replace(Str ,Chr(9), "&nbsp;")
    Str = Replace(Str, Chr(34), "&quot;")
    Str = Replace(Str, Chr(39), "&#39;")
    Str = Replace(Str, Chr(13), "")
    Str = Replace(Str, Chr(10) & Chr(10), "</p><p>")
    Str = Replace(Str, Chr(10), "<br> ")
    FilterHtml = Str
    End If
End Function
%>
<!--#include file=byshop_conn.asp-->
<!--#include file="session.asp"-->
<%
action=request("action")
if action="add" then
set rs=server.createobject("adodb.recordset")
sql="select * from build"
rs.open sql,conn,1,3
rs.AddNew
rs("title")=FilterHtml(trim(request.form("title")))'信息标题
rs("address")=FilterHtml(trim(request.form("address")))'楼盘地址
rs("sort")=int(request.form("sort"))'楼盘类型
rs("selladdress")=FilterHtml(trim(request.form("selladdress")))'售楼地址
rs("sellmobile")=FilterHtml(trim(request.form("sellmobile")))'售楼电话

rs("pico")=FilterHtml(trim(request.form("pico")))'远景
rs("pict")=FilterHtml(trim(request.form("pict")))'近景
rs("pics")=FilterHtml(trim(request.form("pics")))'地理位置

rs("tzs")=FilterHtml(trim(request.form("tzs")))'投资商
rs("kfs")=FilterHtml(trim(request.form("kfs")))'开发商
rs("jzs")=FilterHtml(trim(request.form("jzs")))'建筑商
rs("sjdw")=FilterHtml(trim(request.form("sjdw")))'设计单位
rs("wygs")=FilterHtml(trim(request.form("wygs")))'物业公司
rs("xsdl")=FilterHtml(trim(request.form("xsdl")))'销售代理
rs("hxch")=FilterHtml(trim(request.form("hxch")))'行销策划

rs("kptime")=FilterHtml(trim(request.form("kptime")))'开盘时间
rs("rztime")=FilterHtml(trim(request.form("rztime")))'入住时间
rs("zdsize")=FilterHtml(trim(request.form("zdsize")))'占地面积
rs("jzsize")=FilterHtml(trim(request.form("jzsize")))'建筑面积
rs("dfl")=FilterHtml(trim(request.form("dfl")))'得房率
rs("lhl")=FilterHtml(trim(request.form("lhl")))'绿化率
rs("jflx")=FilterHtml(trim(request.form("jflx")))'交房类型

rs("gjxl")=FilterHtml(trim(request.form("gjxl")))'公交线路
rs("supermarket")=FilterHtml(trim(request.form("supermarket")))'超市
rs("bank")=FilterHtml(trim(request.form("bank")))'银行
rs("restaurant")=FilterHtml(trim(request.form("restaurant")))'餐厅
rs("school")=FilterHtml(trim(request.form("school")))'学校
rs("postoffice")=FilterHtml(trim(request.form("postoffice")))'邮局
rs("hospital")=FilterHtml(trim(request.form("hospital")))'医院
rs("other")=FilterHtml(trim(request.form("other")))'其它

if request("xschool")=1 then  '学校
rs("xschool")=1
else
rs("xschool")=0
end if
if request("xnatatorium")=1 then  '游泳池
rs("xnatatorium")=1
else
rs("xnatatorium")=0
end if
if request("xchamber")=1 then  '会所
rs("xchamber")=1
else
rs("xchamber")=0
end if

if request("xhealthfarm")=1 then  '健康中心
rs("xhealthfarm")=1
else
rs("xhealthfarm")=0
end if
if request("xcleaners")=1 then  '洗衣店
rs("xcleaners")=1
else
rs("xcleaners")=0
end if

if request("xznab")=1 then  '智能安保
rs("xznab")=1
else
rs("xznab")=0
end if

if request("xsupermarket")=1 then  '小型超市
rs("xsupermarket")=1
else
rs("xsupermarket")=0
end if

if request("xtenniscourt")=1 then  '网球场
rs("xtenniscourt")=1
else
rs("xtenniscourt")=0
end if
if request("xpart")=1 then  '停车场
rs("xpart")=1
else
rs("xpart")=0
end if
if request("xtelevision")=1 then  '卫星电视
rs("xtelevision")=1
else
rs("xtelevision")=0
end if

if request("xeden")=1 then  '儿童乐园
rs("xeden")=1
else
rs("xeden")=0
end if
if request("xbroadband")=1 then  '宽代接入
rs("xbroadband")=1
else
rs("xbroadband")=0
end if
if request("xbank")=1 then  '银行
rs("xbank")=1
else
rs("xbank")=0
end if

rs("xother")=FilterHtml(trim(request.form("xother")))'其它配置
rs("wyglf")=FilterHtml(trim(request.form("wyglf")))'物业管理费
rs("content")=trim(request.form("content"))'项目介绍
rs("pubsort")=trim(request.form("pubsort"))'发布类型
rs("by_shenhe")=int(request.form("by_shenhe"))'审核
rs("adddate")=now()'添加时间
rs("count")=FilterHtml(request.form("count"))'浏览次数
id=rs("id")
rs("ip")=Request.ServerVariables("REMOTE_ADDR")'发布ＩＰ
rs.Update
rs.Close
  response.write"<SCRIPT language=JavaScript>alert('添加新楼盘成功！');"
   response.write"this.location.href='editbuild.asp?id="&id&"';</SCRIPT>" 
   response.end 
   end if
%>
<%
if action="edit" then
id=trim(request("id"))
if IsNumeric(request.QueryString("id"))=False or request.QueryString("id")="" then
response.write"<SCRIPT language=JavaScript>alert('参数错误！');"
response.end	
end if
set rs=server.createobject("adodb.recordset")
sql="select * from build where id="&id&""
rs.open sql,conn,1,3
rs("title")=FilterHtml(trim(request.form("title")))'信息标题
rs("address")=FilterHtml(trim(request.form("address")))'楼盘地址
rs("sort")=int(request.form("sort"))'楼盘类型
rs("selladdress")=FilterHtml(trim(request.form("selladdress")))'售楼地址
rs("sellmobile")=FilterHtml(trim(request.form("sellmobile")))'售楼电话

rs("pico")=FilterHtml(trim(request.form("pico")))'远景
rs("pict")=FilterHtml(trim(request.form("pict")))'近景
rs("pics")=FilterHtml(trim(request.form("pics")))'地理位置

rs("tzs")=FilterHtml(trim(request.form("tzs")))'投资商
rs("kfs")=FilterHtml(trim(request.form("kfs")))'开发商
rs("jzs")=FilterHtml(trim(request.form("jzs")))'建筑商
rs("sjdw")=FilterHtml(trim(request.form("sjdw")))'设计单位
rs("wygs")=FilterHtml(trim(request.form("wygs")))'物业公司
rs("xsdl")=FilterHtml(trim(request.form("xsdl")))'销售代理
rs("hxch")=FilterHtml(trim(request.form("hxch")))'行销策划

rs("kptime")=FilterHtml(trim(request.form("kptime")))'开盘时间
rs("rztime")=FilterHtml(trim(request.form("rztime")))'入住时间
rs("zdsize")=FilterHtml(trim(request.form("zdsize")))'占地面积
rs("jzsize")=FilterHtml(trim(request.form("jzsize")))'建筑面积
rs("dfl")=FilterHtml(trim(request.form("dfl")))'得房率
rs("lhl")=FilterHtml(trim(request.form("lhl")))'绿化率
rs("jflx")=FilterHtml(trim(request.form("jflx")))'交房类型

rs("gjxl")=FilterHtml(trim(request.form("gjxl")))'公交线路
rs("supermarket")=FilterHtml(trim(request.form("supermarket")))'超市
rs("bank")=FilterHtml(trim(request.form("bank")))'银行
rs("restaurant")=FilterHtml(trim(request.form("restaurant")))'餐厅
rs("school")=FilterHtml(trim(request.form("school")))'学校
rs("postoffice")=FilterHtml(trim(request.form("postoffice")))'邮局
rs("hospital")=FilterHtml(trim(request.form("hospital")))'医院
rs("other")=FilterHtml(trim(request.form("other")))'其它

if request("xschool")=1 then  '学校
rs("xschool")=1
else
rs("xschool")=0
end if
if request("xnatatorium")=1 then  '游泳池
rs("xnatatorium")=1
else
rs("xnatatorium")=0
end if
if request("xchamber")=1 then  '会所
rs("xchamber")=1
else
rs("xchamber")=0
end if

if request("xhealthfarm")=1 then  '健康中心
rs("xhealthfarm")=1
else
rs("xhealthfarm")=0
end if
if request("xcleaners")=1 then  '洗衣店
rs("xcleaners")=1
else
rs("xcleaners")=0
end if

if request("xznab")=1 then  '智能安保
rs("xznab")=1
else
rs("xznab")=0
end if

if request("xsupermarket")=1 then  '小型超市
rs("xsupermarket")=1
else
rs("xsupermarket")=0
end if

if request("xtenniscourt")=1 then  '网球场
rs("xtenniscourt")=1
else
rs("xtenniscourt")=0
end if
if request("xpart")=1 then  '停车场
rs("xpart")=1
else
rs("xpart")=0
end if
if request("xtelevision")=1 then  '卫星电视
rs("xtelevision")=1
else
rs("xtelevision")=0
end if

if request("xeden")=1 then  '儿童乐园
rs("xeden")=1
else
rs("xeden")=0
end if
if request("xbroadband")=1 then  '宽代接入
rs("xbroadband")=1
else
rs("xbroadband")=0
end if
if request("xbank")=1 then  '银行
rs("xbank")=1
else
rs("xbank")=0
end if

rs("xother")=FilterHtml(trim(request.form("xother")))'其它配置
rs("wyglf")=FilterHtml(trim(request.form("wyglf")))'物业管理费
rs("content")=trim(request.form("content"))'项目介绍
rs("pubsort")=trim(request.form("pubsort"))'发布类型
rs("by_shenhe")=int(request.form("by_shenhe"))'审核
rs("count")=int(request.form("count"))'浏览次数
id=rs("id")
rs("ip")=Request.ServerVariables("REMOTE_ADDR")'发布ＩＰ
rs.Update
rs.Close
  response.write"<SCRIPT language=JavaScript>alert('修改新楼盘成功！');"
   response.write"this.location.href='editbuild.asp?id="&id&"';</SCRIPT>" 
   response.end 
end if
%>
 
  