<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->
<!-- #include file=xzconn.asp -->

<%
Response.Buffer=True
DEF_BBS_HomeUrl = "../../"
const npage = 2
GBL_CHK_TempStr=""
OpenDatabase
CheckUserOnline
dim rs,nm
	Dim Temp
	If GBL_SiteHeadString = "" and GBL_SiteBottomString = "" Then
		'针对多个版面不同风格需求 Temp = Left(Request.Cookies(DEF_MasterCookies & "style")("border" & GBL_board_ID),14)
		Temp = Left(Request.Cookies(DEF_MasterCookies & "style")("border"),14)
		If isNumeric(Temp) = 0 or Temp="" Then Temp = -1
		Temp = cCur(Temp)
		If Temp >= 0 and Temp <= DEF_BoardStyleStringNum Then GBL_Board_BoardStyle = Temp
	End If

	If GBL_Board_BoardStyle > DEF_BoardStyleStringNum Then GBL_Board_BoardStyle = DEF_BoardStyleStringNum
	GBL_Board_BoardStyle = cCur(GBL_Board_BoardStyle)

	Temp = application(DEF_MasterCookies & "Style" & GBL_Board_BoardStyle)
	If isArray(Temp) = False Then
		If Temp & "" <> "yes" Then
			If GBL_ConFlag = 1 Then ReloadBoardStyleInfo(GBL_Board_BoardStyle)
			Temp = application(DEF_MasterCookies & "Style" & GBL_Board_BoardStyle)
		End If
	End If
	If isArray(Temp) = True Then
		DEF_BBS_ScreenWidth = RTrim(Temp(1,0))
		DEF_BBS_DisplayTopicLength = Temp(2,0)
		GBL_DefineImage = Temp(3,0)
		If GBL_DefineImage = True or GBL_DefineImage = 1 Then
			GBL_DefineImage = "Skin/" & GBL_Board_BoardStyle & "/"
		Else
			GBL_DefineImage = ""
		End If
		If GBL_SiteHeadString = "" Then GBL_SiteHeadString = Temp(4,0)
		If GBL_SiteBottomString = "" Then GBL_SiteBottomString = Temp(5,0)
		GBL_TableHeadString = Temp(6,0)
		GBL_TableBottomString = Temp(7,0)
		GBL_ShowBottomSure = Temp(8,0)
		GBL_TempletID = cCur("0" & Temp(9,0))
		GBL_TempletFlag = cCur("0" & Temp(10,0))
	End If

%>
<html>
<head>
	<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
	<meta http-equiv="Content-Language" content="zh-cn">
	<META name="description" content="无翼天空">
	<title>
	</title>
	<link rel="stylesheet" type="text/css" href="<%=DEF_BBS_homeUrl%>inc/style<%=GBL_Board_BoardStyle%>.css">
	<style>
	<!--
		.l {FONT-FAMILY: 宋体; FONT-SIZE: 12px;}
		table {WORD-BREAK: break-all;}
	-->
	</style>
</head>
<body bgcolor="<%=DEF_BBS_LightestColor%>" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class=TBBGbody>
<%
	if CheckSupervisorUserName <> 1 then
		response.write "<CENTER><table width="&DEF_BBS_ScreenWidth&" border='0' cellspacing='1' cellpadding='4' class=TBone ><tr><td width= 100% valign=center align=middle height=27 class=TBHead><font color=red><b>本页面为管理员使用，您无权访问此页面！</b></font></td></tr></table></CENTER>"
	else
%>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td align=center colspan=8 height=23  class=TBHead><b><a href=xzup_admin.asp><font class=HeadFont><b>颁发勋章</b></font></a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=xzup_admin.asp?action=delxz><font class=HeadFont><b>取消勋章</b></font></a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href=xzup_admin.asp?action=pass><font class=HeadFont><b>查看勋章申请</b></font></a></b></td>
</tr>
<%if request("action")="" then
		UserBrowser

