HS_Tenancy_Search_Result.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:13k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <!--#include file="../lib/strlib.asp" -->
  6. <!--#include file="../lib/UserCheck.asp" -->
  7. <!--#include file="../../FS_Inc/Func_Page.asp" -->
  8. <%'Copyright (c) 2006 Foosun Inc. Code by awen
  9. Response.Buffer = True
  10. Response.Expires = -1
  11. Response.ExpiresAbsolute = Now() - 1
  12. Response.Expires = 0
  13. Response.CacheControl = "no-cache"
  14. Dim Hs_Rs
  15. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
  16. int_RPP=15 '设置每页显示数目
  17. int_showNumberLink_=10 '数字导航显示数目
  18. showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
  19. str_nonLinkColor_="#999999" '非热链接颜色
  20. toF_="<font face=webdings>9</font>"    '首页 
  21. toP10_=" <font face=webdings>7</font>" '上十
  22. toP1_=" <font face=webdings>3</font>" '上一
  23. toN1_=" <font face=webdings>4</font>" '下一
  24. toN10_=" <font face=webdings>8</font>" '下十
  25. toL_="<font face=webdings>:</font>" '尾页
  26. ''得到相关表的值。
  27. Function Get_OtherTable_Value(This_Fun_Sql)
  28. Dim This_Fun_Rs
  29. if instr(This_Fun_Sql," FS_ME_")>0 then 
  30. set This_Fun_Rs = User_Conn.execute(This_Fun_Sql)
  31. else
  32. set This_Fun_Rs = Conn.execute(This_Fun_Sql)
  33. end if
  34. if not This_Fun_Rs.eof then 
  35. Get_OtherTable_Value = This_Fun_Rs(0)
  36. else
  37. Get_OtherTable_Value = ""
  38. end if
  39. if Err.Number>0 then 
  40. Err.Clear
  41. response.Redirect("../lib/error.asp?ErrCodes=<li>Get_OtherTable_Value未能得到相关数据。错误描述:"&Err.Description&"</li>") : response.End()
  42. end if
  43. set This_Fun_Rs=nothing 
  44. End Function
  45.   
  46. Function Get_While_Info(Add_Sql)
  47. Add_Sql = Decrypt(Add_Sql)
  48. Dim Get_Html,This_Fun_Sql,ii,Str_Tmp,Arr_Tmp,New_Search_Str,Req_Str,regxp
  49. Str_Tmp = "TID,HouseStyle,PubDate,Audited,UseFor,Class,Position,CityArea,Price,HouseStyle,Area,Floor,BuildDate,equip,Decoration,LinkMan,Contact,Period,Remark"
  50. This_Fun_Sql = "select "&Str_Tmp&" from FS_HS_Tenancy"
  51. Arr_Tmp = split(Str_Tmp,",")
  52. for each Str_Tmp in Arr_Tmp
  53. Req_Str = NoSqlHack(Trim(request(Str_Tmp)))
  54. if Req_Str<>"" then 
  55. select case Str_Tmp
  56. case "TID","UseFor","Class","Price","Area","BuildDate","PubDate","Audited","PicNumber","isRecyle"
  57. ''数字,日期
  58. regxp = "|<|>|=|<=|>=|<>|"
  59. if instr(regxp,"|"&left(Req_Str,1)&"|")>0 or instr(regxp,"|"&left(Req_Str,2)&"|")>0 then 
  60. New_Search_Str = and_where( New_Search_Str ) & Str_Tmp &" "& Req_Str
  61. elseif instr(Req_Str,"*")>0 then 
  62. if left(Req_Str,1)="*" then Req_Str = "%"&mid(Req_Str,2)
  63. if right(Req_Str,1)="*" then Req_Str = mid(Req_Str,1,len(Req_Str) - 1) & "%"
  64. New_Search_Str = and_where( New_Search_Str ) & Str_Tmp &" like '"& Req_Str &"'"
  65. else
  66. New_Search_Str = and_where( New_Search_Str ) & Str_Tmp &" = "& Req_Str
  67. end if
  68. case else
  69. ''字符
  70. New_Search_Str = and_where(New_Search_Str) & Search_TextArr(Req_Str,Str_Tmp,"")
  71. end select 
  72. end if
  73. next
  74. if New_Search_Str<>"" then This_Fun_Sql = and_where(This_Fun_Sql) & replace(New_Search_Str," where ","")
  75. if instr(Add_Sql,"filterorderby")>0 then 
  76. This_Fun_Sql = This_Fun_Sql &"  "& replace(replace(Add_Sql,"csed"," Desc"),"filterorderby","Order By ")
  77. elseif Add_Sql<>"" then 
  78. This_Fun_Sql = and_where(This_Fun_Sql) &" "& Add_Sql
  79. end if
  80. Str_Tmp = ""
  81. 'response.Write(This_Fun_Sql)
  82. On Error Resume Next
  83. Set Hs_Rs = CreateObject(G_FS_RS)
  84. Hs_Rs.Open This_Fun_Sql,Conn,1,1
  85. if Err<>0 then 
  86. Err.Clear
  87. response.Redirect("../lib/error.asp?ErrCodes=<li>查询出错:"&Err.Description&"</li><li>请检查字段类型是否匹配.</li>")
  88. response.End()
  89. end if
  90. IF not Hs_Rs.eof THEN
  91. Hs_Rs.PageSize=int_RPP
  92. cPageNo=NoSqlHack(Request.QueryString("Page"))
  93. If cPageNo="" Then cPageNo = 1
  94. If not isnumeric(cPageNo) Then cPageNo = 1
  95. cPageNo = Clng(cPageNo)
  96. If cPageNo<=0 Then cPageNo=1
  97. If cPageNo>Hs_Rs.PageCount Then cPageNo=Hs_Rs.PageCount 
  98. Hs_Rs.AbsolutePage=cPageNo
  99.   FOR int_Start=1 TO int_RPP 
  100. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf
  101. Get_Html = Get_Html & "<td align=""center"" onmouseover=""this.style.cursor = 'hand'"" onclick=""javascript:if(TD_U_"&Hs_Rs("TID")&".style.display=='') TD_U_"&Hs_Rs("TID")&".style.display='none'; else TD_U_"&Hs_Rs("TID")&".style.display='';"" title='点击查看更多信息'>"&Hs_Rs("TID")&"</td>" & vbcrlf
  102. Str_Tmp = Hs_Rs("HouseStyle")
  103. Str_Tmp = left(Str_Tmp,instr(Str_Tmp,",") - 1)&"室"& mid(Str_Tmp,instr(Str_Tmp,",") + 1,len(Str_Tmp)) &"厅" & right(Str_Tmp,len(Str_Tmp) - instrrev(Str_Tmp,","))&"室"
  104. Get_Html = Get_Html & "<td align=""center"">"&Str_Tmp&"</td>" & vbcrlf
  105. Get_Html = Get_Html & "<td align=""center"">"&Hs_Rs("PubDate")&"</td>" & vbcrlf
  106. Get_Html = Get_Html & "<td align=""center"">"&Replacestr(Hs_Rs("Class"),"1:出租,2:求租,3:出售,4:求购,5:合租,6:转让")&"</td>" & vbcrlf
  107. if Hs_Rs("Audited")=0 then 
  108. Str_Tmp = "未审核"
  109. elseif Hs_Rs("Audited")=1 then 
  110. Str_Tmp = "已审核"
  111. else
  112. Str_Tmp = "未定义的状态?"
  113. end if
  114. Get_Html = Get_Html & "<td align=""center"">"& Str_Tmp & "</td>" & vbcrlf
  115. Get_Html = Get_Html & "</tr>" & vbcrlf
  116. ''++++++++++++++++++++++++++++++++++++++点开时显示详细信息。
  117. Get_Html = Get_Html & "<tr class=""hback"" id=""TD_U_"& Hs_Rs("TID") &""" style=""display:none""><td colspan=20>" & vbcrlf
  118. Get_Html = Get_Html & "<table width=""100%"" height=""30"" border=""0"" cellspacing=""1"" cellpadding=""2"" class=""table"">" & vbcrlf 
  119. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>用途:"&Replacestr(Hs_Rs("UseFor"),"1:住房,2:写字间") & "</td><td>房源地址:"&Hs_Rs("Position")&"</td><td>区县:"&Hs_Rs("CityArea") & "</td><td>金额:"&Hs_Rs("Price")& "</td></tr>" & vbcrlf
  120. Str_Tmp = Hs_Rs("Floor")
  121. Str_Tmp = "总层" & left(Str_Tmp,instr(Str_Tmp,",") - 1)&",第"& mid(Str_Tmp,instr(Str_Tmp,",") + 1,len(Str_Tmp)) &"层"
  122. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>面积:"&Hs_Rs("Area") & "</td><td>楼层:"&Str_Tmp&"</td><td>建筑年代:"&Hs_Rs("BuildDate")
  123. Str_Tmp = Hs_Rs("equip")
  124. Str_Tmp = Replace(Str_Tmp,"l","水")
  125. Str_Tmp = Replace(Str_Tmp,"m","电")
  126. Str_Tmp = Replace(Str_Tmp,"n","气")
  127. Str_Tmp = Replace(Str_Tmp,"x","电话")
  128. Str_Tmp = Replace(Str_Tmp,"y","光纤")
  129. Str_Tmp = Replace(Str_Tmp,"z","宽带")
  130. Str_Tmp = Replace(Str_Tmp,"0","无")
  131. Str_Tmp = Replace(Str_Tmp,"m","有")
  132. Get_Html = Get_Html & "</td><td>配套设施:"&Str_Tmp& "</td></tr>" & vbcrlf
  133. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>装修情况:"&Replacestr(Hs_Rs("Decoration"),"1:简单装修,2:中档装修,3:高档装修") & "</td><td>联系人:"&Hs_Rs("LinkMan")&"</td><td>联系方式:"&Hs_Rs("Contact") & "</td><td>有效期:"&Hs_Rs("Period")& "</td></tr>" & vbcrlf
  134. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td colspan=10>备注:"&Hs_Rs("Remark")&"</td></tr>" & vbcrlf
  135. Get_Html = Get_Html & "</table>" & vbcrlf
  136. Get_Html = Get_Html &"</td></tr>" & vbcrlf
  137. ''+++++++++++++++++++++++++++++++++++++++
  138. Hs_Rs.MoveNext
  139.   if Hs_Rs.eof or Hs_Rs.bof then exit for
  140.       NEXT
  141. END IF
  142. Get_Html = Get_Html & "<tr class=""hback""><td colspan=20 align=""center"" class=""ischeck"">"& vbcrlf &"<table width=""100%"" border=0><tr><td height=30>" & vbcrlf
  143. Get_Html = Get_Html & fPageCount(Hs_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)  & vbcrlf
  144. Get_Html = Get_Html &"</tr></table>"&vbNewLine&"</td></tr>"
  145. Get_Html = Get_Html &"</td></tr>"
  146. Hs_Rs.close
  147. Get_While_Info = Get_Html
  148. End Function
  149. %>
  150. <html xmlns="http://www.w3.org/1999/xhtml">
  151. <title>楼盘搜索---网站内容管理系统</title>
  152. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  153. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  154. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  155. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  156. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  157. <script language="JavaScript" type="text/JavaScript">
  158. <!--
  159. //点击标题排序
  160. /////////////////////////////////////////////////////////
  161. var Old_Sql = document.URL;
  162. function OrderByName(FildName)
  163. {
  164. var New_Sql='';
  165. var oldFildName="";
  166. if (Old_Sql.indexOf("&Add_Sql=")==-1&&Old_Sql.indexOf("?Add_Sql=")==-1)
  167. {
  168. if (Old_Sql.indexOf("=")>-1)
  169. New_Sql = Old_Sql+"&Add_Sql=filterorderby" + FildName + "csed";
  170. else
  171. New_Sql = Old_Sql+"?Add_Sql=filterorderby" + FildName + "csed";
  172. }
  173. else
  174. {
  175. var tmp_arr_ = Old_Sql.split('?')[1].split('&');
  176. for(var ii=0;ii<tmp_arr_.length;ii++)
  177. {
  178. if (tmp_arr_[ii].indexOf("filterorderby")>-1)
  179. {
  180. oldFildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby") + "filterorderby".length , tmp_arr_[ii].length);
  181. break;
  182. }
  183. }
  184. oldFildName.indexOf("csed")>-1?New_Sql = Old_Sql.replace(oldFildName,FildName):New_Sql = Old_Sql.replace(oldFildName,FildName+"csed");
  185. }
  186. //alert(New_Sql);
  187. location = New_Sql;
  188. }
  189. /////////////////////////////////////////////////////////
  190. -->
  191. </script>
  192. <head>
  193. <body>
  194. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  195.   <tr>
  196.     <td>
  197.       <!--#include file="../top.asp" -->
  198.     </td>
  199.   </tr>
  200. </table>
  201. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  202.   
  203.     <tr class="back"> 
  204.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="../Top_navi.asp" --> </td>
  205.     </tr>
  206.     <tr class="back"> 
  207.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  208.           <!--#include file="../menu.asp" -->
  209.         </div></td>
  210.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  211.           <tr class="hback"> 
  212.             
  213.           <td class="hback"><strong>位置:</strong><a href="../../">网站首页</a> &gt;&gt; 
  214.             <a href="../main.asp">会员首页</a> &gt;&gt; <a href="default.asp">房产</a>-楼盘搜索</td>
  215.           </tr>
  216.         </table>
  217. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  218.   <tr  class="hback"> 
  219.     <td class="xingmu" >楼盘信息搜索</td>
  220.   </tr>
  221.   <tr  class="hback"> 
  222.     <td><a href="HS_Quotation_Search.asp">首页</a>
  223.       | <a href="HS_Quotation_Search.asp">楼盘信息</a> | 
  224.       <a href="HS_Second_Search.asp">二手房信息</a> | 
  225.   <a href="HS_Tenancy_Search.asp">租赁信息</a></td>
  226.   </tr>
  227. </table>
  228. <%
  229. '******************************************************************
  230. Call View
  231. '******************************************************************
  232. Sub View()%>
  233. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  234.   <form name="form1" method="post" action="?Act=Del&TableName=<%=request.QueryString("TableName")%>">
  235.     <tr  class="hback"> 
  236.       <td align="center" class="xingmu" ><a href="javascript:OrderByName('TID')" class="sd"><b>〖ID〗</b></a> 
  237.         <span id="Show_Oder_TID"></span></td>
  238.       <td align="center" class="xingmu"><a href="javascript:OrderByName('HouseStyle')" class="sd"><b>房源类型</b></a> 
  239.         <span id="Show_Oder_HouseStyle"></span></td>
  240.       <td align="center" class="xingmu"><a href="javascript:OrderByName('PubDate')" class="sd"><b>发布日期</b></a> 
  241.         <span id="Show_Oder_PubDate"></span></td>
  242.       <td align="center" class="xingmu"><a href="javascript:OrderByName('Class')" class="sd"><b>类型</b></a> 
  243.         <span id="Show_Oder_Class"></span></td>
  244.       <td align="center" class="xingmu"><a href="javascript:OrderByName('Audited')" class="sd"><b>是否审核</b></a> 
  245.         <span id="Show_Oder_Audited"></span></td>
  246.     </tr>
  247.     <%
  248. response.Write( Get_While_Info( Encrypt(request.QueryString("Add_Sql")) ) )
  249. %>
  250.   </form>
  251. </table>
  252. <%End Sub%>
  253.        </td>
  254.     </tr>
  255.     <tr class="back"> 
  256.       <td height="20" colspan="2" class="xingmu"> <div align="left"> 
  257.           <!--#include file="../Copyright.asp" -->
  258.         </div></td>
  259.     </tr>
  260.  
  261. </table>
  262. <%
  263. Set Hs_Rs=nothing
  264. Set Fs_User = Nothing
  265. %>
  266. <script language="JavaScript">
  267. <!--//判断后将排序完善.字段名后面显示指示
  268. //打开后根据规则显示箭头
  269. var Req_FildName;
  270. if (Old_Sql.indexOf("filterorderby")>-1)
  271. {
  272. var tmp_arr_ = Old_Sql.split('?')[1].split('&');
  273. for(var ii=0;ii<tmp_arr_.length;ii++)
  274. {
  275. if (tmp_arr_[ii].indexOf("filterorderby")>-1)
  276. {
  277. if(Old_Sql.indexOf("csed")>-1)
  278. {Req_FildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby") + "filterorderby".length , tmp_arr_[ii].indexOf("csed"));break;}
  279. else
  280. {Req_FildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby") + "filterorderby".length , tmp_arr_[ii].length);break;}
  281. }
  282. }
  283. if (document.getElementById('Show_Oder_'+Req_FildName)!=null)  
  284. {
  285. if(Old_Sql.indexOf(Req_FildName + "csed")>-1)
  286. {
  287. eval('Show_Oder_'+Req_FildName).innerText = '↓';
  288. }
  289. else
  290. {
  291. eval('Show_Oder_'+Req_FildName).innerText = '↑';
  292. }
  293. }
  294. }
  295. /////////////////////////////////////////////////////////
  296. -->
  297. </script>
  298. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->