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

数据库编程

开发平台:

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 = "SID,HouseStyle,PubDate,Audited,Class,UserNumber,Label,UseFor,FloorType,BelongType,Structure,Area,BuildDate,Price,CityArea,Address,Floor,Position,Decoration,LinkMan,Contact,equip,Remark"
  50. This_Fun_Sql = "select "&Str_Tmp&" from FS_HS_Second"
  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 "SID","Class","UseFor","FloorType","BelongType","Structure","Area","BuildDate","Price","Decoration","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("SID")&".style.display=='') TD_U_"&Hs_Rs("SID")&".style.display='none'; else TD_U_"&Hs_Rs("SID")&".style.display='';"" title='点击查看更多信息'>"&Hs_Rs("SID")&"</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. if Hs_Rs("Audited")=0 then 
  107. Str_Tmp = "未审核"
  108. elseif Hs_Rs("Audited")=1 then 
  109. Str_Tmp = "已审核"
  110. else
  111. Str_Tmp = "未定义的状态?"
  112. end if
  113. Get_Html = Get_Html & "<td align=""center"">"& Str_Tmp & "</td>" & vbcrlf
  114. if Hs_Rs("UserNumber")=0 then 
  115. Str_Tmp = "系统管理员"
  116. elseif Hs_Rs("UserNumber")<>"" then 
  117. Str_Tmp = Get_OtherTable_Value("select C_Name+' [地址:'+C_Address+' 电话:'+C_Tel+' 传真:'+C_Fax+']' as tmpfild from FS_ME_CorpUser where UserNumber='"&Hs_Rs("UserNumber")&"'")
  118. if Str_Tmp<>"" then 
  119. Str_Tmp = "<span  onmouseover=""this.style.cursor = 'hand'"" id="""&Hs_Rs("UserNumber")&""" title="""&Str_Tmp&""">中介公司:"&Hs_Rs("UserNumber")&"</span>"
  120. else
  121. Str_Tmp = "未知的用户"
  122. end if
  123. else
  124. Str_Tmp = "中介公司"
  125. end if
  126. Get_Html = Get_Html & "<td align=""center"">"& Str_Tmp & "</td>" & vbcrlf
  127. Get_Html = Get_Html & "</tr>" & vbcrlf
  128. ''++++++++++++++++++++++++++++++++++++++点开时显示详细信息。
  129. Str_Tmp = Hs_Rs("Floor")
  130. Str_Tmp = "总层" & left(Str_Tmp,instr(Str_Tmp,",") - 1)&",第"& mid(Str_Tmp,instr(Str_Tmp,",") + 1,len(Str_Tmp)) &"层"
  131. Get_Html = Get_Html & "<tr class=""hback"" id=""TD_U_"& Hs_Rs("SID") &""" style=""display:none""><td colspan=20>" & vbcrlf
  132. Get_Html = Get_Html & "<table width=""100%"" height=""30"" border=""0"" cellspacing=""1"" cellpadding=""2"" class=""table"">" & vbcrlf 
  133. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>交易类型:"&Replacestr(Hs_Rs("Class"),"1:个人,2:中介")& "</td><td>会员编号:"&Replacestr(Hs_Rs("UserNumber"),"0:个人")&"</td><td>房屋编号:"&Replacestr(Hs_Rs("Label"),":无")& "</td><td>使用性质:"&Replacestr(Hs_Rs("UseFor"),"1:住宅,2:办公,3:其它")& "</td></tr>" & vbcrlf
  134. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>住宅类别:"&Replacestr(Hs_Rs("FloorType"),"1:多层,2:单层")& "</td><td>产权性质:"&Replacestr(Hs_Rs("BelongType"),"1:商品房,2:集资房")&"</td><td>建筑结构:"&Replacestr(Hs_Rs("Structure"),"1:砖混,else")& "</td><td>建筑面积:"&Hs_Rs("Area")& "</td></tr>" & vbcrlf
  135. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>建筑年代:"&Hs_Rs("BuildDate") & "</td><td>售价:"&Hs_Rs("Price")&"万元</td><td>区县:"&Hs_Rs("CityArea") & "</td><td>地址:"&Hs_Rs("Address")& "</td></tr>" & vbcrlf
  136. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>楼层:"& Str_Tmp & "</td><td>地段:"&Hs_Rs("Position")&"</td><td>装修情况:"&Replacestr(Hs_Rs("Decoration"),"1:简单装修2:中档装修3:高档装修") & "</td><td>联系人:"&Hs_Rs("LinkMan")& "</td></tr>" & vbcrlf
  137. Str_Tmp = Hs_Rs("equip")
  138. Str_Tmp = Replace(Str_Tmp,"l","水")
  139. Str_Tmp = Replace(Str_Tmp,"m","电")
  140. Str_Tmp = Replace(Str_Tmp,"n","气")
  141. Str_Tmp = Replace(Str_Tmp,"x","电话")
  142. Str_Tmp = Replace(Str_Tmp,"y","光纤")
  143. Str_Tmp = Replace(Str_Tmp,"z","宽带")
  144. Str_Tmp = Replace(Str_Tmp,"0","无")
  145. Str_Tmp = Replace(Str_Tmp,"m","有")
  146. Get_Html = Get_Html & "<tr class=""hback"">" & vbcrlf &"<td>联系方式:"& Hs_Rs("Contact") & "</td><td>配套设施:"& Str_Tmp &"</td><td>备注:"&Hs_Rs("Remark")& "</td><td>&nbsp;</td></tr>" & vbcrlf
  147. Get_Html = Get_Html & "</table>" & vbcrlf
  148. Get_Html = Get_Html &"</td></tr>" & vbcrlf
  149. ''+++++++++++++++++++++++++++++++++++++++
  150. Hs_Rs.MoveNext
  151.   if Hs_Rs.eof or Hs_Rs.bof then exit for
  152.       NEXT
  153. END IF
  154. 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
  155. Get_Html = Get_Html & fPageCount(Hs_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)  & vbcrlf
  156. Get_Html = Get_Html &"</tr></table>"&vbNewLine&"</td></tr>"
  157. Get_Html = Get_Html &"</td></tr>"
  158. Hs_Rs.close
  159. Get_While_Info = Get_Html
  160. End Function
  161. %>
  162. <html xmlns="http://www.w3.org/1999/xhtml">
  163. <title>楼盘搜索---网站内容管理系统</title>
  164. <meta name="keywords" content="风讯cms,cms,FoosunCMS,FoosunOA,FoosunVif,vif,风讯网站内容管理系统">
  165. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  166. <meta content="MSHTML 6.00.3790.2491" name="GENERATOR" />
  167. <meta name="Keywords" content="Foosun,FoosunCMS,Foosun Inc.,风讯,风讯网站内容管理系统,风讯系统,风讯新闻系统,风讯商城,风讯b2c,新闻系统,CMS,域名空间,asp,jsp,asp.net,SQL,SQL SERVER" />
  168. <link href="../images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  169. <script language="JavaScript" type="text/JavaScript">
  170. <!--
  171. //点击标题排序
  172. /////////////////////////////////////////////////////////
  173. var Old_Sql = document.URL;
  174. function OrderByName(FildName)
  175. {
  176. var New_Sql='';
  177. var oldFildName="";
  178. if (Old_Sql.indexOf("&Add_Sql=")==-1&&Old_Sql.indexOf("?Add_Sql=")==-1)
  179. {
  180. if (Old_Sql.indexOf("=")>-1)
  181. New_Sql = Old_Sql+"&Add_Sql=filterorderby" + FildName + "csed";
  182. else
  183. New_Sql = Old_Sql+"?Add_Sql=filterorderby" + FildName + "csed";
  184. }
  185. else
  186. {
  187. var tmp_arr_ = Old_Sql.split('?')[1].split('&');
  188. for(var ii=0;ii<tmp_arr_.length;ii++)
  189. {
  190. if (tmp_arr_[ii].indexOf("filterorderby")>-1)
  191. {
  192. oldFildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby") + "filterorderby".length , tmp_arr_[ii].length);
  193. break;
  194. }
  195. }
  196. oldFildName.indexOf("csed")>-1?New_Sql = Old_Sql.replace(oldFildName,FildName):New_Sql = Old_Sql.replace(oldFildName,FildName+"csed");
  197. }
  198. //alert(New_Sql);
  199. location = New_Sql;
  200. }
  201. /////////////////////////////////////////////////////////
  202. -->
  203. </script>
  204. <head>
  205. <body>
  206. <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  207.   <tr>
  208.     <td>
  209.       <!--#include file="../top.asp" -->
  210.     </td>
  211.   </tr>
  212. </table>
  213. <table width="98%" height="135" border="0" align="center" cellpadding="1" cellspacing="1" class="table">
  214.   
  215.     <tr class="back"> 
  216.       <td   colspan="2" class="xingmu" height="26"> <!--#include file="../Top_navi.asp" --> </td>
  217.     </tr>
  218.     <tr class="back"> 
  219.       <td width="18%" valign="top" class="hback"> <div align="left"> 
  220.           <!--#include file="../menu.asp" -->
  221.         </div></td>
  222.       <td width="82%" valign="top" class="hback"><table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  223.           <tr class="hback"> 
  224.             
  225.           <td class="hback"><strong>位置:</strong><a href="../../">网站首页</a> &gt;&gt; 
  226.             <a href="../main.asp">会员首页</a> &gt;&gt; <a href="default.asp">房产</a>-二手房搜索</td>
  227.           </tr>
  228.         </table>
  229. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  230.   <tr  class="hback"> 
  231.     <td class="xingmu" >二手房搜索</td>
  232.   </tr>
  233.   <tr  class="hback"> 
  234.     <td><a href="HS_Quotation_Search.asp">首页</a>
  235.       | <a href="HS_Quotation_Search.asp">楼盘信息</a> | 
  236.       <a href="HS_Second_Search.asp">二手房信息</a> | 
  237.   <a href="HS_Tenancy_Search.asp">租赁信息</a></td>
  238.   </tr>
  239. </table>
  240. <%
  241. '******************************************************************
  242. Call View
  243. '******************************************************************
  244. Sub View()%>
  245. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  246.   <form name="form1" method="post" action="?Act=Del&TableName=<%=request.QueryString("TableName")%>">
  247.     <tr  class="hback"> 
  248.       <td align="center" class="xingmu" ><a href="javascript:OrderByName('SID')" class="sd"><b>〖ID〗</b></a> 
  249.         <span id="Show_Oder_SID"></span></td>
  250.       <td align="center" class="xingmu"><a href="javascript:OrderByName('HouseStyle')" class="sd"><b>房源类型</b></a> 
  251.         <span id="Show_Oder_HouseStyle"></span></td>
  252.       <td align="center" class="xingmu"><a href="javascript:OrderByName('PubDate')" class="sd"><b>发布日期</b></a> 
  253.         <span id="Show_Oder_PubDate"></span></td>
  254.       <td align="center" class="xingmu"><a href="javascript:OrderByName('Audited')" class="sd"><b>是否审核</b></a> 
  255.         <span id="Show_Oder_Audited"></span></td>
  256.       <td align="center" class="xingmu"><a href="javascript:OrderByName('UserNumber')" class="sd"><b>会员编号</b></a> 
  257.         <span id="Show_Oder_UserNumber"></span></td>
  258.     </tr>
  259.     <%
  260. response.Write( Get_While_Info( Encrypt(request.QueryString("Add_Sql")) ) )
  261. %>
  262.   </form>
  263. </table>
  264. <%End Sub%>
  265.        </td>
  266.     </tr>
  267.     <tr class="back"> 
  268.       <td height="20" colspan="2" class="xingmu"> <div align="left"> 
  269.           <!--#include file="../Copyright.asp" -->
  270.         </div></td>
  271.     </tr>
  272.  
  273. </table>
  274. <%
  275. Set Hs_Rs=nothing
  276. Set Fs_User = Nothing
  277. %>
  278. <script language="JavaScript">
  279. <!--//判断后将排序完善.字段名后面显示指示
  280. //打开后根据规则显示箭头
  281. var Req_FildName;
  282. if (Old_Sql.indexOf("filterorderby")>-1)
  283. {
  284. var tmp_arr_ = Old_Sql.split('?')[1].split('&');
  285. for(var ii=0;ii<tmp_arr_.length;ii++)
  286. {
  287. if (tmp_arr_[ii].indexOf("filterorderby")>-1)
  288. {
  289. if(Old_Sql.indexOf("csed")>-1)
  290. {Req_FildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby") + "filterorderby".length , tmp_arr_[ii].indexOf("csed"));break;}
  291. else
  292. {Req_FildName = tmp_arr_[ii].substring(tmp_arr_[ii].indexOf("filterorderby") + "filterorderby".length , tmp_arr_[ii].length);break;}
  293. }
  294. }
  295. if (document.getElementById('Show_Oder_'+Req_FildName)!=null)  
  296. {
  297. if(Old_Sql.indexOf(Req_FildName + "csed")>-1)
  298. {
  299. eval('Show_Oder_'+Req_FildName).innerText = '↓';
  300. }
  301. else
  302. {
  303. eval('Show_Oder_'+Req_FildName).innerText = '↑';
  304. }
  305. }
  306. }
  307. /////////////////////////////////////////////////////////
  308. -->
  309. </script>
  310. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->