elseif request("action")="modify" then
dim username,xzrs,xzname
username=request("username")
%>
<FORM name="form1" METHOD=POST ACTION="?action=saveuserinfo"  onSubmit="return checkdata();">
<tr class=tbbg9>
<td width=80% class=forumrow colspan=8>
<input name="username" type="hidden" value=<%=username%>>
您将给<font color=red><%=username%></font>颁发一枚<select size=1 name="xzkind">
<%
set xzrs=xzconn.execute("select xzname,xzid from xzdata")
response.write "<option value=0>请选择勋章</option>"
do while not xzrs.eof
xzname=xzrs("xzname")
response.write "<option value="&xzrs("xzid")
response.write ">"&xzname&"</option>"
xzrs.movenext
loop
xzrs.close
set xzrs=nothing
%>
</select>
勋章<br>执行理由是：<input type="text" name="xzwhy" size=50>
</td>

</tr>
<tr class=tbbg9>
<td width=100% class=forumrow align=center colspan=8><input name="submit" type=submit value="颁发"></td>
</tr>
</FORM>
<script language="JavaScript">
<!--
function checkdata() {
if( form1.xzkind.value =="0") {
alert("\请选择颁发勋章的名称 !!")
 form1.xzkind.focus();
return false;
}
if( form1.xzwhy.value =="") {
alert("\请输入执行理由 !!")
 form1.xzwhy.focus();
return false;
}
return true;
}
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
	TempChar= InString.substring (Count, Count+1);
	if (RefString.indexOf (TempChar, 0)==-1)  
	return (false);
}
return (true);
}

// -->
</script>

<%
elseif request("action")="saveuserinfo" then
dim xzkind,xzwhy
username=request("username")
xzkind=request("xzkind")
xzwhy=request("xzwhy")
set xzrs=xzconn.execute("select * from xzuser where username='"&username&"' and xzkind='"&xzkind&"'")
if not xzrs.eof then
		response.write "<CENTER><table width="&DEF_BBS_ScreenWidth&" border='0' cellspacing='1' cellpadding='4' class=TBone ><tr><td width= 100% valign=center align=middle height=27 class=TBHead><font color=red><b>更新失败！老大，你别玩我了，这位兄弟已经获得此勋章了</b></font></td></tr></table></CENTER>"
else
dim pass
pass="1"
	xzconn.execute "insert into xz_log values('"& now()&"','"& username &"','"& GBL_CHK_User & "','"&xzkind&"','颁发','"&xzwhy&"')"
	xzconn.execute "insert into xzuser(username,xzkind,pass) values('"&username&"','"&xzkind&"','"&pass&"')"
	'发送论坛短消息
	dim rsaa,rsasqla
	Set Rsaa=Server.CreateObject("ADODB.RecordSet")
			rsasqla="select xzname from xzdata where xzid="&xzkind
	Rsaa.Open rsaSQLa,xzConn,1,1
	dim bfname
    bfname=rsaa("xzname")
	rsaa.close
	dim msgtitle,msgbody,sqla
	msgtitle=DEF_BBS_Name&"勋章服务。"
    msgbody="“"&username&"”你好，社区勋章中心给你颁发了一枚勋章“"&bfname&"”，"&chr(10)&"继续努力哦。"
	sqla="insert into LeadBBS_InfoBox(FromUser,ToUser,title,content,sendtime,ReadFlag) values('"&DEF_BBS_Name&"','"&username&"','"&msgtitle&"','"&msgbody&"',Now(),0)"
	con.Execute sqla
	con.execute("update leadbbs_user set messageflag=1 where username='"&username&"'")
	'短消息结束
		response.write "<CENTER><table width="&DEF_BBS_ScreenWidth&" border='0' cellspacing='1' cellpadding='4' class=TBone ><tr><td width= 100% valign=center align=middle height=27 class=TBHead><font color=red><b>勋章颁发成功！！！</b></font></td></tr></table></CENTER>"
