PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/Wap/Space/MoreGroup.asp

https://github.com/joechen2010/health
ASP | 97 lines | 93 code | 4 blank | 0 comment | 0 complexity | 5a4783b39948d66391b36cebc5d55851 MD5 | raw file
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
  3. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
  4. <!--#include file="../Conn.asp"-->
  5. <!--#include file="../KS_Cls/Kesion.CommonCls.asp"-->
  6. <!--#include file="../KS_Cls/Kesion.Label.CommonCls.asp"-->
  7. <%
  8. Dim KSCls
  9. Set KSCls = New SpaceMore
  10. KSCls.Kesion()
  11. Set KSCls = Nothing
  12. Class SpaceMore
  13. Private KS,KSRFObj
  14. Private Sub Class_Initialize()
  15. Set KS=New PublicCls
  16. Set KSRFObj = New Refresh
  17. End Sub
  18. Private Sub Class_Terminate()
  19. Call CloseConn()
  20. Set KS=Nothing
  21. End Sub
  22. Public Sub Kesion()
  23. Dim FileContent
  24. FileContent = KSRFObj.LoadTemplate(KS.WSetting(30))
  25. FileContent = KSRFObj.KSLabelReplaceAll(FileContent)
  26. FileContent = Replace(FileContent,"{$ShowMain}",GetGroupList())
  27. Response.Write FileContent
  28. End Sub
  29. Function GetGroupList()
  30. MaxPerPage = 15
  31. Dim ClassID:ClassID=KS.ChkClng(KS.S("ClassID"))
  32. Dim recommend:recommend=KS.ChkClng(KS.S("recommend"))
  33. If KS.S("page") <> "" Then
  34. CurrentPage = KS.ChkClng(KS.G("page"))
  35. Else
  36. CurrentPage = 1
  37. End If
  38. str = "【圈子查找】<br/>"
  39. str = str & "<select name=""ClassID"">"
  40. str = str & "<option value=""0"">所有分类</option>"
  41. Dim RSC:set RSC=Conn.Execute("select ClassName,ClassID from KS_TeamClass order by OrderID")
  42. If Not RSC.EOF Then
  43. Do While Not RSC.EOF
  44. str = str & "<option value=""" & RSC(1) & """>" & RSC(0) & "</option>"
  45. RSC.Movenext
  46. Loop
  47. End If
  48. RSC.Close:set RSC=Nothing
  49. str = str & "</select> "
  50. str = str & "名称:<input type=""text"" size=""12"" name=""key""/> "
  51. str = str & "<anchor>查找<go href=""MoreGroup.asp?"&KS.WapValue&""" method=""post"">"
  52. str = str & "<postfield name=""ClassID"" value=""$(ClassID)""/>"
  53. str = str & "<postfield name=""key"" value=""$(key)""/>"
  54. str = str & "</go></anchor><br/>"
  55. str = str & "【圈子列表】<br/>"
  56. Dim Param:Param=" where verific=1"
  57. If ClassID<>0 Then Param=Param & " and a.ClassID=" & ClassID
  58. If Recommend<>0 Then Param=Param & " and rRecommend=1"
  59. If KS.S("key")<>"" Then Param=Param & " and TeamName like '%" & KS.R(KS.S("key")) &"%'"
  60. Dim RSObj:Set RSObj=Server.CreateObject("ADODB.RECORDSET")
  61. RSObj.Open "select a.*,b.classname from KS_team a inner join ks_teamclass b on a.classid=b.classid " & Param & " order by id desc",Conn,1,1
  62. If RSObj.EOF and RSObj.Bof Then
  63. str = str & "没有用户创建圈子!<br/>"
  64. Else
  65. TotalPut = RSObj.RecordCount
  66. If CurrentPage < 1 Then CurrentPage = 1
  67. If (CurrentPage - 1) * MaxPerPage > TotalPut Then
  68. If (TotalPut Mod MaxPerPage) = 0 Then
  69. CurrentPage = TotalPut \ MaxPerPage
  70. Else
  71. CurrentPage = TotalPut \ MaxPerPage + 1
  72. End If
  73. End If
  74. If CurrentPage >1 and (CurrentPage - 1) * MaxPerPage < TotalPut Then
  75. RSObj.Move (CurrentPage - 1) * MaxPerPage
  76. Else
  77. CurrentPage = 1
  78. End If
  79. Dim I
  80. Do While Not RSObj.EOF
  81. str = str & "<a href=""Group.asp?ID="&RSObj("ID")&"&amp;"&KS.WapValue&""">"&RSObj("TeamName")&" ("&Conn.Execute("select Count(ID) from KS_TeamTopic where TeamID=" & RSObj("ID") & " and ParentID=0")(0)&"/"&Conn.Execute("select Count(ID) from KS_TeamTopic where TeamID=" & RSObj("ID"))(0)&"/"&Conn.Execute("select Count(UserName) from KS_TeamUsers where Status=3 and TeamID=" & RSObj("ID"))(0)&")</a>"
  82. str = str & "<br/>"
  83. RSObj.MoveNext
  84. I = I + 1
  85. If I >= MaxPerPage Then Exit Do
  86. Loop
  87. str = str & KS.ShowPagePara(TotalPut, MaxPerPage, "MoreGroup.asp", True, "个", CurrentPage, "ClassID="&ClassID&"&amp;key="&KS.S("key")&"&amp;" & KS.WapValue & "")
  88. End If
  89. GetGroupList = str & "<br/>"
  90. RSObj.Close:Set RSObj=Nothing
  91. End Function
  92. End Class
  93. %>