<!--#include file="setup.asp" -->
<!--#include file="check.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
Dim selAdminID
Dim i,Action,strClass
Admin_header
If Not ChkAdmin("999") Then
	Server.Transfer("showerr.asp")
	Response.End
End If
Response.Write "<table cellpadding=2 cellspacing=1 border=0 class=tableBorder align=center>" & vbCrLf
Response.Write " <tr>" & vbCrLf
Response.Write " <th height=22 colspan=6>管理员操作</th>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " <tr>" & vbCrLf
Response.Write " <td class=TableRow1> <b>管理选项：</b> <a href=admin_master.asp>管理首页</a> &nbsp;<a href=admin_master.asp?action=add>添加管理员</a>"
Response.Write " </td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " </table><br>" & vbCrLf
Action = LCase(Request("action"))
Select Case Trim(Action)
Case "renew"
	Call UpdateFlag
Case "del"
	Call del
Case "pasword"
	Call pasword
Case "newpass"
	Call newpass
Case "add"
	Call addadmin
Case "edit"
	Call userinfo
Case "savenew"
	Call savenew
Case "active"
	Call ActiveLock
Case Else
	Call userlist
End Select
If FoundErr = True Then
	ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
CloseConn
Private Sub userlist()
	Response.Write "<table cellpadding=""2"" cellspacing=""1"" border=""0"" class=""tableBorder"" align=center>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <th height=22 colspan=6>管理员管理(点击用户名进行操作)</th>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr align=center>" & vbCrLf
	Response.Write "<td height=22 class=TableTitle><B>用户名</B></td>" & vbCrLf
	Response.Write "<td class=TableTitle><B>上次登陆时间</B></td>" & vbCrLf
	Response.Write "<td class=TableTitle><B>上次登陆IP</B></td>" & vbCrLf
	Response.Write "<td class=TableTitle><B>操作</B></td>" & vbCrLf
	Response.Write "<td class=TableTitle><B>状态</B></td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Set Rs = Newasp.Execute("select * from xp90com_admin888 order by Logintime desc")
	i = 0
	Do While Not Rs.EOF
		If (i mod 2) = 0 Then
			strClass = "class=TableRow1"
		Else
			strClass = "class=TableRow2"
		End If
		Response.Write " <tr>" & vbCrLf
		Response.Write " <td " & strClass & "><a href=""?id="
		Response.Write Rs("id")
		Response.Write "&action=pasword"" title='点击此处修改管理员信息'>"
		Response.Write Rs("username")
		Response.Write "</a></td>" & vbCrLf
		Response.Write "<td align=center " & strClass & ">"
		Response.Write Rs("Logintime")
		Response.Write "</td>" & vbCrLf
		Response.Write "<td align=center " & strClass & ">"
		Response.Write Rs("Loginip")
		Response.Write "</td>" & vbCrLf
		Response.Write "<td align=center " & strClass & "><a href=""?action=Active&id=" & Rs("id") & "&lock="
		If Rs("isLock") = 0 Then
			Response.Write "1"" onclick=""return confirm('您确定要锁定此管理员吗?')"">锁定管理员</a> | "
		Else
			Response.Write "0"" onclick=""return confirm('您确要激活此管理员吗?')"">激活管理员</a> | "
		End If
		Response.Write "<a href=""?action=del&id="
		Response.Write Rs("id")
		Response.Write "&name="
		Response.Write Rs("username")
		Response.Write """ onclick=""return confirm('此操作将删除该管理员\n 您确定执行此操作吗?')"">删除</a>&nbsp;|&nbsp;<a href=""?id="
		Response.Write Rs("id")
		Response.Write "&action=edit"">编辑权限</a></td>" & vbCrLf
		Response.Write "<td align=center " & strClass & ">"
		If Rs("isLock") = 0 Then
			Response.Write "正常"
		Else
			Response.Write "<font color=red>锁定<font>"
		End If
		Response.Write "</td>" & vbCrLf
		Response.Write " </tr>" & vbCrLf
		Rs.movenext
		i = i + 1
	Loop
	Rs.Close
	Set Rs = Nothing
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td colspan=""6"" align=center Class=TableRow1>" & vbCrLf
	Response.Write " <input class=""button"" type=button name=""Submit"" value=""添加管理员"" onClick=""self.location='admin_master.asp?action=add'"" >" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " </table>" & vbCrLf
End Sub
Private Sub del()
	If Trim(Request("id")) <> "" Then
		Newasp.Execute ("delete from xp90com_admin888 where username<>'" & AdminName & "' And id=" & Request("id"))
		Response.Redirect (Request.ServerVariables("HTTP_REFERER"))
	Else
		ErrMsg = "<li>错误的系统参数！</li>"
		Founderr = True
		Exit Sub
	End If
End Sub
Private Sub ActiveLock()
	If Trim(Request("lock")) <> "" And Trim(Request("id")) <> "" Then
		Newasp.Execute ("update xp90com_admin888 set isLock="&Request("lock")&" where username<>'" & AdminName & "' And id=" & Request("id"))
		Response.Redirect (Request.ServerVariables("HTTP_REFERER"))
	Else
		ErrMsg = "<li>错误的系统参数！</li>"
		Founderr = True
		Exit Sub
	End If
End Sub
Private Sub pasword()
	Dim oldpassword
	If Not ChkAdmin("9999") Then
		ErrMsg = "<li>您没有此操作权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
	Set Rs = Newasp.Execute("select * from xp90com_admin888 where id=" & Request("id"))
	oldpassword = Rs("password")
	Response.Write "<table cellpadding=""2"" cellspacing=""1"" border=""0"" class=""tableBorder"" align=center>" & vbCrLf
	Response.Write "<form action=""?action=newpass"" method=post>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <th colspan=2 height=23>管理员资料管理－－密码修改" & vbCrLf
	Response.Write " </th>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr >" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=tablerow1>后台登陆名称：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=hidden name=""oldusername"" value="""
	Response.Write Rs("username")
	Response.Write """>" & vbCrLf
	Response.Write " <input type=text size=25 name=""username2"" value="""
	Response.Write Rs("username")
	Response.Write """>" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr >" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=tablerow1>后台登陆密码：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=""password"" size=25 name=""password2"">"
	Response.Write " (如果不修改密码请留空)" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=tablerow1>管理员级别：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=radio name=AdminGrade value='0' "
	If Rs("AdminGrade") = 0 Then Response.Write " checked"
	Response.Write " > 普通管理员&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=AdminGrade value='999' "
	If Rs("AdminGrade") = 999 Then Response.Write " checked"
	Response.Write " > 高级管理员 （拥有最高权限）" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td align=""right"" class=tablerow1>是否激活管理员：</td>" & vbCrLf
	Response.Write " <td class=tablerow1>" & vbCrLf
	Response.Write " <input type=radio name=isLock value='1' "
	If Rs("isLock") = 1 Then Response.Write " checked"
	Response.Write " > 否&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=isLock value='0' "
	If Rs("isLock") = 0 Then Response.Write " checked"
	Response.Write " > 是" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td align=""right"" class=tablerow1>限制一个管理员登陆：</td>" & vbCrLf
	Response.Write " <td class=tablerow1>" & vbCrLf
	Response.Write " <input type=radio name=isAloneLogin value='0' "
	If Rs("isAloneLogin") = 0 Then Response.Write " checked"
	Response.Write " > 否&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=isAloneLogin value='1' "
	If Rs("isAloneLogin") = 1 Then Response.Write " checked"
	Response.Write " > 是" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr align=""center"">" & vbCrLf
	Response.Write " <td colspan=""2"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=hidden name=id value="""
	Response.Write Request("id")
	Response.Write """>" & vbCrLf
	Response.Write " <input type=button name=Submit4 onclick='javascript:history.go(-1)' value='返回上一页' class=Button> <input type=""submit"" name=""Submit"" value=""更 新"" class=""button"">" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " </form>" & vbCrLf
	Response.Write " </table>" & vbCrLf
Rs.Close
Set Rs = Nothing
End Sub
Private Sub newpass()
	Dim passnw
	Dim usernw
	Dim aduser
	Dim oldpassword
	If Not ChkAdmin("9999") Then
		ErrMsg = "<li>您没有此操作权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
	Set Rs = Newasp.Execute("select * from xp90com_admin888 where id=" & Request("id"))
	oldpassword = Rs("password")
	If Request("username2") = "" Then
		ErrMsg = "<li>请输入管理员名字。<a href=?>［ <font color=red>返回</font> ］</a>"
		Founderr = True
		Exit Sub
	Else
		usernw = Trim(Request("username2"))
	End If
	If Request("password2") = "" Then
		passnw = "没有修改"
	Else
		passnw = Request("password2")
	End If
	Set Rs = CreateObject("adodb.recordset")
	SQL = "select * from xp90com_admin888 where username='" & Trim(Request("oldusername")) & "'"
	Rs.Open SQL, conn, 1, 3
	If Not Rs.EOF And Not Rs.bof Then
		Rs("username") = usernw
		If Request("password2") <> "" Then Rs("password") = md5(Request("password2"))
		If CInt(Request.Form("AdminGrade")) = 999 Then
			Rs("status") = "高级管理员"
		Else
			Rs("status") = "普通管理员"
		End If
		Rs("AdminGrade") = Request.Form("AdminGrade")
		Rs("isLock") = Request.Form("isLock")
		Rs("isAloneLogin") = Request.Form("isAloneLogin")
		Succeed ("<li>管理员资料更新成功，请记住更新信息。<br> 管理员：" & Request("username2") & " <BR> 密   码：" & passnw & "")
		Rs.update
	End If
	Rs.Close
	Set Rs = Nothing	
End Sub
Private Sub addadmin()
	If Not ChkAdmin("9999") Then
		ErrMsg = "<li>您没有此操作权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
	Response.Write "<table cellpadding=""2"" cellspacing=""1"" border=""0"" class=""tableBorder"" align=center>" & vbCrLf
	Response.Write "<form action=""?action=savenew"" method=post>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <th colspan=2 height=23>管理员管理－－添加管理员" & vbCrLf
	Response.Write " </th>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr >" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=tablerow1>后台登陆名称：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=text name=""username2"">" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=tablerow1>后台登陆密码：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=""password"" name=""password2"">" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=tablerow1>管理员级别：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=radio name=AdminGrade value='0' checked> 普通管理员&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=AdminGrade value='999'> 高级管理员 （拥有最高权限）" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td align=""right"" class=tablerow1>限制一个管理员登陆：</td>" & vbCrLf
	Response.Write " <td class=tablerow1>" & vbCrLf
	Response.Write " <input type=radio name=isAloneLogin value='0' checked> 否&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=isAloneLogin value='1'> 是" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=tablerow1>是否激活管理员：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=radio name=isLock value='1' checked> 否&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=isLock value='0'> 是" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr align=""center"">" & vbCrLf
	Response.Write " <td colspan=""2"" class=tablerow1>" & vbCrLf
	Response.Write " <input type=button name=Submit4 onclick='javascript:history.go(-1)' value='返回上一页' class=Button>  <input type=""submit"" name=""Submit"" value=""添 加"" class=""button"">" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " </form>" & vbCrLf
	Response.Write " </table>" & vbCrLf
End Sub
Private Sub savenew()
	Dim adminuserid
	If Not ChkAdmin("9999") Then
		ErrMsg = "<li>您没有此操作权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
	If Request.Form("username2") = "" Then
		ErrMsg = "请输入后台登陆用户名！"
		Founderr = True
		Exit Sub
	Else
		adminuserid = Request.Form("username2")
	End If
	If Request.Form("password2") = "" Then
		ErrMsg = "请输入后台登陆密码！"
		Founderr = True
		Exit Sub
	End If
	Set Rs = Newasp.Execute("select username from xp90com_admin888 where username='" & Replace(Request.Form("username2"), "'", "") & "'")
	If Not (Rs.EOF And Rs.bof) Then
		ErrMsg = "您输入的用户名已经在管理用户中存在！"
		Founderr = True
		Exit Sub
	End If
	Set Rs = Server.CreateObject("adodb.recordset")
	SQL = "select * from xp90com_admin888 where (id is null)"
	Rs.open SQL,conn,1,3
	Rs.addnew
		Rs("username") = Replace(Request.Form("username2"), "'", "")
		If CInt(Request.Form("AdminGrade")) = 999 Then
			Rs("status") = "高级管理员"
		Else
			Rs("status") = "普通管理员"
		End If
		Rs("password") = md5(Request.Form("password2"))
		Rs("isLock") = Request.Form("isLock")
		Rs("AdminGrade") = Request.Form("AdminGrade")
		Rs("Adminflag") = ",,,,,,,,,,,,,,,"
		Rs("LoginTime") = Now()
		Rs("Loginip") = Newasp.GetUserIP
		Rs("RandomCode") = Newasp.GetRandomCode
		Rs("isAloneLogin") = Request.Form("isAloneLogin")
	Rs.update
	Rs.close:set Rs=Nothing
	Succeed ("用户ID:" & adminuserid & " 添加成功，请到管理员管理给予相应的权限，如需修改请返回管理员管理！")
End Sub
Private Sub userinfo()
	Dim Adminflag,rsChannel
	Dim ChanID,ModuleName,strModules
	Set Rs = Newasp.Execute("SELECT id,Adminflag FROM xp90com_admin888 WHERE id=" & Request("id"))
	Adminflag = Rs("Adminflag")
	Rs.Close
	Set Rs = Nothing
%>
<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
	<th colspan=6>管理员权限管理(请选择相应的权限分配给管理员)</th>
</tr>
<form name=myform method=post action=?action=renew>
<input type=hidden name=id value="<%=Request("id")%>">
<tr>
	<td class=tablerow2 colspan=6>&nbsp;<b>常规设置</b></td>
</tr>
<tr>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="SiteConfig" <%If InStr(Adminflag, "SiteConfig") <> 0 Then Response.Write "checked"%>> 基本设置</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Advertise" <%If InStr(Adminflag, "Advertise") <> 0 Then Response.Write "checked"%>> 广告管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Channel" <%If InStr(Adminflag, "Channel") <> 0 Then Response.Write "checked"%>> 频道设置</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Template" <%If InStr(Adminflag, "Template") <> 0 Then Response.Write "checked"%>> 模板管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="TemplateLoad" <%If InStr(Adminflag, "TemplateLoad") <> 0 Then Response.Write "checked"%>> 模板导入、导出</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Announce" <%If InStr(Adminflag, "Announce") <> 0 Then Response.Write "checked"%>> 公告管理</td>
</tr>
<tr>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="AdminLog" <%If InStr(Adminflag, "AdminLog") <> 0 Then Response.Write "checked"%>> 日志管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="SendMessage" <%If InStr(Adminflag, "SendMessage") <> 0 Then Response.Write "checked"%>> 发送信息</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="CreateIndex" <%If InStr(Adminflag, "CreateIndex") <> 0 Then Response.Write "checked"%>> 生成首页</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="CustomLabel" <%If InStr(Adminflag, "CustomLabel") <> 0 Then Response.Write "checked"%>> 自定义标签</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Classad" <%If InStr(Adminflag, "Classad") <> 0 Then Response.Write "checked"%>> 分类广告管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Admin_Card" <%If InStr(Adminflag, "Admin_Card") <> 0 Then Response.Write "checked"%>> 充值卡管理</td>
</tr>
<%
	Set rsChannel = Newasp.Execute("SELECT ChannelID,ChannelName,modules,ModuleName FROM xp90com_Channel WHERE StopChannel = 0 And ChannelID <> 4 And ChannelType < 2 Order By orders Asc")
	Do While Not rsChannel.EOF
	ChanID = rsChannel("ChannelID")
	Select Case rsChannel("modules")
		Case 1:strModules = "Article"
		Case 2:strModules = "Soft"
		Case 3:strModules = "Shop"
		Case 5:strModules = "Flash"
	Case Else
		strModules = "Article"
	End Select
%>
<tr>
	<td class=tablerow2 colspan=6>&nbsp;<b><%=rsChannel("ChannelName")%></b></td>
</tr>
<tr>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Add<%=strModules & ChanID%>" <%If InStr(Adminflag, "Add" & strModules & ChanID) <> 0 Then Response.Write "checked"%>> 添加<%=rsChannel("ModuleName")%></td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Admin<%=strModules & ChanID%>" <%If InStr(Adminflag, "Admin" & strModules & ChanID) <> 0 Then Response.Write "checked"%>> <%=rsChannel("ModuleName")%>管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="AdminClass<%=ChanID%>" <%If InStr(Adminflag, "AdminClass" & ChanID) <> 0 Then Response.Write "checked"%>> <%=rsChannel("ModuleName")%>分类管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Special<%=ChanID%>" <%If InStr(Adminflag, "Special" & ChanID) <> 0 Then Response.Write "checked"%>> <%=rsChannel("ModuleName")%>专题管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Create<%=strModules & ChanID%>" <%If InStr(Adminflag, "Create" & strModules & ChanID) <> 0 Then Response.Write "checked"%>> 生成HTML管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Comment<%=ChanID%>" <%If InStr(Adminflag, "Comment" & ChanID) <> 0 Then Response.Write "checked"%>> <%=rsChannel("ModuleName")%>评论管理</td>
</tr>
<tr>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="AdminJsFile<%=ChanID%>" <%If InStr(Adminflag, "AdminJsFile" & ChanID) <> 0 Then Response.Write "checked"%>> JS文件管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="AdminUpload<%=ChanID%>" <%If InStr(Adminflag, "AdminUpload" & ChanID) <> 0 Then Response.Write "checked"%>> 上传文件管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="AdminSelect<%=ChanID%>" <%If InStr(Adminflag, "AdminSelect" & ChanID) <> 0 Then Response.Write "checked"%>> 选择上传文件</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Auditing<%=ChanID%>" <%If InStr(Adminflag, "Auditing" & ChanID) <> 0 Then Response.Write "checked"%>>  <%=rsChannel("ModuleName")%>审核管理</td>
	<td class=tablerow1><%If rsChannel("modules") = 2 Or rsChannel("modules") = 5 Then%><input type="checkbox" name="Adminflag" value="DownServer<%=ChanID%>" <%If InStr(Adminflag, "DownServer" & ChanID) <> 0 Then Response.Write "checked"%>> 下载服务器管理<%End If%></td>
	<td class=tablerow1><%If rsChannel("modules") = 2 Then%><input type="checkbox" name="Adminflag" value="ErrorSoft<%=ChanID%>" <%If InStr(Adminflag, "ErrorSoft" & ChanID) <> 0 Then Response.Write "checked"%>> 错误软件报告<%End If%></td>
</tr>
<%
		rsChannel.movenext
	Loop
	Set rsChannel = Nothing
%>
<tr>
	<td class=tablerow2 colspan=6>&nbsp;<b>用户管理</b></td>
</tr>
<tr>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="AddUser" <%If InStr(Adminflag, "AddUser") <> 0 Then Response.Write "checked"%>> 添加会员</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="AdminUser" <%If InStr(Adminflag, "AdminUser") <> 0 Then Response.Write "checked"%>> 会员管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="ChangePassword" <%If InStr(Adminflag, "ChangePassword") <> 0 Then Response.Write "checked"%>> 修改管理员密码</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="UserGroup" <%If InStr(Adminflag, "UserGroup") <> 0 Then Response.Write "checked"%>> 用户组管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="MainList" <%If InStr(Adminflag, "MainList") <> 0 Then Response.Write "checked"%>> 邮件列表管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="FlashCollect" <%If InStr(Adminflag, "FlashCollect") <> 0 Then Response.Write "checked"%>> 动画采集</td>
</tr>
<tr>
	<td class=tablerow2 colspan=6>&nbsp;<b>其它管理</b></td>
</tr>
<tr>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Online" <%If InStr(Adminflag, "Online") <> 0 Then Response.Write "checked"%>> 在线统计管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="Vote" <%If InStr(Adminflag, "Vote") <> 0 Then Response.Write "checked"%>> 投票管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="FriendLink" <%If InStr(Adminflag, "FriendLink") <> 0 Then Response.Write "checked"%>> 友情连接管理</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="ArticleCollect" <%If InStr(Adminflag, "ArticleCollect") <> 0 Then Response.Write "checked"%>> 文章采集</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="SoftCollect" <%If InStr(Adminflag, "SoftCollect") <> 0 Then Response.Write "checked"%>> 软件采集</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="UploadFile" <%If InStr(Adminflag, "UploadFile") <> 0 Then Response.Write "checked"%>> 上传文件</td>
</tr>
<tr>
	<td class=tablerow2 colspan=6>&nbsp;<b>数据库处理</b></td>
</tr>
<tr>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="RenameData" <%If InStr(Adminflag, "RenameData") <> 0 Then Response.Write "checked"%>> 数据库更名</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="BackupData" <%If InStr(Adminflag, "BackupData") <> 0 Then Response.Write "checked"%>> 数据库备份</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="RestoreData" <%If InStr(Adminflag, "RestoreData") <> 0 Then Response.Write "checked"%>> 数据库恢复</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="CompressData" <%If InStr(Adminflag, "CompressData") <> 0 Then Response.Write "checked"%>> 数据库压缩</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="SpaceSize" <%If InStr(Adminflag, "SpaceSize") <> 0 Then Response.Write "checked"%>> 系统空间占用</td>
	<td class=tablerow1><input type="checkbox" name="Adminflag" value="BatchReplace" <%If InStr(Adminflag, "BatchReplace") <> 0 Then Response.Write "checked"%>> 批量替换</td>
</tr>
<tr>
	<td class=tablerow2 colspan=6 align=center><input type=button name=Submit4 onclick='javascript:history.go(-1)' value='返回上一页' class=Button> 　　<input class=Button type=button name=chkall value='全选' onClick='CheckAll(this.form)'><input class=Button type=button name=chksel value='反选' onClick='ContraSel(this.form)'>
	<input type="submit" name="Submit" value="更新管理员权限" class=button></td>
</tr>
</form>
</table>
<%
End Sub
Private Sub UpdateFlag()
	Set Rs = Server.CreateObject("adodb.recordset")
	SQL = "SELECT * FROM xp90com_admin888 WHERE id=" & Request("id")
	Rs.Open SQL, conn, 1, 3
	If Not (Rs.EOF And Rs.BOF) Then
		Rs("Adminflag") = Replace(Replace(Request("Adminflag"), "'", ""), " ", "")
		Rs.update
	End If
	Rs.Close
	Set Rs = Nothing
	Sucmsg = "<li>管理员更新成功，请记住更新信息。"
	Succeed (Sucmsg)
End Sub
%>
