<!-- #include file="skin.asp" -->
<!-- #include file="jk_nsort.asp" -->
<!-- #include file="jk_page_cute.asp" -->
<%
dim pageurl,nummer,sqladd,page,rssum,thepages,viewpage,id,c_id,username,keyword,sea_type,types
nummer=5
rssum=0
n_sort="house"
index_url="house"
tit_fir=format_menu(index_url)
id=trim(request.querystring("id"))
c_id=trim(request.querystring("c_id"))
if not(isnumeric(id)) then id=0
call cid_sid()
keyword=joekoe_cms.code_form(request.querystring("keyword"))
sea_type=trim(request.querystring("sea_type"))
types=trim(request.querystring("types"))
m_channel=index_url
web_img_m="m_"&m_channel
web_img_h="h_"&m_channel

sub house_put()
  response.write "<table border=0 width='98%' cellspacing=0 cellpadding=4 align=center>" & _
	    vbcrlf& "<tr><td height=10 width='98%'></td></tr>" & _
	    vbcrlf& "<tr><td align=center><a href='user_put.asp?action=house'><img src='images/house/house_put.gif' alt='发布房源信息' border=0></a></td></tr>" & _
	    vbcrlf& "<tr><td height=7 width='98%'></td></tr>" & _
	    vbcrlf& "</table>"
end sub

sub house_view()
  call joekoe_cms.exec("update house set counter=counter+1 where id="&id,0)
  sql="select * from house where id="&id
  set rs=joekoe_cms.exec(sql,1)
%>
<table cellspacing=1 cellpadding=4>
<tr><td class=bg_td align=center>
  <table border=0 width='100%' class=tf>
  <tr><td class=bw align=center><b><font size=3 class=blue><font color=red><%if c_id="98" then response.write " [房屋出租]"%><%if c_id="99" then response.write " [房屋求租]"%><%if c_id="100" then response.write " [房屋出售]"%><%if c_id="101" then response.write " [房屋购买]"%><%if c_id="102" then response.write " [房屋转让]"%><%if c_id="103" then response.write " [其它房源]"%></font><%response.write rs("name")%></b></font></td></tr>
  </table>
</td></tr>
<tr><td height=1 background='images/bg_dian.gif'></td></tr>
<tr><td class=bg_td align=center>
  <table border=0 width='100%'>
  <tr>
  <td width='25%' valign=top><%response.write pic_fk(rs("pic"),1,"")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;房源图片</td>
 <td width='75%' valign=top>
    <table border=0 width='98%' class=tf>
	<tr>
              <td width='60%'>房源地址：<font class=red><%=rs("name")%></font></td>
              <td width='40%'>房源性质： <font class=red><%=rs("types")%></td>
            </tr>
             <tr>
              <td width='60%'>设施设备：<font class=red><%=rs("fname")%></font></td>
              <td width='40%'>房 价：<font class=red><%=rs("price")%> </td>
            </tr>
			<tr>
              <td width='60%'>有效时间：<font class=red><%=rs("sname")%></font>天</td>
              <td width='40%'>楼 层：<font class=red><%=rs("yname")%></td>
            </tr>
			<tr>
              <td width='60%'>物业类型：<font class=red><%=rs("dname")%></font></td>
              <td width='40%'>建筑面积：<font class=red><%=rs("url")%></font></td>
            </tr>
			<tr>
              <td width='60%'></td>
              <td width='40%'>发布时间： <%response.write joekoe_cms.time_type(rs("tim"),4)%></td>
            </tr>
    </table>
    <table border=0 width='98%' class=tf>
    <tr><td class=bw><font class=htd><%response.write joekoe_cms.code_html(rs("remark"),2,0)%></font></td></tr>
    </table>
    <table border=0 width='98%'>
    <tr><td height=30 align=right valign=bottom class=gray>（该信息已被浏览：<%=rs("counter")%>次）</td></tr>
    </table>
  </td>
  </tr>
  </table>
</td></tr>
<tr><td class=td>&nbsp;<%response.write img_skin(web_img_m)%>联系信息（<a href='user_mail.asp?action=msg_write&accept=<%=rs("username")%>' class=ftd target=_blank>短信联系</a>）</td></tr>
<%
if var_null(login_username)="" then
response.write "<tr><td height=40 class=bg_td align=center>"&web_nologin&"</td></tr>"
else
%>
<tr><td class=bg_td align=right>
  <table border=0 width='99%' class=tf>
  <tr>
        <td colspan=2>联系地址：<%=rs("address")%></td>
      </tr>
   <tr><td>邮政编码：<%=rs("yzbm")%></td><td>发 布 人：<a href='user_view.asp?username=<%=rs("username")%>'alt='查看 <%=rs("username")%> 详细信息' target=_blank><%=rs("username")%></td></tr>
  <tr><td>联 系 人：<%=rs("nname")%></td><td>联系电话：<%=rs("phone")%></td></tr>
  <tr><td>电子邮件：<a href='mailto:<%=rs("email")%>'><%=rs("email")%></a></td><td></td></tr>
  </table>