end if
xzrs.close
elseif request("action")="deluserinfo" then
dim xzid
username=request("username")
xzkind=request("xzkind")
xzwhy=request("xzwhy")
xzid=request("xzid")
	xzconn.execute "insert into xz_log values('"& now()&"','"& username &"','"& GBL_CHK_User & "','"&xzkind&"','取消','"&xzwhy&"')"
	xzconn.execute "delete * from xzuser where id="&xzid
		response.write "<CENTER><table width="&DEF_BBS_ScreenWidth&" border='0' cellspacing='1' cellpadding='4' class=TBone ><tr><td width= 100% valign=center align=middle height=27 class=TBHead><font color=red><b>勋章取消成功！！！</b></font></td></tr></table></CENTER>"

elseif request("action")="delxz" then
delxz
elseif request("action")="del" then
set rs=xzconn.execute("select * from xzuser where id="&request("id"))
username=rs("username")
xzkind=rs("xzkind")
if rs.eof then
		response.write "<CENTER><table width="&DEF_BBS_ScreenWidth&" border='0' cellspacing='1' cellpadding='4' class=TBone ><tr><td width= 100% valign=center align=middle height=27 class=TBHead><font color=red><b>错误！该用户并为颁发此勋章！</b></font></td></tr></table></CENTER>"
else
		%>
		<FORM name="form1" METHOD=POST ACTION="?action=deluserinfo"  onSubmit="return checkdata();">
<tr class=tbbg9>
<td width=80% class=forumrow colspan=8>
<input name="username" type="hidden" value=<%=username%>>
您将给<font color=red><%=username%></font>取消
<%
set xzrs=xzconn.execute("select * from xzdata where xzid="&xzkind)
if not xzrs.eof then
xzname=xzrs("xzname")
response.write "<font color=red>"&xzname&"</font>"
xzrs.close
set xzrs=nothing
end if
%>
勋章<br>执行理由是：<input type="text" name="xzwhy" size=50>
<input name="xzid" type="hidden" value=<%=request("id")%>>
<input name="xzkind" type="hidden" value=<%=xzkind%>>
</td>

</tr>
<tr class=tbbg9>
<td width=100% class=forumrow align=center colspan=8><input name="submit" type=submit value="取消"></td>
</tr>
</FORM>
<script language="JavaScript">
<!--
function checkdata() {
if( form1.xzwhy.value =="") {
alert("\请输入执行理由 !!")
 form1.xzwhy.focus();
return false;
}
return true;
}
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
	TempChar= InString.substring (Count, Count+1);
	if (RefString.indexOf (TempChar, 0)==-1)  
	return (false);
}
return (true);
}

// -->
</script>

		<%
end if

end if
%>
<tr><td colspan=5 class=forumrow>
</td></tr>
</table>
<%
if request("action")="pass" then
dim rsa,rsasql
Set Rsa=Server.CreateObject("ADODB.RecordSet")
			rsasql="select pass,username,xzliyou,xzkind,addtime from xzuser where pass like '0' order by id desc;"
	Rsa.Open rsaSQL,xzConn,1,1
%>
<table width="100%" border="0" align="center" cellpadding="6" cellspacing="1"  class=TBone>

<tr align=center  class=tbbg9> 
<td class=TBHead><font class=HeadFont><b>日期时间</b></font></td>
<td class=TBHead><font class=HeadFont><b>申请者</b></font></td>
<td class=TBHead><font class=HeadFont><b>对应勋章</b></font></td>
<td class=TBHead><font class=HeadFont><b>原因</b></font></td>
<td class=TBHead><font class=HeadFont><b>审核</b></font></td>
</tr>
<%
if rsa.eof then
response.write"<tr><td colspan=5 class=tbbg9 align=center><font color=red><b>　没有需要审核的勋章申请。</b></font></td></tr>"
else
	       '分页代码开始
	dim pagecount,fen,count,totalpage
	   fen=8'设置每页要显示的记录条数
       Count=RSa.RecordCount
       If Count/fen > (Count\fen) then
       TotalPage=(Count\fen)+1 
       else 
	   TotalPage=(Count\fen)
       End If

       PageCount= 0
       RSa.MoveFirst
       if Request("Page")<>"" then PageCount = cint(Request("Page"))
       if PageCount <1 then PageCount = 1
       if PageCount > TotalPage then PageCount = TotalPage
	   RSa.Move (PageCount-1) * fen
       '分页代码结束
