<!-- #include file=../../../inc/BBSsetup.asp -->
<!-- #include file=../../../inc/Board_popfun.asp -->
<!-- #include file=../inc/BoardMaster_Fun.asp -->
<%
DEF_BBS_HomeUrl = "../../../"
initDatabase
GBL_CHK_TempStr = ""
CheckisBoardMasterFlag

SiteHead(DEF_SiteNameString & " - 总版主管理")

UserTopicTopInfo
DisplayUserNavigate("特殊社员管理")

If GBL_CHK_Flag=1 and BDM_isBoardMasterFlag = 1 and BDM_SpecialPopedomFlag = 1 Then%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr> 
	<td height="20"><%
		SpecialUserBrowser
		%>
	</td></tr></table>
	<br>
	<b>添加</b> <a href=NewSpecialUser.asp?GBL_Assort=3><font color=Blue class=BlueFont>●</font>屏蔽发言内容社员</a></a>
	<a href=NewSpecialUser.asp?GBL_Assort=4><font color=Blue class=BlueFont>●</font>禁言社员</a>
	<a href=NewSpecialUser.asp?GBL_Assort=5><font color=Blue class=BlueFont>●</font>禁止修改社员</a>
	<a href=NewSpecialUser.asp?GBL_Assort=6><font color=Blue class=BlueFont>●</font>强制社员未激活状态</a>		
	<%
Else%>
	<table width=96%>
	<tr>
	<td>
	<%
	If Request("submitflag")="" Then
		Response.Write "<br><b>请先登录</b>"
	Else
		Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
	End If
	DisplayLoginForm
	Response.Write "</p>"%>
	</td>
	</tr>
	</table>
