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

/Wap/User/UserList.asp

https://github.com/joechen2010/health
ASP | 133 lines | 126 code | 7 blank | 0 comment | 0 complexity | 49d962269b539c6af35c9d4e9ac66ace MD5 | raw file
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <%option explicit%>
  3. <!--#include file="../Conn.asp"-->
  4. <!--#include file="../KS_Cls/Kesion.CommonCls.asp"-->
  5. <%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
  6. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
  7. <wml>
  8. <head>
  9. <meta http-equiv="Cache-Control" content="no-Cache"/>
  10. <meta http-equiv="Cache-Control" content="max-age=0"/>
  11. </head>
  12. <card id="main" title="所有注册会员">
  13. <p>
  14. <%
  15. Dim KSCls
  16. Set KSCls = New UserList
  17. KSCls.Kesion()
  18. Set KSCls = Nothing
  19. %>
  20. </p>
  21. </card>
  22. </wml>
  23. <%
  24. Class UserList
  25. Private KS
  26. Private Sub Class_Initialize()
  27. Set KS=New PublicCls
  28. End Sub
  29. Private Sub Class_Terminate()
  30. Set KS=Nothing
  31. Set KSUser=Nothing
  32. CloseConn
  33. End Sub
  34. Public Sub Kesion()
  35. %>
  36. <a href="UserList.asp?ListType=1&amp;<%=KS.WapValue%>">ID排序</a>
  37. <a href="UserList.asp?ListType=2&amp;<%=KS.WapValue%>">注册日期</a>
  38. <a href="UserList.asp?ListType=3&amp;<%=KS.WapValue%>">登录次数</a>
  39. <br/>所有会员<br/>
  40. <%
  41. Response.Write GetUserList
  42. Response.Write "<br/>"
  43. IF Cbool(KSUser.UserLoginChecked)=True Then
  44. Response.Write "<a href=""Index.asp?" & KS.WapValue & """>我的地盘</a><br/>" &vbcrlf
  45. End If
  46. Response.Write "<a href=""" & KS.GetGoBackIndex & """>返回首页</a>" &vbcrlf
  47. End Sub
  48. Function GetUserList()
  49. Dim CurrentPage,totalPut,RS,MaxPerPage,SqlStr,ListType,Param
  50. ListType=KS.ChkClng(KS.S("ListType"))
  51. MaxPerPage =15
  52. If KS.S("page") <> "" Then
  53. CurrentPage = KS.ChkClng(KS.S("page"))
  54. Else
  55. CurrentPage = 1
  56. End If
  57. Set RS=Server.CreateObject("Adodb.Recordset")
  58. If ListType=1 Then
  59. Param="Order By UserID Desc"
  60. ElseIF ListType=2 Then
  61. Param="Order By LastLoginTime Desc"
  62. ElseIF ListType=3 Then
  63. Param="Order By LoginTimes Desc"
  64. End IF
  65. If KS.S("UserName")<>"" Then
  66. SqlStr="Select * From KS_User where GroupID<>4 and UserName like '%" & ks.s("UserName") & "%' " & Param
  67. Else
  68. SqlStr="Select * From KS_User where GroupID<>4 " & Param
  69. End If
  70. RS.Open SqlStr,Conn,1,1
  71. If Not RS.EOF Then
  72. totalPut = RS.RecordCount
  73. If CurrentPage < 1 Then
  74. CurrentPage = 1
  75. End If
  76. If (CurrentPage - 1) * MaxPerPage > totalPut Then
  77. If (totalPut Mod MaxPerPage) = 0 Then
  78. CurrentPage = totalPut \ MaxPerPage
  79. Else
  80. CurrentPage = totalPut \ MaxPerPage + 1
  81. End If
  82. End If
  83. If CurrentPage = 1 Then
  84. GetUserList= GetUserList & showContent(RS,totalPut, MaxPerPage, CurrentPage,ListType)
  85. Else
  86. If (CurrentPage - 1) * MaxPerPage < totalPut Then
  87. RS.Move (CurrentPage - 1) * MaxPerPage
  88. GetUserList= GetUserList &showContent(RS,totalPut, MaxPerPage, CurrentPage,ListType)
  89. Else
  90. CurrentPage = 1
  91. GetUserList= GetUserList &showContent(RS,totalPut, MaxPerPage, CurrentPage,ListType)
  92. End If
  93. End If
  94. End If
  95. GetUserList= GetUserList & "【快速查找】<br/>用户名:<input type=""text"" name=""UserName"" size=""20"" maxlength=""30"" />" & vbcrlf
  96. GetUserList= GetUserList & "<anchor>搜索<go href=""UserList.asp?"&KS.WapValue&""" method=""post"">"
  97. GetUserList= GetUserList & "<postfield name=""UserName"" value=""$(UserName)""/>"
  98. GetUserList= GetUserList & "</go></anchor><br/>"
  99. RS.Close:Set RS=Nothing
  100. End Function
  101. Function ShowContent(RS,totalPut, MaxPerPage, CurrentPage,ListType)
  102. Dim I,Privacy,Sex
  103. Do While Not RS.EOF
  104. Privacy=RS("Privacy")
  105. ShowContent = ShowContent & "<a href=""User_Friend.asp?Action=saveF&amp;ToUser="&RS("UserName")&"&amp;" & KS.WapValue & """>加友</a> "
  106. If RS("Sex")="" or Isnull(RS("Sex")) Then Sex="—" Else Sex=RS("Sex")
  107. If Privacy=2 Then Sex="—" Else Sex=Sex
  108. If RS("RealName")="" or Isnull(RS("RealName")) Then
  109. ShowContent = ShowContent & "<a href=""ShowUser.asp?UserID="&RS("UserID")&"&amp;" & KS.WapValue & """>"&RS("UserName")&""
  110. Else
  111. ShowContent = ShowContent & "<a href=""ShowUser.asp?UserID="&RS("UserID")&"&amp;" & KS.WapValue & """>"&RS("RealName")&""
  112. End If
  113. If Conn.Execute("select UserName from KS_Online where UserName='"&RS("UserName")&"'").EOF Then
  114. ShowContent = ShowContent & "("&Sex&"/离线)</a><br/>"
  115. Else
  116. ShowContent = ShowContent & "("&Sex&"/在线)</a><br/>"
  117. End If
  118. RS.MoveNext
  119. I = I + 1
  120. If I >= MaxPerPage Then Exit Do
  121. Loop
  122. ShowContent = ShowContent & KS.ShowPagePara(totalPut, MaxPerPage, "UserList.asp", True, "位", CurrentPage, "ListType="&ListType&"&amp;" & KS.WapValue & "")
  123. ShowContent = ShowContent & "<br/>"
  124. End Function
  125. End Class
  126. %>