dim rsb,rsbsql,a
a=0
while not rsa.eof and a<fen
Set Rsb=Server.CreateObject("ADODB.RecordSet")
			rsbsql="select xzname,xzsm from xzdata where xzid="&rsa("xzkind")
	Rsb.Open rsbSQL,xzConn,1,1
%>
<tr class=tbbg9>
<td class=tablebody1 width=150><%=Mid(rsa("addtime"),1,10)%></td>
<td align=center width=100><%=rsa("username")%></td>
<td align=center width=100><img border=0 src="pic/<%=rsa("xzkind")%>.gif" title=<%=rsb("xzname")%>：<%=rsb("xzsm")%>></td>
<td align=center width=100><%=rsa("xzliyou")%></td>
<td align=center width=100><a href=xzup_admin.asp?action=userpass&pass=yes&name=<%=rsa("username")%>&xzid=<%=rsa("xzkind")%>>通过</a>&nbsp;&nbsp;<a href=xzup_admin.asp?action=userpass&pass=NO&name=<%=rsa("username")%>&xzid=<%=rsa("xzkind")%>>取消</a></td>
</tr>
<%
a=a+1
rsa.movenext
wend
rsb.close
set rsb=nothing
%><tr>
    <td colspan=6 class=tbbg9><%if pagecount=1 then%><font color=darkgray>首页&nbsp;上一页</font><%else%><a href=xzup_admin.asp?page=1&action=pass>首页</a>&nbsp;
			<a href=xzup_admin.asp?page=<%=pagecount-1%>&action=pass>上一页</a><%end if%>&nbsp;
			<%if pagecount=totalpage then%><font color=darkgray>下一页&nbsp;尾页</font><%else%><a href=xzup_admin.asp?page=<%=pagecount+1%>&action=pass>下一页</a>&nbsp;
			<a href=xzup_admin.asp?page=<%=TotalPage%>&action=pass>尾页</a><%end if%>&nbsp;
			&nbsp;共&nbsp;<b><%=Count%></b>&nbsp;条信息&nbsp;&nbsp;第&nbsp;<b><%=PageCount%></b>/<b><%=TotalPage%></b>&nbsp;页&nbsp;&nbsp;每页<b><%=fen%></b>条</td>
</tr></table>
<%
end if
rsa.close
set rsa=nothing
elseif request("action")="userpass" then
   Userpass
end if

END IF