</td></tr>
<%
end if
rs.close
%>

<tr><td class=td>&nbsp;<%response.write img_skin(web_img_m)%>相关评论</td></tr>
</table>
<%
end sub

sub house_list_type()
dim t_color:t_color=" class=tims"
if DateDiff("d",rs("tim"),joekoe_cms.now_time)<3 then t_color=" class=blue"
if DateDiff("d",rs("tim"),joekoe_cms.now_time)<1 then t_color=" class=red"
%>
<tr><td colspan=2 height=23  background="images/house/bar.gif">
<table border=0 cellspacing=0 cellpadding=0 width='100%'>
<tr><td>&nbsp;
<%response.write img_skin(web_img_h)%>
<b>&nbsp;<a href="house_view.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&id=<%=rs("id")%>" target=_blank><%response.write rs("name")%></a></b><%if rs("pic")<>"" then response.write "&nbsp;<img border=0 src='"&joekoe_cms.web_dir_skin&"small/img.gif' align=absmiddle alt='有图片'>"%></td>
<td align=right class=tims><font<%response.write t_color%>><%response.write joekoe_cms.time_type(rs("tim"),4)%></font>&nbsp;&nbsp;</td></tr>
    </table>
  </td></tr>
  <tr><td colspan=2 align=center class=bg_td>
    <table border=0 width='99%' class=bw>
    <tr><td class=tf><font class=htd><%response.write joekoe_cms.code_html(rs("remark"),1,150)%> <font class=gray>[<a href='javascript:;' onclick="javascript:open_view('house_view.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&id=<%=rs("id")%>',1);" alt='点击浏览更详细的房屋信息'>详细房屋信息</a>]</font></font></td></tr>
    </table>
  </td></tr>
  <tr class=bg><td colspan=2 align=center>
    <table border=0 width='99%'>
    <tr>
 <td align=right>联系人：<a href='user_view.asp?username=<%=rs("username")%>'alt='查看 <%=rs("username")%> 详细信息' target=_blank><%=rs("nname")%></a>&nbsp;
 <%if var_null(login_username)="" then%>
 <font class=gray>注册登陆后查看更详细的房屋信息</font>
 <%else%>
 电子邮件：<a href='mailto:<%=rs("email")%>'><%=rs("email")%></a>&nbsp;电话：<%=rs("phone")%>
 <%end if%>
 </td></tr>
</table></td></tr>
<tr><td background="images/bg_dian.gif" height=1></td></tr>
<%
end sub

sub house_main(f_title,ft,c_num,f_num)
dim i,ii:ii=0
  select case ft
  case "hot"
    sql=" order by counter desc,id desc"
  case "good"
    sql=" and isgood=1 order by id desc"
  case else
    sql=" order by id desc"
  end select
%>
<table class=table>
<tr><td class=td>&nbsp;<%response.write img_skin(web_img_m)%>&nbsp;<%response.write f_title%></td></tr>
<tr class=bg_td><td>
<table border=0 cellspacing=0 cellpadding=2 width='100%'>
<%
  sql="select top "&c_num&" id,c_id,name,counter from house where hidden=1"&sql
  set rs=joekoe_cms.exec(sql,1)
  do while not rs.eof 
  response.write "<tr>"
  for i=1 to 2
  if rs.eof then exit for
%>
<td>
<%response.write img_skin(web_img_h)%>
<a href="house_view.asp?c_id=<%response.write rs("c_id")%>&s_id=<%response.write sid%>&id=<%response.write rs("id")%>" alt='<%response.write joekoe_cms.code_js(joekoe_cms.code_html(rs("name"),1,0),1)%>' target=_blank>
<%response.write joekoe_cms.code_js(joekoe_cms.code_html(rs("name"),1,f_num),1)%></a></td>
<%
  ii=ii+1
  rs.movenext
  next
  response.write "</tr>"
  loop
  rs.close
%>
<table border=0 cellspacing=0 cellpadding=0 width='100%'>
<tr><td align=right><a href="house_list.asp?action=<%response.write ft%>">浏览更多…</a>&nbsp;</td></tr>
</table></td></tr></table>
<%
end sub

sub house_search()
%>
<table cellspacing=1 cellpadding=2 width='98%'>
<tr><td width=288 height=25 align=left background='<%response.write joekoe_cms.web_dir_skin%>/bg_td.gif' border=0><b><font color="#000000">&nbsp;<img src='<%response.write joekoe_cms.web_dir_skin%>small/m_house.gif'> 房源搜索</font></b></td></tr>
</table>
      <table cellspacing=0 cellpadding=2 width="100%" border=0 class=bg_td>
        <tr align=middle>
		<td><img src='<%response.write joekoe_cms.web_dir_skin%>small/new.gif'></td>
