<!--#include file="Start.asp"-->
<!--#include file="Include/PowerEasy.Cache.asp"-->
<!--#include file="Include/PowerEasy.Common.Front.asp"-->
<!--#include file="Include/PowerEasy.Channel.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005－2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************

ChannelID = 0
PageTitle = "会员列表"
strFileName = "UserList.asp?ChannelID=" & ChannelID


Dim OrderType
OrderType = Trim(Request("OrderType"))
If OrderType = "" Then
    OrderType = 1
Else
    OrderType = CLng(OrderType)
End If
strNavPath = strNavPath & strNavLink & "&nbsp;" & PageTitle

strHtml = GetTemplate(0, 9, 0)
Call ReplaceCommonLabel

strHtml = Replace(strHtml, "{$PageTitle}", SiteTitle & " >> " & PageTitle)
strHtml = Replace(strHtml, "{$ShowPath}", strNavPath)
strHtml = Replace(strHtml, "{$MenuJS}", GetMenuJS("", False))
strHtml = Replace(strHtml, "{$Skin_CSS}", GetSkin_CSS(0))

strHtml = Replace(strHtml, "{$ShowUserList}", GetUserList())
If InStr(strHtml, "{$ShowPage}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage}", ShowPage(strFileName & "&OrderType=" & OrderType, totalPut, MaxPerPage, CurrentPage, True, True, XmlText("ShowSource", "ShowUserList/PageChar", "个会员"), False))
If InStr(strHtml, "{$ShowPage_en}") > 0 Then strHtml = Replace(strHtml, "{$ShowPage_en}", ShowPage_en(strFileName & "&OrderType=" & OrderType, totalPut, MaxPerPage, CurrentPage, True, True, XmlText("ShowSource", "ShowUserList/PageChar", "个会员"), False))
Response.Write strHtml
Call CloseConn

Function GetUserList()
    Dim sqlUser, rsUser, strUserList, i
    sqlUser = "select U.UserID,U.UserName,U.UserType,U.UserFace,U.Sign,U.Privacy,U.PostItems,U.RegTime,U.PassedItems,C.Sex, C.ZipCode,C.Fax,C.OfficePhone,C.HomePhone,C.Address,C.Department,C.Company,C.TrueName,C.QQ,C.ICQ,C.MSN,C.Email,C.HomePage,C.Birthday from PE_User U left join PE_Contacter C on U.ContacterID=C.ContacterID "
    Select Case OrderType
    Case 1
         sqlUser = sqlUser & " order by U.PassedItems desc"
    Case 2
         sqlUser = sqlUser & " order by U.RegTime desc"
    Case 3
         sqlUser = sqlUser & " order by U.UserID desc"
    End Select

    Set rsUser = Server.CreateObject("adodb.recordset")
    rsUser.Open sqlUser, Conn, 1, 1
    If rsUser.BOF And rsUser.EOF Then
        totalPut = 0
        strUserList = strUserList & "<li>" & XmlText("ShowSource", "ShowUserList/NoFoundUser", "没有任何会员") & "</li>"
    Else
        totalPut = rsUser.RecordCount
        If CurrentPage > 1 Then
            If (CurrentPage - 1) * MaxPerPage < totalPut Then
                rsUser.Move (CurrentPage - 1) * MaxPerPage
            Else
                CurrentPage = 1
            End If
        End If
        i = 0
        Dim UserHomepage, UserQQ, UserICQ, UserMSN, UserSex, UserEmail, UserRegTime, UserPass
        strUserList = strUserList & "<table width='100%' border='0' cellspacing='1' cellpadding='3' class='Channel_border'>"
        strUserList = strUserList & "<tr align='center' class='Channel_pager'><td colspan='8'>" & Replace(XmlText("ShowSource", "ShowUserList/Order", "<a href='{$strFileName}&OrderType=1'>按发表文章数排序</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='{$strFileName}&OrderType=2'>按注册日期排序</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='{$strFileName}&OrderType=3'>按会员ID排序</a>"), "{$strFileName}", strFileName) & "</td></tr>"
        strUserList = strUserList & XmlText("ShowSource", "ShowUserList/t1", "<tr align='center' class='Channel_title'><td>会员昵称</td><td>性别</td><td>Email</td><td>QQ号码</td><td>MSN</td><td>主页</td><td>注册日期</td><td>文章数</td><tr>")
        
        
        Do While Not rsUser.EOF
            If rsUser("Privacy") = 2 Then
                UserHomepage = Secrit
                UserQQ = Secrit
                UserICQ = Secrit
                UserMSN = Secrit
                UserSex = Secrit
                UserEmail = Secrit
                UserRegTime = Secrit
            Else
                If rsUser("Homepage") = "" Then
                    UserHomepage = NoEnter
                Else
                    UserHomepage = "<a href='" & rsUser("Homepage") & "'>" & rsUser("Homepage") & "</a>"
                End If
                If rsUser("QQ") = "" Then
                    UserQQ = NoEnter
                Else
                    UserQQ = rsUser("QQ")
                End If
                If rsUser("ICQ") = "" Then
                    UserICQ = NoEnter
                Else
                    UserICQ = rsUser("ICQ")
                End If
                If rsUser("MSN") = "" Then
                    UserMSN = NoEnter
                Else
                    UserMSN = rsUser("MSN")
                End If
                If rsUser("Sex") = 2 Then
                    UserSex = strGirl
                ElseIf rsUser("Sex") = 1 Then
                    UserSex = strMan
                Else
                    UserSex = Secrit
                End If
                If rsUser("Email") = "" Then
                    UserEmail = NoEnter
                Else
                    UserEmail = "<a href=""mailto:" & rsUser("Email") & """>" & rsUser("Email") & "</a>"
                End If
                If rsUser("RegTime") = "" Then
                    UserRegTime = NoEnter
                Else
                    UserRegTime = Year(rsUser("RegTime")) & strYear & Month(rsUser("RegTime")) & strMonth & Day(rsUser("RegTime")) & strDay
                End If
            End If
            strUserList = strUserList & ("<tr class='Channel_tdbg'><td><a href='ShowUser.asp?UserID=" & rsUser("UserID") & "'>" & rsUser("UserName") & "</a></td>")
            strUserList = strUserList & ("<td align='center'>" & UserSex & "</td><td>" & UserEmail & "</td><td align='center'>" & UserQQ & "</td>")
            strUserList = strUserList & ("<td align='center'>" & UserMSN & "</td><td align='center'>" & UserHomepage & "</td><td align='center'>" & UserRegTime & "</td><td align='right'>" & rsUser("PassedItems") & "</td></tr>")
            rsUser.MoveNext
            i = i + 1
            If i >= MaxPerPage Then Exit Do
        Loop
        strUserList = strUserList & "</table>"
        '完毕
    End If
    rsUser.Close
    Set rsUser = Nothing
    GetUserList = strUserList
End Function
%>
