<!--#include file="CommonCode.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005－2009 佛山市动易网络科技有限公司 版权所有
'**************************************************************

Dim rsHouse
Dim sqlstr, rsItemHouse, HouseDiZhi, HouseMianJi, HouseHuXing, HouseChanQuan, HouseJianCheng, HouseLouCeng, HouseLeiXing, HouseChaoXiang, HouseSheShi, HouseZhuangXiu, HouseDianQi, HouseGongJia, HouseHuanJing, JiaoFangStartDate, TotalPrice, ContactName, ContactEmail, ContactPhone, ContactQQ, HouseQiTa, Editor, UpdateTime, Hits, HouseJiChu, HouseWeiSheng, HouseJiaJu, HouseXinXi, HouseZuJin, HouseZuJin1, HouseZuJin2, HouseJianCheng1, HouseJianCheng2, HouseMianJi1, HouseMianJi2, HouseZhiFu, HousePriceType, HousePrice1, HousePrice2, HouseXingZhi, ZuLinStartDate, ZuLinEndDate, HouseZuJinType, My, Chum, HouseHuXing1, HouseHuXing2, HeZhuType, HouseShuiDian, HouseTableName, OtherPrice, ShuiFei

Select Case ClassID
Case 1
    HouseTableName = "PE_HouseCS"
    strHtml = GetTemplate(ChannelID, 30, DefaultItemTemplate)
Case 2
    HouseTableName = "PE_HouseCZ"
    strHtml = GetTemplate(ChannelID, 31, DefaultItemTemplate)
Case 3
    HouseTableName = "PE_HouseQG"
    strHtml = GetTemplate(ChannelID, 32, DefaultItemTemplate)
Case 4
    HouseTableName = "PE_HouseQZ"
    strHtml = GetTemplate(ChannelID, 33, DefaultItemTemplate)
Case 5
    HouseTableName = "PE_HouseHZ"
    strHtml = GetTemplate(ChannelID, 34, DefaultItemTemplate)
End Select
Conn.Execute ("Update " & HouseTableName & " set Hits=Hits+1 where HouseID=" & HouseID & "")

sqlstr = "select Hits,Hot from " & HouseTableName & " where HouseID=" & HouseID & ""
Set rsItemHouse = Server.CreateObject("adodb.recordset")
rsItemHouse.Open sqlstr, Conn, 1, 3
If rsItemHouse.EOF Then
    FoundErr = True
    Response.Write "<li>找不到记录</li>"
    Response.End
End If

If Not rsItemHouse.EOF And rsItemHouse(0) >= HitsOfHot Then
    rsItemHouse("Hot") = PE_True
    rsItemHouse.Update
End If
rsItemHouse.Close
Set rsItemHouse = Nothing
Set rsHouse = Conn.Execute("select * from " & HouseTableName & " where HouseID=" & HouseID & "")
strPageTitle = rsHouse("HouseDiZhi")
HouseDiZhi = PE_HTMLEncode(rsHouse("HouseQuYu") & rsHouse("HouseDiZhi"))
If rsHouse("ViewAll") = True And ClassID <> 3 And ClassID <> 4 Then
    HouseDiZhi = HouseDiZhi & PE_HTMLEncode(rsHouse("HouseXiangXiDiZhi"))
Else
    If ClassID <> 3 And ClassID <> 4 Then
        HouseDiZhi = HouseDiZhi & "<font color=red>（详细地址请向本站咨询）</font>"
    End If
End If
HouseHuXing = Replace(rsHouse("HouseHuXing"), ",", "")
If ClassID = 1 Or ClassID = 2 Or ClassID = 5 Then HouseMianJi = rsHouse("HouseMianJi")
If ClassID = 1 Then
    HouseChanQuan = rsHouse("HouseChanQuan") & ""
    HouseJianCheng = rsHouse("HouseJianCheng") & ""
    TotalPrice = rsHouse("TotalPrice")
    HouseShuiDian = rsHouse("HouseShuiDian") & ""
    OtherPrice = rsHouse("OtherPrice")
    ShuiFei = rsHouse("ShuiFei") & ""
End If
If ClassID = 2 Or ClassID = 5 Then
    HouseZuJin = rsHouse("HouseZuJin")
    If rsHouse("HouseZuJinType") = "价格面议" Then
        HouseZuJin = ""
    End If
End If
If ClassID = 3 Then
    HouseJianCheng1 = rsHouse("HouseJianCheng1")
    HouseJianCheng2 = rsHouse("HouseJianCheng2")
    HouseXingZhi = rsHouse("HouseXingZhi")
    HousePrice1 = rsHouse("HousePrice1")
    HousePrice2 = rsHouse("HousePrice2")