<td>关键字：</td>
<form name=house_sea_frm action='house_list.asp?' method=get>
<input type=hidden name=c_id value='<%response.write cid%>'>
<input type=hidden name=s_id value='<%response.write sid%>'>
<input type=hidden name=action value='<%response.write action%>'>
<input type=hidden name=types value='<%response.write types%>'>
<td>
<input type=text name=keyword value='<%response.write keyword%>' size=12 maxlength=20></td>
<td><select name=sea_type size=1> 
<option value='name'<%if sea_type="name" then response.write " selected"%> selected>房源名称</option>
                <option value='dname'<%if sea_type="dname" then response.write " selected"%>>所在地区</option>
                <option value='types'<%if sea_type="types" then response.write " selected"%>>房源性质</option>
                <option value='username'<%if sea_type="username" then response.write " selected"%>>发布用户</option>
                <option value='phone'<%if sea_type="phone" then response.write " selected"%>>联系电话</option>
                <option value='url'<%if sea_type="url" then response.write " selected"%>>联系地址</option>
                <option value='email'<%if sea_type="email" then response.write " selected"%>>电子邮件</option>
                <option value='remark'<%if sea_type="remark" then response.write " selected"%>>房源说明</option>
</select></td>
<td><input type=submit value='搜索' onclick="javascript:return house_sea();">&nbsp;</td></form>
<td><select onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
<option value='house_list.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&action=new&types=<%response.write types%>&keyword=<%response.write keyword%>&sea_type=<%response.write sea_type%>'<%if action="" then response.write " selected"%>>默认排序</option>
<option value='house_list.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&action=counter&types=<%response.write types%>&keyword=<%response.write keyword%>&sea_type=<%response.write sea_type%>'<%if action="counter" then response.write " selected"%>>人气排序</option>
<option value='house_list.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&action=tim&types=<%response.write types%>&keyword=<%response.write keyword%>&sea_type=<%response.write sea_type%>'<%if action="tim" then response.write " selected"%>>时间排序</option>
<option value='house_list.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&action=id&types=<%response.write types%>&keyword=<%response.write keyword%>&sea_type=<%response.write sea_type%>'<%if action="id" then response.write " selected"%>>先后排序</option>
<option value='house_list.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&action=hot&types=<%response.write types%>&keyword=<%response.write keyword%>&sea_type=<%response.write sea_type%>'<%if action="id" then response.write " selected"%>>热门房源</option>
<option value='house_list.asp?c_id=<%response.write cid%>&s_id=<%response.write sid%>&action=good&types=<%response.write types%>&keyword=<%response.write keyword%>&sea_type=<%response.write sea_type%>'<%if action="id" then response.write " selected"%>>推荐房源</option>
</select></td></tr></table>
<script language=javascript>
<!--
function house_sea()
{
  if (document.house_sea_frm.keyword.value=="")
  {
    alert("搜索前请先输入要查询的 关键字 ！");
    return false;
  }
}
-->
</script>
<%
end sub

sub house_list()
pageurl="?c_id="&cid&"&s_id="&sid&"&action="&action&"&"
if types<>"" then
   pageurl=pageurl&"types="&types&"&"
   if types="0" then
      types="行政机关"
   else
   end if
  if types="1" then
      types="社会团体"
   else
   end if
 if types="2" then
      types="事业单位"
   else
   end if
if types="3" then
      types="国有房源"
   else
   end if
if types="4" then
      types="三资房源"
   else
   end if
if types="5" then
      types="集体房源"
   else
   end if
if types="6" then
      types="乡镇房源"
   else
   end if
if types="7" then
      types="私营房源"
   else
   end if
sqladd=sqladd&" and types='"&types&"'"
end if

call cid_sid_sql(2,sea_type)

sql="select * from house where hidden=1"&sqladd
select case action
case "counter"
  sql=sql&" order by counter desc,id desc"
case "tim"
  sql=sql&" order by tim desc"
case "id"
  sql=sql&" order by id"
case "hot"
  sql=sql&" order by counter desc,id desc"
case "good"
  sql=sql&" and isgood=1 order by id desc"
case else
  sql=sql&" order by id desc"
end select

set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
  rssum=rs.recordcount
end if
call format_pagecute()

response.write "<table border=0 width='100%'><tr><td class=td>&nbsp;"&img_skin(web_img_m)&""
response.write"房源列表</td></tr>"

if int(viewpage)>1 then
  rs.move (viewpage-1)*nummer