Function Userpass
    dim rsa,rsasql,pass,xz_pos,xzid,names
	xzid=trim(request("xzid"))
	names=trim(request("name"))
	pass="1"
  if request("pass")="yes" then
	xz_pos="申请通过审核"
	Set Rsa=Server.CreateObject("ADODB.RecordSet")
			rsasql="select pass,username,xzkind from xzuser where username='"&names&"' and xzkind='"&xzid&"';"
	Rsa.Open rsaSQL,xzConn,1,3
	if not rsa.eof then
	rsa("pass")=trim(pass)
	rsa.update
	rsa.close
	else
    response.write"老大,此人并没有申请此勋章啊"
	response.end
	end if
	Set Rsa=Server.CreateObject("ADODB.RecordSet")
			rsasql="select xz_pos,xz_user,xz_date from xz_log where xz_owner='"&names&"' and xz_level="&xzid
	Rsa.Open rsaSQL,xzConn,1,3
	if not rsa.eof then
	rsa("xz_date")=now()
	rsa("xz_user")=GBL_CHK_User
	rsa("xz_pos")=trim(xz_pos)
	rsa.update
	end if
	rsa.close
	Set Rsa=Server.CreateObject("ADODB.RecordSet")
			rsasql="select xzname from xzdata where xzid="&xzid
	Rsa.Open rsaSQL,xzConn,1,1
	dim xzname
    xzname=rsa("xzname")
	rsa.close
	dim msgtitle,msgbody,sqla
	msgtitle=DEF_BBS_Name&"申请勋章服务。"
    msgbody="“"&names&"”你好，你申请的勋章“"&xzname&"”，"&chr(10)&"已经通过管理员的审核，继续努力哦。"
	sqla="insert into LeadBBS_InfoBox(FromUser,ToUser,title,content,sendtime,ReadFlag) values('"&DEF_BBS_Name&"','"&names&"','"&msgtitle&"','"&msgbody&"',Now(),0)"
	con.Execute sqla
	con.execute("update leadbbs_user set messageflag=1 where username='"&names&"'")
	response.write "成功通过审核"
  elseif request("pass")="NO" then
    xz_pos="申请未通过审核"
    Set Rsa=Server.CreateObject("ADODB.RecordSet")
			rsasql="select pass,username,xzkind from xzuser where username='"&names&"' and xzkind='"&xzid&"';"
	Rsa.Open rsaSQL,xzConn,1,3
	if not rsa.eof then
    rsa.delete
	end if
	rsa.close
    Set Rsa=Server.CreateObject("ADODB.RecordSet")
			rsasql="select xz_pos,xz_user,xz_date from xz_log where xz_owner='"&names&"' and xz_level="&xzid
	Rsa.Open rsaSQL,xzConn,1,3
    if not rsa.eof then
    rsa("xz_date")=now()
	rsa("xz_user")=GBL_CHK_User
	rsa("xz_pos")=trim(xz_pos)
	rsa.update
	end if
	rsa.close
	response.write "成功取消审核"
  end if
End Function

Function UserBrowser
	GBL_CHK_TempStr=""
	Dim Rs,SQL
	Dim UpDownPageFlag
	UpDownPageFlag = Request("UpDownPageFlag")
	Dim Start,recordCount,key
	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=""
	whereFlag = 0

	If key<>"" Then
		If whereFlag = 1 Then
			SQLendString = SQLendString & " and LeadBBS_User.UserName='" & Replace(key,"'","''") & "'"
		Else
			SQLendString = SQLendString & " where LeadBBS_User.UserName='" & Replace(key,"'","''") & "'"
			whereFlag = 1
		End If
	End If
	SQLCountString = SQLendString
	Dim MaxRecordID,MinRecordID
	MaxRecordID = 0
	MinRecordID = 0
	DEF_MaxListNum =15
	Dim FirstID,LastID	
	If key="" Then
		If UpDownPageFlag = "1" and Start>0 then
			If whereFlag = 1 Then
				SQLendString = SQLendString & " and LeadBBS_User.ID<" & Start
			Else
				SQLendString = SQLendString & " where LeadBBS_User.ID<" & Start
				whereFlag = 1
			End If
		Else
			If whereFlag = 1 Then
				SQLendString = SQLendString & " and LeadBBS_User.ID>" & Start
			Else
				SQLendString = SQLendString & " where LeadBBS_User.ID>" & Start
				whereFlag = 1
			End If
		end If
	
		If UpDownPageFlag = "1" then
			SQLendString = SQLendString & " Order by  LeadBBS_User.ID DESC"
		Else
			SQLendString = SQLendString & " Order by  LeadBBS_User.ID ASC"
		End If
	
		SQL = "select Max(id) from LeadBBS_User " & 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_User " & 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
		SQL = "select UserCount from LeadBBS_SiteInfo"
		Set Rs = Con.ExeCute(SQL)
		GBL_DBNum = GBL_DBNum + 1
		If Rs.Eof then
			recordCount=0
		Else
			recordCount=cCur(rs(0))
			If recordCount="" or isNull(recordCount) or len(recordCount)<1 Then recordCount=0
		End If
		Rs.Close
		Set Rs = Nothing
	Else
		
	End If
	
	SQL = "select TOP "&DEF_MaxListNum&" LeadBBS_User.ID,LeadBBS_User.UserName,LeadBBS_User.Points,LeadBBS_User.ApplyTime,LeadBBS_User.Prevtime,LeadBBS_User.onlinetime,LeadBBS_User.announcenum,LeadBBS_User.announcetopic,LeadBBS_User.charmpoint from LeadBBS_User " & 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
		If Num > Recordcount Then RecordCount = Num
	Else
		Num = 0
	End If
	Rs.close
	Set Rs = Nothing
	
	Dim i,N
	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 = "?GBL_CTG_ID=0"
	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=xzup_admin.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=xzup_admin.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=xzup_admin.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=xzup_admin.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=xzup_admin.asp><input size=6 name=key value=" & chr(34) & htmlencode(key) & """ class=fminpt><input type=submit name=submit value=搜 class=fmbtn>[请输全名]</td></form></tr></table>"
	%><br><br>
	<script language=javascript>
	function opw(f,r,id)
	{
		window.open(f+'&'+r+'='+id,'','width=450,height=37,scrollbars=auto,status=yes');
	}
	</script>
	<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="<%=DEF_BBS_LightColor%>" class=TBBG1>
	<tr bgcolor=<%=DEF_BBS_TableHeadColor%> class=TBfour> 
		<td height="30" valign="top" colspan=9> 
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<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 bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9>
		<td wdith=15%><b>ID</b></td>
		<td wdith=30%><b>名称</b></td>
		<td wdith=15%><b><%=DEF_PointsName%></b></td>
		<td wdith=15%><b>在线时间</b></td>
		<td wdith=15%><b>魅力</b></td>
		<td wdith=15%><b>帖子数</b></td>
		<td wdith=15%><b>主题数</b></td>
		<td wdith=20%><b>注册时间</b></td>
		<td wdith=20%><b>最后登录</b></td>
	</tr>
