<!--#include file="setup.asp" -->
<!--#include file="../inc/md5.asp"-->
<!--#include file="myadmin.asp"-->
<%
Dim selAdminID
Dim i
Response.Write "<script language=""JavaScript"">" & vbCrLf
Response.Write "<!--" & vbCrLf
Response.Write "function CheckAll(form)" & vbCrLf
Response.Write " {" & vbCrLf
Response.Write " for (var i=0;i<form.elements.length;i++)" & vbCrLf
Response.Write " {" & vbCrLf
Response.Write " var e = form.elements[i];" & vbCrLf
Response.Write " if (e.name != 'chkall')" & vbCrLf
Response.Write " e.checked = form.chkall.checked;" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write "function SelectAll() {" & vbCrLf
Response.Write "for (var i=0;i<document.selform.selAdminID.length;i++) {" & vbCrLf
Response.Write "var e=document.selform.selAdminID[i];" & vbCrLf
Response.Write "e.checked=!e.checked;" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "//-->"
Response.Write "</script>" & vbCrLf
NC_Admin.AdminChk = "43"
NC_Admin.Check
DownsysClass.admin_header
If Request("action") = "updat" Then
	Call update
ElseIf Request("action") = "del" Then
	Call del
ElseIf Request("action") = "pasword" Then
	Call pasword
ElseIf Request("action") = "newpass" Then
	Call newpass
ElseIf Request("action") = "add" Then
	Call addadmin
ElseIf Request("action") = "edit" Then
	Call userinfo
ElseIf Request("action") = "savenew" Then
	Call savenew
Else
	Call userlist
End If
If Founderr = True Then
	NC_Admin.Error_msg (ErrMsg)
End If
DownsysClass.admin_footer
NothingObject
Private Sub userlist()
	If Not IsEmpty(Request("selAdminID")) Then
		selAdminID = Request("selAdminID")
		If Request("action") = "删除" Then
			Call deladmin
		ElseIf Request("action") = "激活" Then
			Call yesActive
		ElseIf Request("action") = "锁定" Then
			Call noActive
		Else
			NC_Admin.Error_msg ( "无效参数！")
			Response.End
		End If
	End If
	Response.Write "<table cellpadding=""2"" cellspacing=""1"" border=""0"" class=""tableBorder"" align=center>" & vbCrLf
	Response.Write "<form name=""selform"" method=""post"" >" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <th height=22 colspan=8>管理员管理(点击用户名进行操作)</th>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr align=center>" & vbCrLf
	Response.Write " <td width=""6%"" height=22 class=""forumHeaderBackgroundAlternate""><B>选择</B></td>" & vbCrLf
	Response.Write "<td width=""22%"" height=22 class=""forumHeaderBackgroundAlternate""><B>用户名</B></td>" & vbCrLf
	Response.Write "<td width=""22%"" class=""forumHeaderBackgroundAlternate""><B>上次登陆时间</B></td>" & vbCrLf
	Response.Write "<td width=""12%"" class=""forumHeaderBackgroundAlternate""><B>上次登陆IP</B></td>" & vbCrLf
	Response.Write "<td width=""15%"" class=""forumHeaderBackgroundAlternate""><B>操作</B></td>" & vbCrLf
	Response.Write "<td width=""8%"" class=""forumHeaderBackgroundAlternate""><B>状态</B></td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Set Rs = DownsysClass.Execute("select * from " & Admintable & " order by Logintime desc")
	Do While Not Rs.EOF
		Response.Write " <tr><td align=""center"" class=""forumRow"">" & vbCrLf
		Response.Write " <input type=""checkbox"" name=""selAdminID"" id=""selAdminID"" value="""
		Response.Write Rs("ID")
		Response.Write """>" & vbCrLf
		Response.Write " </td>" & vbCrLf
		Response.Write " <td class=forumrow><a href=""?id="
		Response.Write Rs("id")
		Response.Write "&action=pasword"" title='点击此处修改管理员信息'>"
		Response.Write Rs("adminname")
		Response.Write "</a></td>" & vbCrLf
		Response.Write "<td class=forumrow>"
		Response.Write Rs("Logintime")
		Response.Write "</td>" & vbCrLf
		Response.Write "<td class=forumrow>"
		Response.Write Rs("Loginip")
		Response.Write "</td>" & vbCrLf
		Response.Write "<td class=forumrow><a href=""?action=del&id="
		Response.Write Rs("id")
		Response.Write "&name="
		Response.Write Rs("adminname")
		Response.Write """ onclick=""{if(confirm('此操作将删除该管理员\n 您确定执行此操作吗?')){this.document.myform.submit();return true;}return false;}"">删除</a>&nbsp;&nbsp;<a href=""?id="
		Response.Write Rs("id")
		Response.Write "&action=edit"">编辑权限</a></td>" & vbCrLf
		Response.Write "<td class=forumrow>"
		If Rs("isActive") = 1 Then
			Response.Write "正常"
		Else
			Response.Write "<font color=red>锁定<font>"
		End If
		Response.Write "</td>" & vbCrLf
		Response.Write " </tr>" & vbCrLf
		Rs.movenext
	Loop
	Rs.Close
	Set Rs = Nothing
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td colspan=""7"" class=""forumRow"">管理操作：选择/反选" & vbCrLf
	Response.Write " <input type=""checkbox"" name=""checkbox"" value=""checkbox"" onClick=""javascript:SelectAll()"">" & vbCrLf
	Response.Write " <input class=""button"" onClick=""{if(confirm('确定激活选定的管理员吗?')){this.document.selform.submit();return true;}return false;}"" type=submit value=激活 name=action>" & vbCrLf
	Response.Write " <input class=""button"" onClick=""{if(confirm('确定锁定选定的管理员吗?')){this.document.selform.submit();return true;}return false;}"" type=submit value=锁定 name=action>" & vbCrLf
	Response.Write " <input class=""button"" onClick=""{if(confirm('确定删除选定的管理员吗?')){this.document.selform.submit();return true;}return false;}"" type=submit value=删除 name=action>" & vbCrLf
	Response.Write " <input class=""button"" type=button name=""Submit"" value=""添加管理员"" onClick=""self.location='AdminManage.asp?action=add'"" >" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " </form></table>" & vbCrLf