end if
for i=1 to nummer
  if rs.eof then exit for
  dim nid,name
  nid=rs("id"):name=rs("name")

  call house_list_type()

  rs.movenext
next
rs.close:set rs=nothing
%>
<tr><td class=bg_tds height=30>
  <table border=0 width='100%' cellspacing=1 cellpadding=4 class=bg_2>
  <tr valign=bottom><td width='50%'>共有<font class=red><%response.write rssum%></font>个房源，每页<font class=red><%response.write nummer%></font>个，页次：<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font></td>
  <td align=right><%response.write pagecute_fun(viewpage,thepages,pageurl)%></td></tr>
  </table>
  <table border=0 width='100%' cellspacing=0 cellpadding=4 class=bg_td>
  <tr><td colspan=2 class=td>&nbsp;<%response.write img_skin(web_img_m)%>房源列表说明</td></tr>
  <tr>
  <td colspan=2><%response.write joekoe_cms.js_put("document.write(img_skin('h_'));",1)%>标有<img border=0 src='<%response.write joekoe_cms.web_dir_skin%>small/img.gif' align=absmiddle>&nbsp;表示该房源有图片说明， 联系方式以及部分功能要 <a href='register.asp'>注册</a> 并 <a href='login.asp'>登陆</a> 才可正常浏览和使用！</td></tr>
  <tr><td colspan=2><%response.write joekoe_cms.js_put("document.write(img_skin('h_'));",1)%>时间颜色说明： <font class=red><%response.write joekoe_cms.time_type(joekoe_cms.now_time,4)%></font> 表示今天发布的房源信息， <font class=blue><%response.write joekoe_cms.time_type(DateAdd("d", -3, joekoe_cms.now_time),4)%></font> 表示三天内发布的房源信息。</td>
  </tr>
</table>
</table>
<%
end sub
%>
<%
sub house_nsort()
%>
<table cellspacing=1 cellpadding=4 width='100%'>
<tr><td width=288 height=25 align=left background='<%response.write joekoe_cms.web_dir_skin%>/bg_td.gif' border=0><b><font color="#000000">&nbsp;<img src='<%response.write joekoe_cms.web_dir_skin%>small/m_house.gif'> 房源发布</font></b></td></tr></table>
<table cellspacing=1 cellpadding=2>

</td></tr></table>
<%
end sub
%>
<%
sub house_left_qyjz()
%>
<table cellspacing=1 cellpadding=2 width='100%'>
<tr><td width=288 height=25 align=left background='<%response.write joekoe_cms.web_dir_skin%>/bg_td.gif' border=0><b><font color="#000000">&nbsp;<img src='<%response.write joekoe_cms.web_dir_skin%>small/m_house.gif'> 房源类别</font></b></td></tr>
 <tr><td align="center"><img src='<%response.write joekoe_cms.web_dir_skin%>small/top_house.gif'>&nbsp;&nbsp;<a href="house_list.asp?c_id=98&s_id=0"<%if c_id="98" then response.write " class=red"%>>房屋出租</a></td></tr>
 <tr><td align="center"><img src='<%response.write joekoe_cms.web_dir_skin%>small/top_house.gif'>&nbsp;&nbsp;<a href="house_list.asp?c_id=99&s_id=0"<%if c_id="99" then response.write " class=red"%>>房屋求租</a></td></tr>
 <tr><td align="center"><img src='<%response.write joekoe_cms.web_dir_skin%>small/top_house.gif'>&nbsp;&nbsp;<a href="house_list.asp?c_id=100&s_id=0"<%if c_id="100" then response.write " class=red"%>>房屋出售</a></td></tr>
 <tr><td align="center"><img src='<%response.write joekoe_cms.web_dir_skin%>small/top_house.gif'>&nbsp;&nbsp;<a href="house_list.asp?c_id=101&s_id=0"<%if c_id="101" then response.write " class=red"%>>房屋购买</a></td></tr>
 <tr><td align="center"><img src='<%response.write joekoe_cms.web_dir_skin%>small/top_house.gif'>&nbsp;&nbsp;<a href="house_list.asp?c_id=102&s_id=0"<%if c_id="102" then response.write " class=red"%>>房屋转让</a></td></tr>
 <tr><td align="center"><img src='<%response.write joekoe_cms.web_dir_skin%>small/top_house.gif'>&nbsp;&nbsp;<a href="house_list.asp?c_id=103&s_id=0"<%if c_id="103" then response.write " class=red"%>>其它房源</a></td></tr>
 <tr><td align="center"><img src='<%response.write joekoe_cms.web_dir_skin%>small/top_house.gif'>&nbsp;&nbsp;<a href="house_list.asp"<%if types="" then response.write " class=red"%>>所有信息</a></td></tr>
 </table>
<%
end sub
%>