<%End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function SpecialUserBrowser

	GBL_CHK_TempStr=""
	Dim Rs,SQL
	Dim UpDownPageFlag
	UpDownPageFlag = Request("UpDownPageFlag")
	
	Dim Assort
	Assort = Left(Request.QueryString("Assort"),14)
	If isNumeric(Assort) = 0 Then Assort = 3
	Assort = Fix(cCur(Assort))
	If Assort < 3 or Assort > 6 then Assort = 3

	Dim Start,key
	'Dim recordCount
	'recordCount=0
	
	Dim SQLendString

	Start = Left(Trim(Request("Start")),14)
	Start = start
	If isNumeric(Start)=0 or Start="" Then Start=0
	Start = cCur(Start)
	key = Request.Form("key")
	If key="" Then key = Request("key")

	Dim SQLCountString,whereFlag
	SQLendString=""
	SQLendString = " where T1.Assort=" & Assort
	whereFlag = 1

	If key<>"" Then
		If whereFlag = 1 Then
			SQLendString = SQLendString & " and T1.UserName like'" & Replace(key,"'","''") & "%'"
		Else
			SQLendString = SQLendString & " where T1.UserName like'" & Replace(key,"'","''") & "%'"
			whereFlag = 1
		End If
	End If
	SQLCountString = SQLendString
	If UpDownPageFlag = "1" and Start>0 then
		If whereFlag = 1 Then
			SQLendString = SQLendString & " and T1.ID<" & Start
		Else
			SQLendString = SQLendString & " where T1.ID<" & Start
			whereFlag = 1
		End If
	Else
		If whereFlag = 1 Then
			SQLendString = SQLendString & " and T1.ID>" & Start
		Else
			SQLendString = SQLendString & " where T1.ID>" & Start
			whereFlag = 1
		End If
	end If
	
	If UpDownPageFlag = "1" then
		'If DEF_IDFocusFlag<> 2 Then SQLendString = SQLendString & " Order by  T1.ID DESC"
		SQLendString = SQLendString & " Order by  T1.ID DESC"
	Else
		'If DEF_IDFocusFlag<> 1 Then SQLendString = SQLendString & " Order by  T1.ID ASC"
		SQLendString = SQLendString & " Order by  T1.ID ASC"
	End If
	
	Dim MaxRecordID,MinRecordID
	MaxRecordID = 0

	SQL = "select Max(T1.id) from LeadBBS_SpecialUser as T1 " & SQLCountString
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	
	If not Rs.Eof Then
		If Rs(0) <> "" Then
			MaxRecordID = cCur(Rs(0))
		Else
			MaxRecordID = 0
		End If
	End If
	Rs.Close
	Set Rs = Nothing
	
	SQL = "select Min(id) from LeadBBS_SpecialUser as T1 " & SQLCountString
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1

	If not Rs.Eof Then
		If Rs(0) <> "" Then
			MinRecordID = cCur(Rs(0))
		else
			MinRecordID = 0
		end If
	End If

	Rs.Close
	Set Rs = Nothing

	Dim FirstID,LastID	
	'SQL = "select count(*) from LeadBBS_SpecialUser as T1 " & SQLCountString
	'Set Rs = Con.ExeCute(SQL)
	'GBL_DBNum = GBL_DBNum + 1
	'if rs.eof then
	'	recordCount=0
	'else
	'	recordCount=rs(0)
	'	if recordCount="" or isNull(recordCount) or len(recordCount)<1 Then recordCount=0
	'End If
	'Rs.Close
	'Set Rs = Nothing

	SQL = "select TOP "&DEF_MaxListNum&" T1.ID,T1.UserID,T1.UserName,T1.ndatetime,T1.Assort,t2.BoardName,T1.BoardID,T1.WhyString,T1.ExpiresTime from LeadBBS_SpecialUser as T1 left join LeadBBS_Boards as T2 on T1.BoardID=T2.BoardID" & SQLendString

	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	Dim Num
	Dim GetData
	If Not rs.Eof Then
		GetData = Rs.GetRows(-1)
		Num = Ubound(GetData,2) + 1
	Else
		Num = 0
	End If
	Rs.close
	Set Rs = Nothing
	
	
	Dim i,N,DoStr%>
	<br><br>
	<%	
	If Assort = 3 Then
		DoStr = "解除"
		Response.Write "[●屏蔽发言]"
	Else
		Response.Write "[<font color=Blue class=BlueFont>●</font><a href=LimitUserManage.asp?assort=3>屏蔽发言</a>]"
	End If
	
	If Assort = 4 Then
		DoStr = "解除"
		Response.Write " [●禁止发言]"
	Else
		Response.Write " [<a href=LimitUserManage.asp?assort=4><font color=Blue class=BlueFont>●</font>禁止发言</a>]"
	End If
	
	If Assort = 5 Then
		DoStr = "解除"
		Response.Write " [●禁止修改]"
	Else
		Response.Write " [<a href=LimitUserManage.asp?assort=5><font color=Blue class=BlueFont>●</font>禁止修改</a>]"
	End If
	
	If Assort = 6 Then
		DoStr = "激活"
		Response.Write " [●非正式社员(待激活)"
	Else
		Response.Write " [<a href=LimitUserManage.asp?assort=6><font color=Blue class=BlueFont>●</font>非正式社员(待激活)</a>]"
	End If
	If Num>0 Then
		i=1
	
		Dim MinN,MaxN,StepValue
		SQL = ubound(getdata,2)
		If UpDownPageFlag = "1" then
			MinN = SQL
			MaxN = 0
			StepValue = -1
		Else
			MinN = 0
			MaxN = SQL
			StepValue = 1
		End If
		
		LastID = cCur(GetData(0,MaxN))
		FirstID = cCur(GetData(0,MinN))
		
		
		Dim EndwriteQueryString,PageSplictString
		EndwriteQueryString = "?Assort=" & Assort
		If key<>"" Then EndwriteQueryString = EndwriteQueryString & "&key=" & urlencode(key)
	
		PageSplictString = PageSplictString & "<table border=0 cellspacing=0 cellpadding=0><tr><td>&nbsp;"
		if FirstID>MinRecordID and FirstID<>0 then
			PageSplictString = PageSplictString & "<a href=LimitUserManage.asp" & EndwriteQueryString & "&Start=0&SubmitFlag=3829EwoqIaNfoG>首页</a> " & VbCrLf
		else
			PageSplictString = PageSplictString & "<font color=999999 class=GrayFont>首页</font> " & VbCrLf
		end if
	
		if FirstID > MinRecordID and FirstID<>0 then
			PageSplictString = PageSplictString & " <a href=LimitUserManage.asp" & EndwriteQueryString & "&Start=" & FirstID & "&UpDownPageFlag=1&SubmitFlag=3829EwoqIaNfoG>上页</a> " & VbCrLf
		else
			PageSplictString = PageSplictString & " <font color=999999 class=GrayFont>上页</font> " & VbCrLf
		end if
	
		if LastID<MaxRecordID and LastID<>0 then
			PageSplictString = PageSplictString & " <a href=LimitUserManage.asp" & EndwriteQueryString & "&Start=" & LastID & "&SubmitFlag=3829EwoqIaNfoG>下页</a> " & VbCrLf
		else
			PageSplictString = PageSplictString & " <font color=999999 class=GrayFont>下页</font> " & VbCrLf
		end if
	
		if LastID < MaxRecordID and LastID<>0 then
			PageSplictString = PageSplictString & " <a href=LimitUserManage.asp" & EndwriteQueryString & "&Start=" & MaxRecordID+1 & "&UpDownPageFlag=1&SubmitFlag=3829EwoqIaNfoG>尾页</a> " & VbCrLf
		else
			PageSplictString = PageSplictString & " <font color=999999 class=GrayFont>尾页</font> " & VbCrLf
		end if
		'PageSplictString = PageSplictString & "共<b>" & recordCount & "</b>条信息"
		'If (recordCount mod DEF_MaxListNum)=0 Then
		'	PageSplictString = PageSplictString & " 计<b>" & clng(recordCount/DEF_MaxListNum) & "</b>页"
		'Else
		'	If recordCount>=DEF_MaxListNum Then
		'		PageSplictString = PageSplictString & " 计<b>" & clng(recordCount/DEF_MaxListNum)+1 & "</b>页"
		'	Else
		'		PageSplictString = PageSplictString & " 计<b>1</b>页"
		'	End If
		'End If
		PageSplictString = PageSplictString & " 每页<b>" & DEF_MaxListNum & "</b>条记录"
		PageSplictString = PageSplictString & "</td><td><form action=LimitUserManage.asp?assort=" & assort & " method=post><input size=6 name=key value=" & chr(34) & htmlencode(key) & """ class=fminpt><input type=submit name=submit value=搜 class=fmbtn></td></form></tr></table>"
		%>
			<script language=javascript>
				function kill(killID)
				{
					window.open('DelSpecialUser.asp?'+killID,'','width=450,height=37,scrollbars=auto,status=no');
				}
			</script>
		<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
		<tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour> 
			<td height="30" valign="top" colspan=6> 
				<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF" class=TBfour>
				<tr>
					<td height="20"> 
						<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="3">
						<tr> 
							<td></td>
						</tr>
						</table>
						<%=PageSplictString%></td>
				</tr>
				</table>
			</td>
		</tr>
		<tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
			<td><b>ID</b></td>
			<td><b>名称</b></td>
			<td><b>更新时间</b></td>
			<td><b>类型</b></td><%If Assort = 1 Then%>
			<td><b>版面</b></td><%End If
			If Assort = 6 Then%>
			<td><b>激活码</b></td><%End If%>
			<td><b>说明及有效时间</b></td>
		</tr>
<%
		for n= MinN to MaxN Step StepValue
			%>
		<tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBBG9>
			<td height="20" width=30><%=GetData(0,n)%></td>
			<td width=102>
				<a href=<%=DEF_BBS_HomeUrl%>User/LookUserInfo.asp?id=<%=GetData(1,n)%>><%=htmlencode(GetData(2,n))%></a>
				<a href='javascript:kill("GBL_UserName=<%=GetData(2,n)%>&GBL_Assort=<%=Assort%>");'><font color=008800 class=GreenFont><%=DoStr%></font></a></td>
			<td width=62><%=RestoreTime(Left(GetData(3,n),8))%></td>
			<td width=48><%Select Case GetData(4,n)
				Case 0: Response.Write "认证社员"
				Case 1: Response.Write "版主"
				Case 2: Response.Write "总版主"
				Case 3: Response.Write "屏蔽发言"
				Case 4: Response.Write "禁止发言"
				Case 5: Response.Write "禁止修改"
				Case 6: Response.Write "等待认证"
				End Select%></td><%If Assort = 1 Then%>
			<td width=104><a href=../ForumBoard/ForumBoardModify.asp?GBL_ModifyID=<%=GetData(6,n)%>><%=GetData(5,n)%></a></td><%End If
			If Assort = 6 Then
				If cCur(GetData(6,n)) = 0 Then
					Response.Write "<td width=60>无<br>(不能自启)</td>"
				Else%>
			<td><a href=../../User/UserTurnOn.asp?user=<%=htmlencode(GetData(2,n))%>><%=GetData(6,n)%></a></td><%
				End If
			End If%>
			<td><%
			If GetData(7,n) <> "" Then Response.Write htmlencode(GetData(7,n)) & "<br>"
			If cCur(GetData(8,n)) > 0 Then
				Response.Write "<font color=gray class=GrayFont>到期：" & RestoreTime(GetData(8,n))
			Else
				Response.Write "<font color=gray class=GrayFont>永久有效"
			End If%>	</td>
                    </tr><%
			i=i+1
			if i>DEF_MaxListNum then exit for
		next
%>
                    <tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
                      <td height="30" valign="bottom" colspan=6> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF" class=TBfour>
                          <tr> 
                            <td height="20"> 
                              <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="3">
                                <tr> 
                                  <td></td>
                                </tr>
                              </table>
                               <%=PageSplictString%></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
	<%
	Else
		Response.Write "<br>" & GBL_CHK_TempStr & "		<TR><td><br><p>没有符合条件的记录。</td></tr>" & VbCrLf
	End If

End Function
%>