<%
		For N = MinN to MaxN Step StepValue
			%>
	<tr bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9>
		<td height="20"><%=GetData(0,n)%></td>
		<td>
  			<a href=<%=DEF_BBS_HomeUrl%>Plug-ins/xunzhang/xzindex.asp?menu=5&name=<%=htmlencode(GetData(1,n))%> target=_parent><%=htmlencode(GetData(1,n))%></a>
  			<a href=?action=modify&username=<%=GetData(1,n)%> title=为此用户颁发勋章><font color=008800 class=GreenFont>颁发勋章</font></a>
		</td>
		<td><%=GetData(2,n)%></td>
		<td><%=CLng(cCur(GetData(5,n))/60)%></td>
		<td><%=GetData(8,n)%></td>
		<td><%=GetData(6,n)%></td>
		<td><%=GetData(7,n)%></td>
		<td><%=RestoreTime(Left(GetData(3,n),8))%></td>
		<td><%=RestoreTime(Left(GetData(4,n),8))%></td>
	</tr><%
			i = i+1
			If i > DEF_MaxListNum then Exit For
		next
%>
	<tr bgcolor=<%=DEF_BBS_TableHeadColor%> class=TBfour>
		<td height="30" valign="bottom" colspan=9>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<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



Function delxz
%>
<table width='100%' border='0' cellspacing='1' cellpadding='4' class=TBone>
<tr  align=center  class=tbbg9>
<td class=TBHead>
<font class=HeadFont><b>姓名</b></font>
</td>
<td class=TBHead>
<font class=HeadFont><b>勋章一</b></font>
</td>
<td class=TBHead>
<font class=HeadFont><b>勋章二</b></font>
</td>
<td class=TBHead>
<font class=HeadFont><b>勋章三</b></font>
</td>
<td class=TBHead>
<font class=HeadFont><b>勋章四</b></font>
</td>
<td class=TBHead>
<font class=HeadFont><b>勋章五</b></font>
</td>
</tr>
<%
dim sql,TotalRec,pass
Set Rs=Server.CreateObject("ADODB.RecordSet")
			sql="select distinct username from xzuser where pass like '1';"

	If Not IsObject(xzConn) Then ConnectionDatabase
	Rs.Open SQL,xzConn,1,1
	If Not Rs.Eof Then TotalRec=Rs.RecordCount

	If Rs.Eof And Rs.Bof Then
		response.write "<tr><td align=center colspan=6 class=tbbg9>　　还没有任何用户数据。</font></td></tr>"
	Else
	       '分页代码开始
	dim pagecount,fen,count,totalpage
	   fen=4'设置每页要显示的记录条数
       Count=RS.RecordCount
       If Count/fen > (Count\fen) then
       TotalPage=(Count\fen)+1 
       else 
	   TotalPage=(Count\fen)
       End If

       PageCount= 0
       RS.MoveFirst
       if Request("Page")<>"" then PageCount = cint(Request("Page"))
       if PageCount <1 then PageCount = 1
       if PageCount > TotalPage then PageCount = TotalPage
	   RS.Move (PageCount-1) * fen
       '分页代码结束

	dim a
	a=0
	do while not Rs.Eof and a<fen