End If
If ClassID = 3 Or ClassID = 4 Or ClassID = 5 Then
    HouseMianJi1 = rsHouse("HouseMianJi1")
    If HouseMianJi1 = 0 Then HouseMianJi1 = "不详"
    HouseMianJi2 = rsHouse("HouseMianJi2")
    If HouseMianJi2 = 0 Then HouseMianJi2 = "不详"
End If
If ClassID = 1 Or ClassID = 3 Then
    HousePriceType = PE_HTMLEncode(rsHouse("HousePriceType"))
    HouseChaoXiang = rsHouse("HouseChaoXiang") & ""
    JiaoFangStartDate = rsHouse("JiaoFangStartDate")
End If
If ClassID = 4 Then

    HouseZuJin1 = rsHouse("HouseZuJin1")
    HouseZuJin2 = rsHouse("HouseZuJin2")
    If rsHouse("HouseZuJinType") = "价格面议" Then
        HouseZuJin1 = ""
        HouseZuJin2 = ""
    End If
End If
If ClassID = 2 Or ClassID = 4 Or ClassID = 5 Then
    HouseWeiSheng = rsHouse("HouseWeiSheng") & ""
    HouseZuJinType = rsHouse("HouseZuJinType")
    HouseXinXi = rsHouse("HouseXinXi") & ""
End If
If ClassID = 4 Or ClassID = 5 Or ClassID = 2 Then
    ZuLinStartDate = PE_HTMLEncode(rsHouse("ZuLinStartDate"))
    ZuLinEndDate = PE_HTMLEncode(rsHouse("ZuLinEndDate"))
End If
HouseLouCeng = Replace(PE_HTMLEncode(rsHouse("HouseLouCeng")), ",", "")
HouseLeiXing = rsHouse("HouseLeiXing")
HouseSheShi = rsHouse("HouseJiChu") & ""
If Trim(rsHouse("HouseZhuangXiu")) = "," Then
    HouseZhuangXiu = ""
Else
    HouseZhuangXiu = PE_HTMLEncode(rsHouse("HouseZhuangXiu"))
End If
If ClassID = 1 Or ClassID = 2 Or ClassID = 5 Then
    HouseGongJia = PE_HTMLEncode(rsHouse("HouseGongJiaoLu")) & " 路  " & PE_HTMLEncode(rsHouse("HouseGongJiaoZhan")) & " 站"
End If
If ClassID <> 3 Then
    HouseDianQi = PE_HTMLEncode(rsHouse("HouseDianQi"))
    HouseJiaJu = PE_HTMLEncode(rsHouse("HouseJiaJu"))
End If
If ClassID = 5 Then
    HeZhuType = rsHouse("HeZhuType")
    HouseHuXing1 = PE_HTMLEncode(rsHouse("HouseHuXing1"))
    HouseHuXing2 = PE_HTMLEncode(rsHouse("HouseHuXing2"))
    My = PE_HTMLEncode(rsHouse("HouseJianJie"))
    Chum = PE_HTMLEncode(rsHouse("HouseShiYou"))