End Sub


Private Sub del()
	If NC_Admin.ChkAdmin("09999", NC_Admin.Purview) Then
		DownsysClass.Execute ("delete from " & Admintable & " where id=" & Request("id"))
	Else
		ErrMsg = "<li>您没有删除管理员的权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
End Sub


Private Sub deladmin()
	If NC_Admin.ChkAdmin("09999", NC_Admin.Purview) Then
		DownsysClass.Execute ("delete from " & Admintable & " where id in (" & selAdminID & ")")
	Else
		ErrMsg = "<li>您没有删除管理员的权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
End Sub


Private Sub yesActive()
	If NC_Admin.ChkAdmin("09999", NC_Admin.Purview) Then
		DownsysClass.Execute ("update " & Admintable & " set isActive=1 where ID in (" & selAdminID & ")")
	Else
		Errmsg = "<li>您没有此操作权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
End Sub


Private Sub noActive()
	If NC_Admin.ChkAdmin("09999", NC_Admin.Purview) Then
		DownsysClass.Execute ("update " & Admintable & " set isActive=0 where ID in (" & selAdminID & ")")
	Else
		Errmsg = "<li>您没有此操作权限!</li><li>如有什么问题请联系站长？</li>"
		Founderr = True
		Exit Sub
	End If
End Sub