%>
<tr class=tbbg9>
<td align=left width=20%>&nbsp;<a href=<%=DEF_BBS_HomeUrl%>User/LookUserInfo.asp?name=<%=rs("username")%> target=_blank><%=rs("username")%></a></td>

<%
dim xzkindrs,xzrs,xzid,xzname,xzsm,xzpicurl,xzdata,xzq


		set xzkindrs=xzconn.execute("select top 5 * from xzuser where username='"&rs("username")&"' and pass like '1'")
		dim i
		i=0
		do while not xzkindrs.eof
		i=i+1
        response.write "<td align=center width=16% >"
        response.write "<table><tr><td align=center>"
		xzq=xzkindrs("xzkind")
                if xzq<>"0" then
		set xzrs=xzconn.execute("select * from xzdata where xzid="&xzq)
		xzid=xzrs("xzid")
		xzname=xzrs("xzname")
		xzsm=xzrs("xzsm")
		xzpicurl=xzrs("xzpicurl")
		response.write "<img src=pic/"&xzrs("xzpicurl")&" title="&xzsm&">"
        response.write "</td></tr><tr><td align=center>"
        response.write ""&xzname&""
	If CheckSupervisorUserName = 1 Then
        response.write "</td></tr><tr><td align=center>"
        response.write "<a href=xzup_admin.asp?action=del&id="&xzkindrs("id")&"><font color=red>取消勋章</font></a>"
    end if
        response.write "</td></tr></table></td>"
        end if
	    xzkindrs.movenext
	    loop
        xzkindrs.close
		do while i<5
		i=i+1
        response.write "<td align=center width=16% > </td>"
		loop

    
%>
</tr>
<%
a=a+1
rs.movenext
loop
rs.close
%>
<tr>
    <td colspan=6 class=tbbg9><%if pagecount=1 then%><font color=darkgray>首页&nbsp;上一页</font><%else%><a href=xzup_admin.asp?page=1&action=delxz>首页</a>&nbsp;
			<a href=xzup_admin.asp?page=<%=pagecount-1%>&action=delxz>上一页</a><%end if%>&nbsp;
			<%if pagecount=totalpage then%><font color=darkgray>下一页&nbsp;尾页</font><%else%><a href=xzup_admin.asp?page=<%=pagecount+1%>&action=delxz>下一页</a>&nbsp;
			<a href=xzup_admin.asp?page=<%=TotalPage%>&action=delxz>尾页</a><%end if%>&nbsp;
			&nbsp;共&nbsp;<b><%=Count%></b>&nbsp;条信息&nbsp;&nbsp;第&nbsp;<b><%=PageCount%></b>/<b><%=TotalPage%></b>&nbsp;页&nbsp;&nbsp;每页<b><%=fen%></b>条</td>
</tr>
<%end if%>
</table>
<%
End Function
%>