End If
HouseZhiFu = PE_HTMLEncode(rsHouse("HouseZhiFu"))
HouseHuanJing = PE_HTMLEncode(rsHouse("HouseShiZheng"))
ContactPhone = rsHouse("ContactPhone")
ContactName = rsHouse("ContactName")
ContactEmail = rsHouse("ContactEmail")
ContactQQ = rsHouse("ContactQQ")
HouseQiTa = rsHouse("HouseQiTa")
Editor = rsHouse("Editor")
UpdateTime = rsHouse("UpdateTime")
Hits = rsHouse("Hits")
SkinID = DefaultItemSkin
strHtml = Replace(strHtml, "{$HouseID}", HouseID)
Call ReplaceCommonLabel
strHtml = Replace(strHtml, "{$Editor}", Editor)
strHtml = Replace(strHtml, "{$UpdateTime}", FormatDateTime(rsHouse("UpdateTime"), 2))
strHtml = Replace(strHtml, "{$Hits}", Hits)
strHtml = Replace(strHtml, "{$PageTitle}", strPageTitle)
strHtml = Replace(strHtml, "{$ShowPath}", ShowPath() & " >> 详细信息")
strHtml = Replace(strHtml, "{$HeZhuType}", HeZhuType)
strHtml = Replace(strHtml, "{$HouseDiZhi}", HouseDiZhi)
strHtml = Replace(strHtml, "{$My}", My)
strHtml = Replace(strHtml, "{$Chum}", Chum)
strHtml = Replace(strHtml, "{$HouseHuXing}", HouseHuXing)
strHtml = Replace(strHtml, "{$HouseHuXing1}", HouseHuXing1)
strHtml = Replace(strHtml, "{$HouseHuXing2}", HouseHuXing2)
strHtml = Replace(strHtml, "{$HouseXingZhi}", HouseXingZhi)
strHtml = Replace(strHtml, "{$HouseChanQuan}", HouseChanQuan)
strHtml = Replace(strHtml, "{$HouseJianCheng}", HouseJianCheng)
strHtml = Replace(strHtml, "{$HouseJianCheng1}", HouseJianCheng1)
strHtml = Replace(strHtml, "{$HouseJianCheng2}", HouseJianCheng2)
strHtml = Replace(strHtml, "{$HouseMianJi}", HouseMianJi)
strHtml = Replace(strHtml, "{$HouseMianJi1}", HouseMianJi1)
strHtml = Replace(strHtml, "{$HouseMianJi2}", HouseMianJi2)
strHtml = Replace(strHtml, "{$HouseLouCeng}", HouseLouCeng)
strHtml = Replace(strHtml, "{$HouseLeiXing}", HouseLeiXing)
strHtml = Replace(strHtml, "{$HouseChaoXiang}", HouseChaoXiang)
strHtml = Replace(strHtml, "{$HouseShuiDian}", HouseShuiDian)
strHtml = Replace(strHtml, "{$HouseSheShi}", HouseSheShi)
strHtml = Replace(strHtml, "{$HouseZhuangXiu}", HouseZhuangXiu)
strHtml = Replace(strHtml, "{$HouseDianQi}", HouseDianQi)
strHtml = Replace(strHtml, "{$HouseGongJia}", HouseGongJia)
strHtml = Replace(strHtml, "{$HouseHuanJing}", HouseHuanJing)
strHtml = Replace(strHtml, "{$JiaoFangStartDate}", JiaoFangStartDate)
strHtml = Replace(strHtml, "{$HousePrice1}", HousePrice1)
strHtml = Replace(strHtml, "{$HousePrice2}", HousePrice2)
strHtml = Replace(strHtml, "{$HouseZuJin1}", HouseZuJin1)
strHtml = Replace(strHtml, "{$HouseZuJin2}", HouseZuJin2)
strHtml = Replace(strHtml, "{$HouseZhiFu}", HouseZhiFu)
If OtherPrice <> 0 And ShuiFei <> "" Then
    strHtml = Replace(strHtml, "{$TotalPrice}", TotalPrice & HousePriceType & ", 其中家电装修折价" & OtherPrice & "万元, 卖方交易税费由" & ShuiFei)
ElseIf OtherPrice = 0 And ShuiFei <> "" Then
    strHtml = Replace(strHtml, "{$TotalPrice}", TotalPrice & HousePriceType & ", 卖方交易税费由" & ShuiFei)
ElseIf OtherPrice <> 0 And ShuiFei = "" Then
    strHtml = Replace(strHtml, "{$TotalPrice}", TotalPrice & HousePriceType & ", 其中家电装修折价" & OtherPrice & "万元")
Else
    strHtml = Replace(strHtml, "{$TotalPrice}", TotalPrice & HousePriceType)
End If
If ClassID = 1 Then
    strHtml = Replace(strHtml, "{$HousePriceType}", "")
Else
    strHtml = Replace(strHtml, "{$HousePriceType}", HousePriceType)
End If
strHtml = Replace(strHtml, "{$HouseZuJinType}", HouseZuJinType)
strHtml = Replace(strHtml, "{$ZuLinStartDate}", ZuLinStartDate)
strHtml = Replace(strHtml, "{$ZuLinEndDate}", ZuLinEndDate)
strHtml = Replace(strHtml, "{$ContactPhone}", ContactPhone)
strHtml = Replace(strHtml, "{$ContactName}", ContactName)
strHtml = Replace(strHtml, "{$ContactEmail}", ContactEmail)
strHtml = Replace(strHtml, "{$ContactQQ}", ContactQQ)
strHtml = Replace(strHtml, "{$HouseQiTa}", HouseQiTa)
strHtml = Replace(strHtml, "{$HouseWeiSheng}", HouseWeiSheng)
strHtml = Replace(strHtml, "{$HouseJiaJu}", HouseJiaJu)
strHtml = Replace(strHtml, "{$HouseXinXi}", HouseXinXi)
strHtml = Replace(strHtml, "{$HouseZuJin}", HouseZuJin)
rsHouse.Close
Set rsHouse = Nothing
Response.Write strHtml
%>