Private Sub pasword()
	Dim oldpassword
	If NC_Admin.ChkAdmin("09999", NC_Admin.Purview) Then
		Set Rs = DownsysClass.Execute("select * from " & Admintable & " 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=forumrow>后台登陆名称：</td>" & vbCrLf
		Response.Write " <td width=""74%"" class=forumrow>" & vbCrLf
		Response.Write " <input type=hidden name=""oldusername"" value="""
		Response.Write Rs("adminname")
		Response.Write """>" & vbCrLf
		Response.Write " <input type=text size=25 name=""username2"" value="""
		Response.Write Rs("adminname")
		Response.Write """>" & vbCrLf
		Response.Write " </td>" & vbCrLf
		Response.Write " </tr>" & vbCrLf
		Response.Write " <tr >" & vbCrLf
		Response.Write " <td width=""26%"" align=""right"" class=forumrow>后台登陆密码：</td>" & vbCrLf
		Response.Write " <td width=""74%"" class=forumrow>" & 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=forumrow>管理员级别：</td>" & vbCrLf
		Response.Write " <td width=""74%"" class=forumrow>" & vbCrLf
		Response.Write " <input type=radio name=flag value='0' "
		If Rs("flag") = 0 Then Response.Write " checked"
		Response.Write " > 普通管理员&nbsp;&nbsp;" & vbCrLf
		Response.Write " <input type=radio name=flag value='1' "
		If Rs("flag") = 1 Then Response.Write " checked"
		Response.Write " > 系统CEO （拥有最高权限）" & vbCrLf
		Response.Write " </td>" & vbCrLf
		Response.Write " </tr>" & vbCrLf
		Response.Write " <tr>" & vbCrLf
		Response.Write " <td width=""26%"" align=""right"" class=forumrow>是否激活管理员：</td>" & vbCrLf
		Response.Write " <td width=""74%"" class=forumrow>" & vbCrLf
		Response.Write " <input type=radio name=isActive value='0' "
		If Rs("isActive") = 0 Then Response.Write " checked"
		Response.Write " > 否&nbsp;&nbsp;" & vbCrLf
		Response.Write " <input type=radio name=isActive value='1' "
		If Rs("isActive") = 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=forumrow>" & vbCrLf
		Response.Write " <input type=hidden name=id value="""
		Response.Write Request("id")
		Response.Write """>" & vbCrLf
		Response.Write " <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
	Else
		NC_Admin.Error_msg ("<li>您没有设置权限!<li>如有什么问题请联系站长？")
	End If
End Sub


Private Sub newpass()
	Dim passnw
	Dim usernw
	Dim aduser
	Dim oldpassword
	Set Rs = DownsysClass.Execute("select * from " & Admintable & " 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
	If NC_Admin.ChkAdmin("09999", NC_Admin.Purview) Then
		Set Rs = CreateObject("adodb.recordset")
		SQL = "select * from " & Admintable & " where adminname='" & Trim(Request("oldusername")) & "'"
		Rs.Open SQL, conn, 1, 3
		If Not Rs.EOF And Not Rs.bof Then
			Rs("adminname") = usernw
			If Request("password2") <> "" Then Rs("password") = md5(Request("password2"))
			Rs("isActive") = Request.Form("isActive")
			Rs("flag") = Request.Form("flag")
			NC_Admin.Succeed_Msg ("<li>管理员资料更新成功，请记住更新信息。<br> 管理员：" & Request("username2") & " <BR> 密   码：" & passnw & "")
			Rs.update
		End If
		Rs.Close
		Set Rs = Nothing
	Else
		NC_Admin.Error_msg ("<li>您没有设置权限!<li>如有什么问题请联系站长？")
	End If
End Sub


Private Sub addadmin()
	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=forumrow>后台登陆名称：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=forumrow>" & 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=forumrow>后台登陆密码：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=forumrow>" & 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=forumrow>管理员级别：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=forumrow>" & vbCrLf
	Response.Write " <input type=radio name=flag value='0' checked> 普通管理员&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=flag value='1'> 系统CEO （拥有最高权限）" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td width=""26%"" align=""right"" class=forumrow>是否激活管理员：</td>" & vbCrLf
	Response.Write " <td width=""74%"" class=forumrow>" & vbCrLf
	Response.Write " <input type=radio name=isActive value='0' checked> 否&nbsp;&nbsp;" & vbCrLf
	Response.Write " <input type=radio name=isActive value='1'> 是" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr align=""center"">" & vbCrLf
	Response.Write " <td colspan=""2"" class=forumrow>" & vbCrLf
	Response.Write " <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 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 = DownsysClass.Execute("select adminname from " & Admintable & " where adminname='" & 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 " & Admintable & " where (id is null)"
	Rs.Open SQL, conn, 1, 3
	Rs.addnew
	Rs("adminname") = Replace(Request.Form("username2"), "'", "")
	Rs("password") = md5(Request.Form("password2"))
	Rs("isActive") = Request.Form("isActive")
	Rs("flag") = Request.Form("flag")
	Rs.update
	Rs.Close
	Set Rs = Nothing
	NC_Admin.Succeed_Msg ("用户ID:" & adminuserid & " 添加成功，请到管理员管理给予相应的权限，如需修改请返回管理员管理！")
End Sub


Private Sub userinfo()
	Dim menu(6, 10)
	Dim j
	Dim tmpmenu
	Dim menuname
	Dim menurl
	menu(0, 0) = "常规设置"
	menu(0, 1) = "<a href=admin_setting.asp target=main>基本设置</a> | <a href=admin_adcolumn.asp target=main>广告管理</a>"
	menu(0, 2) = "<a href=admin_template.asp target=main>模板样式总管理</a>"
	menu(0, 3) = "<a href=admin_loadskin.asp target=main>模板导出</a> | <a href=admin_loadskin.asp?action=load target=main>模板导入</a>"
	menu(0, 4) = "<a href=admin_message.asp?action=add target=main>发布公告</a> | <a href=admin_message.asp target=main>公告管理</a>"
	menu(1, 0) = "软件管理"
	menu(1, 1) = "<a href=admin_software.asp?action=add target=main>添加软件</a> | <a href=admin_software.asp target=main>管理软件</a>"
	menu(1, 2) = "<a href=admin_sorting.asp?action=add target=main>添加软件分类</a> | <a href=admin_sorting.asp target=main>管理</a>"
	menu(1, 3) = "<a href=admin_server.asp target=main>下载服务器管理</a>"
	menu(1, 4) = "<a href=admin_softrec.asp target=main>回收站管理</a>"
	menu(1, 5) = "<a href=admin_publish.asp target=main>前台发布软件管理</a>"
	menu(1, 6) = "<a href=admin_softerror.asp target=main>错误软件</a> | <a href=admin_softupdate.asp target=main>更新数据</a>"
	menu(1, 7) = "<a href=admin_softessay.asp target=main>软件评论管理</a>"
	menu(1, 8) = "<a href=Create_HotTopJs.asp target=main>生成下载排行JS</a>"
	menu(1, 9) = "<a href=admin_skycn.asp target=main>添加天空软件信息</a>"
	menu(2, 0) = "文章管理"
	menu(2, 1) = "<a href=admin_article.asp?action=add target=main>添加文章</a> | <a href=admin_article.asp target=main>管理文章</a>"
	menu(2, 2) = "<a href=admin_class.asp?action=add target=main>添加文章分类</a> | <a href=admin_class.asp target=main>管理</a>"
	menu(2, 3) = "<a href=admin_articleupdate.asp target=main>数据更新</a> | <a href=admin_articlerec.asp target=main>回收站</a>"
	menu(2, 4) = "<a href=admin_articlessay.asp target=main>文章评论管理</a>"
	menu(2, 5) = "<a href=Create_HotTopJs.asp target=main>生成文章排行JS</a>"
	menu(3, 0) = "生成 HTML"
	menu(3, 1) = "<a href=Create_Index.Asp target=main>生成首页</a> | <a href=Create_Sorting.Asp target=main>软件列表</a>"
	menu(3, 2) = "<a href=Create_HotSoft.Asp target=main>热门软件</a> | <a href=Create_SoftInfo.Asp target=main>软件信息</a>"
	menu(3, 3) = "<a href=Create_LateNew.Asp target=main>更新软件</a> | <a href=Create_Commend.Asp target=main>推荐软件</a>"
	menu(3, 4) = "<a href=Create_ArticleIndex.Asp target=main>文章首页</a> | <a href=Create_Listing.Asp target=main>文章列表</a>"
	menu(3, 5) = "<a href=Create_HotArticle.Asp target=main>热门文章</a> | <a href=Create_Article.Asp target=main>文章内容</a>"
	menu(3, 6) = "<a href=Create_Catalog.Asp target=main>生成分类</a> | <a href=Create_NewArticle.Asp target=main>更新文章</a>"
	menu(4, 0) = "用户管理"
	menu(4, 1) = "<a href=admin_user.asp target=main>查看会员信息</a>"
	menu(4, 2) = "<a href=admin_password.asp target=main>管理员密码修改</a>"
	menu(4, 3) = "<a href=admin_webmaster.asp?action=add target=main>管理员添加</a> | <a href=admin_webmaster.asp target=main>管理</a>"
	menu(4, 4) = "<a href=admin_group.asp?action=addgroup target=main>用户组添加</a> | <a href=admin_group.asp target=main>管理</a>"
	menu(4, 5) = "<a href=admin_mailist.asp target=main>邮件列表</a> | <a href=admin_mailout.asp target=main>列表导出</a>"
	menu(4, 6) = "<a href=admin_mailist.asp?action=mail target=main>发邮件</a>"
	menu(5, 0) = "其它设置"
	menu(5, 1) = "<a href=admin_link.asp?action=add target=main>友情链接添加</a> | <a href=admin_link.asp target=main>管 理</a>"
	menu(5, 2) = "<a href=admin_plusmenu.asp?action=add target=main>网站栏目添加</a> | <a href=admin_plusmenu.asp target=main>管 理</a>"
	menu(5, 3) = "<a href=admin_lockip.asp?action=add target=main>IP锁定添加</a> | <a href=admin_lockip.asp target=main>管理</a>"
	menu(5, 4) = "<a href=admin_vote.asp?action=add target=main>增加投票</a> | <a href=admin_vote.asp target=main>投票管理</a>"
	menu(5, 5) = "<a href=admin_filemanage.asp?path=" & DownsysClass.SetupDir & DownsysClass.Setting(26) & " target=main>上传图片管理</a>"
	menu(5, 6) = "<a href=admin_filemanage.asp?path=" & DownsysClass.SetupDir & DownsysClass.Setting(24) & " target=main>上传文件管理</a>"
	menu(5, 7) = "<a href=admin_filemanage.asp target=main>在线文件管理</a>"
	menu(6, 0) = "数据处理(Access)"
	menu(6, 1) = "<a href=admin_database.asp#1 target=main>数据库更名</a> | <a href=admin_database.asp#2 target=main>备 份</a>"
	menu(6, 2) = "<a href=admin_database.asp#4 target=main>数据库压缩</a> | <a href=admin_database.asp#4 target=main>恢 复</a>"
	menu(6, 3) = "<a href=admin_probe.asp target=main>服务器信息</a>"
	menu(6, 4) = "<a href=admin_replace.asp target=main>数据库批量替换</a>"
	menu(6, 5) = "<a href=../SpaceSize.asp target=main>系统空间占用</a>"
	menu(6, 6) = "文件上传"
	Set Rs = DownsysClass.Execute("select * from " & Admintable & " where id=" & Request("id"))
	Response.Write "<form action=""?action=updat"" method=post name=adminflag>" & vbCrLf
	Response.Write "<table cellpadding=""2"" cellspacing=""1"" border=""0"" width=""95%"" class=""tableBorder"" align=center>" & vbCrLf
	Response.Write "<tr>" & vbCrLf
	Response.Write "<th height=25>管理员权限管理</b>(请选择相应的权限分配给管理员)</th>" & vbCrLf
	Response.Write "</tr>" & vbCrLf
	Response.Write "<tr><td class=forumrow>" & vbCrLf
	For i = 0 To UBound(menu, 1)
		Response.Write "<b>"
		Response.Write menu(i, 0)
		Response.Write "</b><br>" & vbCrLf
		On Error Resume Next
		For j = 1 To UBound(menu, 2)
			If IsEmpty(menu(i, j)) Then Exit For
			tmpmenu = Split(menu(i, j), ",")
			menuname = tmpmenu(0)
			menurl = tmpmenu(1)
			Response.Write "<input type=""checkbox"" name=""Purview"" value="""
			Response.Write i & j
			Response.Write """ "
			If InStr(Rs("Purview"), i & j) <> 0 Then Response.Write "checked"
			Response.Write "><a href="""
			Response.Write menurl
			Response.Write """>"
			Response.Write menuname
			Response.Write "</a>&nbsp;&nbsp;" & vbCrLf
		Next
		Response.Write "<br><br>" & vbCrLf
	Next
	Response.Write "<input type=hidden name=id value="""
	Response.Write Request("id")
	Response.Write """>" & vbCrLf
	Response.Write "<input type=""submit"" name=""Submit"" value=""更新管理员权限"" class=""button""><input name=chkall type=checkbox value=on onclick=CheckAll(this.form)>选择所有权限" & vbCrLf
	Response.Write "</td>" & vbCrLf
	Response.Write "</tr>" & vbCrLf
	Response.Write "</table>" & vbCrLf
	Response.Write "</form>" & vbCrLf
	Rs.Close
	Set Rs = Nothing
End Sub


Private Sub update()
	Set Rs = Server.CreateObject("adodb.recordset")
	SQL = "select * from " & Admintable & " where id=" & Request("id")
	Rs.Open SQL, conn, 1, 3
	If Not Rs.EOF And Not Rs.bof Then
		Rs("Purview") = Request("Purview")
		Sucmsg = "<li>管理员更新成功，请记住更新信息。"
		Rs.update
		If Rs("adminname") = "" Then Session(DownsysClass.CacheName & "Purview") = Request("Purview")
	End If
	Rs.Close
	Set Rs = Nothing
	NC_Admin.Succeed_Msg (Sucmsg)
End Sub
%>
