<!-- #include file="../conn.asp" -->
<!-- #include file="../cls_main.asp" -->
<!-- #include file="../cls_md5.asp" -->
<!-- #include file="../cls_Mesky_showPage.asp" -->
<% MyDbPath = "../"
dim obj
set obj = New admin_admin
	call obj.AspInit()
set obj = nothing

Class admin_admin
	Private isEdit,Mesky
	Private Sub Class_Initialize()
		Set Mesky = New Cls_Main
	End Sub
	Private Sub Class_Terminate()
		Set Mesky = Nothing
	End Sub
	Public Sub AspInit()
		Response.Write "<HTML>" & vbCrLf
		Response.Write "<HEAD>" & vbCrLf
		Response.Write "<TITLE>管理员管理</TITLE>" & vbCrLf
		Response.Write "<META http-equiv=Content-Type content=""text/html; charset=gb2312"">" & vbCrLf
		Response.Write "<LINK href=""admin.css"" type=text/css rel=stylesheet>" & vbCrLf
		Response.Write "</HEAD>" & vbCrLf
		Response.Write "<BODY leftMargin=2 topMargin=2>" & vbCrLf
		isEdit = False
		If Not IsObject(Conn) Then Call ConnectionDatabase
			If Mesky.adminName = "" Then
				Mesky.strMsg = "<li>非法操作：登录超时或你没有以管理员身份登录系统，<a href=""../admin_login.asp"" target=_top>点此进入管理员登录界面</a>。"
				Call Mesky.SystemMsg
			Else
				Call Main
			End If
		Response.Write "</BODY>" & vbCrLf
		Response.Write "</HTML>" & vbCrLf
		
	End Sub
	
	Private Sub Main()
		Select Case Request("action")
		Case "saveadd"
			If Mesky.checkPermission(Mesky.adminName, 0) = False Then
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			Else
				Call SaveAdd
			End If
		Case "modify"
			If Mesky.checkPermission(Mesky.adminName, 0) = False Then
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			Else
				Call SaveModify
			End If
		Case "edit"
			isEdit = True
			Call myform
		Case "add"
			isEdit = False
			Call myform
		Case "modifypwd"
			If Mesky.checkPermission(Mesky.adminName, "56") = False Then
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			Else
				Call ModifyMyPassword
			End If
		Case "savemodifypwd"
			Call savemodifypwd
		Case "Del"
			If Mesky.checkPermission(Mesky.adminName, 0) = False Then
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			Else
				Call del
			End If
		Case Else
			If Mesky.checkPermission(Mesky.adminName, 0) = False Then
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			Else
				Call showList
			End If
		End Select
	End Sub
	
	
	Private Sub SaveAdd()
		Dim sPermission, Rs
		Set Rs = Server.CreateObject("adodb.recordset")
		sql = "select UserName from Mesky_SiteManager where username='" & Mesky.checkStr(Trim(Request.Form("UserName"))) & "'"
		Rs.open sql, Conn, 1, 1
		If Not (Rs.EOF And Rs.BOF) Then
			Mesky.strMsg = "<li>您输入的管理员用户名已经存在，请重新输入！"
			Call Mesky.SystemMsg
			Rs.Close: Exit Sub
		End If
		Rs.Close
			
		sql = "select * from Mesky_SiteManager where (ID is null)"
		Rs.open sql, Conn, 1, 3
		Rs.AddNew
		Rs("UserName") = Trim(Request.Form("UserName"))
		If Rs("Password") <> Trim(Request.Form("PassWord")) Then
			Rs("PassWord") = MD5(Trim(Request.Form("PassWord")), 16)
		End If
		Rs("Description") = Trim(Request.Form("Description"))
		Rs("isAdmin") = Request.Form("isAdmin")
		Rs("LastActive") = Now()
		Rs("Logins") = 0
		Rs("isMultiLogin") = 1
		sPermission = Request.Form("down") & "," & Request.Form("cms") & "," & Request.Form("other")
		Rs("Permission") = sPermission
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Mesky.strMsg = "<li>添加新的管理员操作成功！"
		Call Mesky.SystemMsg
	End Sub
	
	Private Sub SaveModify()
		
		'sql="select userid from [Dv_user] where username='"&checkStr(Trim(Request.Form("UserName")))&"'"
		'rs.open sql,conn,1,1
		'if rs.eof and rs.bof then
			'ErrMsg="<li>您输入的用户名不是一个有效的注册用户；"
			'FoundErr=true:ErrMsg_Img=true
			'rs.close:exit sub
		'end if
		'rs.close
		Dim sPermission, Rs
		Set Rs = Server.CreateObject("adodb.recordset")
		sql = "select UserName from Mesky_SiteManager where ID<>" & CLng(Request.Form("ID")) & " and username='" & Mesky.checkStr(Trim(Request.Form("UserName"))) & "'"
		Rs.open sql, Conn, 1, 1
		If Not (Rs.EOF And Rs.BOF) Then
			Mesky.strMsg = "<li>您输入的用户名已经在管理用户中存在；"
			Call Mesky.SystemMsg
			Rs.Close: Exit Sub
		End If
		Rs.Close
		sql = "select * from Mesky_SiteManager where ID=" & CLng(Request.Form("ID"))
		Rs.open sql, Conn, 1, 3
		
		Rs("UserName") = Trim(Request.Form("UserName"))
		If Rs("Password") <> Trim(Request.Form("PassWord")) Then
			Rs("PassWord") = MD5(Trim(Request.Form("PassWord")), 16)
		End If
		Rs("Description") = Trim(Request.Form("Description"))
		Rs("isAdmin") = Request.Form("isAdmin")
		Rs("isMultiLogin") = 1
		sPermission = Request.Form("down") & "," & Request.Form("cms") & "," & Request.Form("other")
		Rs("Permission") = sPermission
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Mesky.strMsg = "<li>修改管理员信息和权限操作成功！"
		Call Mesky.SystemMsg
	End Sub
	Private Sub savemodifypwd()
		dim sql,rs
		Set Rs = Server.CreateObject("adodb.recordset")
		sql = "select * from Mesky_SiteManager where UserName='" & Mesky.adminName & "'"
		Rs.open sql, Conn, 1, 3
		Rs("Password") = MD5(Trim(Request.Form("PassWord")), 16)
		Rs.Update
		Rs.close
		Set Rs = nothing
		Mesky.strMsg = "<li>修改密码操作成功！"
		Call Mesky.SystemMsg
	End Sub
	Private Sub del()
		Mesky.Execute ("delete from Mesky_SiteManager where ID=" & CLng(Request("id")))
		Mesky.strMsg = "<li>删除管理员信息操作成功！"
		Call Mesky.SystemMsg
	End Sub
	
	Private Sub showList()
		'sql="Select ID,UserName,Password,Description,LastLogin,LastLoginIP,LastActive,isAdmin,Logins from Mesky_SiteManager order by ID Desc"
	
		Dim sColumn, showPageRs, strSQL, Rs, q, i, currentPage
		If Trim(Request.QueryString("Page")) = "" Then
			currentPage = 1
		Else
			currentPage = Trim(Request.QueryString("Page"))
		End If
		strSQL = ""
		sColumn = "ID,UserName,Password,Description,LastLogin,LastLoginIP,LastActive,isAdmin,Logins"
		Set showPageRs = New cls_Mesky_showPage '创建对象
			If IsSqlDataBase = 1 Then
				showPageRs.DbType = "MSSQL_SP"
			Else
				showPageRs.DbType = "AC"
			End If
			'数据库类型,AC为access,MSSQL为sqlserver2000,MSSQL_SP为存储过程版,MYSQL为mysql,PGSQL为PostgreSql
			showPageRs.RecType = 0
			'取记录总数方法(0执行count,1自写sql语句取,2固定值)
			showPageRs.RecSql = 0
			'如果RecType＝1则=取记录sql语句，如果是2=数值，等于0=""
			showPageRs.RecTerm = 2
			'取从记录条件是否有变化(0无变化,1有变化,2不设置cookies也就是及时统计，适用于搜索时候)
			showPageRs.CookieName = "adminlist" '如果RecTerm＝2,cookiesname="",否则写cookiesname
			showPageRs.Order = 0              '排序(0顺序1降序),注意要和下面sql里面主键ID的排序对应
			showPageRs.PageSize = 30          '每页记录条数
			showPageRs.currentPage = currentPage
			showPageRs.sql = sColumn & "$Mesky_SiteManager$$ID$ID" '字段,表,条件(不需要where),排序(不需要需要ORDER BY),主键ID
		Dim iRecCount, sqlRs
		
		iRecCount = showPageRs.RecCount() '记录总数
		
		Response.Write "<fieldset><legend>管理员管理：[<a href=""?action=add"">添加管理员</a>]</legend>" & vbCrLf
		Response.Write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write "  <COLGROUP>" & vbCrLf
		Response.Write "  <COL width=55>" & vbCrLf
		Response.Write "  <COL width=*>" & vbCrLf
		Response.Write "  <COL width=110>" & vbCrLf
		Response.Write "  <COL width=110>" & vbCrLf
		Response.Write "  <COL width=90>" & vbCrLf
	
		Response.Write "  <COL width=55>" & vbCrLf
		Response.Write "  <COL width=80>" & vbCrLf
		Response.Write "  <tr style=""font-weight: bold;"" align=""center"" class=""tdbg2""> " & vbCrLf
		Response.Write "    <td>用户名</td>" & vbCrLf
		Response.Write "    <td>描 述</td>" & vbCrLf
		Response.Write "    <td>最后登录时间</td>" & vbCrLf
		Response.Write "    <td>最后活动时间</td>" & vbCrLf
		Response.Write "    <td>最后登录IP</td>" & vbCrLf
		Response.Write "    <td>登录</td>" & vbCrLf
		Response.Write "    <td>管理操作</td>" & vbCrLf
		Response.Write "  </tr>" & vbCrLf
		Response.Write "  <SCRIPT language = ""JavaScript"">" & vbCrLf
		Response.Write "function SelectAll() {" & vbCrLf
		Response.Write "    for (var i=0;i<document.myform.selID.length;i++) {" & vbCrLf
		Response.Write "        var e=document.myform.selID[i];" & vbCrLf
		Response.Write "        e.checked=!e.checked;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "</script>  <form name=""myform"" method=""post"" action=""admin_admin.asp"">" & vbCrLf
	
		If iRecCount < 1 Then
			Response.Write "<tr bgcolor=""#FCFCFC""><td colspan=""7"">Sorry！没有找到任何记录。</td></tr>"
		Else
			'Set sqlRs = showPageRs.ResultSet()  '返回ResultSet
			Rs = showPageRs.ResultSet()  '返回ResultSet
			For i = 0 To UBound(Rs, 2)
			Response.Write "    <tr class=""tdbg3""> " & vbCrLf
			Response.Write "      <td>" & Rs(1, i) & "</td>" & vbCrLf
			Response.Write "      <td>" & Rs(3, i) & "</td>" & vbCrLf
			Response.Write "      <td>" & Rs(4, i) & "</td>" & vbCrLf
			Response.Write "      <td>" & Rs(6, i) & "</td>" & vbCrLf
			Response.Write "      <td>" & Rs(5, i) & "</td>" & vbCrLf
			Response.Write "      <td>" & Rs(8, i) & " 次</td>" & vbCrLf
			Response.Write "      <td><a href=""?action=edit&ID=" & Rs(0, i) & """>编辑权限</a> <a href=""?action=Del&ID=" & Rs(0, i) & """ onclick=""{if(confirm('执行此删除操作后该管理员不能恢复，确定删除吗？')){return true;}return false;}"">删除</a></td>" & vbCrLf
			Response.Write "    </tr>" & vbCrLf
			Next
			'Set sqlRs = Nothing
		End If
		
		Response.Write "    <tr> " & vbCrLf
		Response.Write "      <td colspan=""7"" class=""tdbg2"">" & showPageRs.showPage("?Page={$pages}") & "</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Set showPageRs = Nothing
		Response.Write "  </form>" & vbCrLf
		Response.Write "</table> </fieldset>" & vbCrLf
	End Sub
	Private Sub ModifyMyPassword()
		Dim Rs
		Set Rs = Mesky.Execute("select * from Mesky_SiteManager where UserName='" & Mesky.adminName & "'")
		
		Response.Write "<fieldset><legend>修改我的密码</legend>" & vbCrLf
		Response.Write "<script language=""Javascript""><!--" & vbCrLf
		Response.Write "function VF_modifypwd(){ //v2.0" & vbCrLf
		Response.Write "<!--start_of_saved_settings-->" & vbCrLf
		Response.Write "<!--type,password,name,PwdConfirm,required,true,isEqualTo,Password,errMsg,确认密码不能为空，请填写与新密码相同的确认密码！-->" & vbCrLf
		Response.Write "<!--type,password,name,Password,required,true,errMsg,新密码不能为空，请填写新密码！-->" & vbCrLf
		Response.Write "<!--end_of_saved_settings-->" & vbCrLf
		Response.Write "    var theForm = document.modifypwd;" & vbCrLf
		Response.Write "    var errMsg = """";" & vbCrLf
		Response.Write "    var setfocus = """";" & vbCrLf
		Response.Write vbCrLf
		Response.Write "    if (theForm['PwdConfirm'].value == """" || (theForm['PwdConfirm'].value != theForm['Password'].value)){" & vbCrLf
		Response.Write "        errMsg = ""确认密码不能为空，请填写与新密码相同的确认密码！"";" & vbCrLf
		Response.Write "        setfocus = ""['PwdConfirm']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (theForm['Password'].value == """"){" & vbCrLf
		Response.Write "        errMsg = ""新密码不能为空，请填写新密码！"";" & vbCrLf
		Response.Write "        setfocus = ""['Password']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (errMsg != """"){" & vbCrLf
		Response.Write "        alert(errMsg);" & vbCrLf
		Response.Write "        eval(""theForm"" + setfocus + "".focus()"");" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    else theForm.submit();" & vbCrLf
		Response.Write "}//-->" & vbCrLf
		Response.Write "</script>" & vbCrLf
		Response.Write " <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write " <form action=""admin_admin.asp"" method=""post"" name=""modifypwd"" onSubmit=""VF_modifypwd();return false;"">" & vbCrLf
		Response.Write " <input type=""Hidden"" name=""action"" value=""savemodifypwd"">" & vbCrLf
		Response.Write "  <COLGROUP>" & vbCrLf
		Response.Write "  <COL width=100>" & vbCrLf
		Response.Write "  <COL width=*>" & vbCrLf
		Response.Write "    <tr class=""tdbg2"">" & vbCrLf
		Response.Write "      <td align=""right"" >用 户 名：</td>" & vbCrLf
		
		Response.Write "       <td>" & Rs("UserName") & "</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg3"">" & vbCrLf
		Response.Write "      <td align=""right"" >用户描述：</td>" & vbCrLf
		Response.Write "      <td>" & Rs("Description") & "</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg2""> " & vbCrLf
		Response.Write "      <td align=""right"">新 密 码：</td>" & vbCrLf
		Response.Write "      <td><input name=""Password"" type=""password"" id=""Password"" size=""50"" maxlength=""20""></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg3""> " & vbCrLf
		Response.Write "      <td align=""right"">确认密码：</td>" & vbCrLf
		Response.Write "      <td><input type=""password"" name=""PwdConfirm"" size=""50"" maxlength=""20""></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg2"">" & vbCrLf
		Response.Write "      <td align=""right"">我的权限：</td>" & vbCrLf
		Response.Write "      <td>"
		
		If Rs("isAdmin") = 1 Then
			Response.Write ("超级管理员：拥有所有权限。")
		Else
			Response.Write ("普通管理员。")
		End If
		Response.Write " </td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg3""> " & vbCrLf
		Response.Write "      <td></td>" & vbCrLf
		Response.Write "      <td><input type=""submit"" name=""Submit"" value="" 提 交 ""></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "</form>" & vbCrLf
		Response.Write "</table></fieldset>" & vbCrLf
		Set Rs = Nothing
	End Sub
	
	Private Sub myform()
		If isEdit Then
			Dim Rs
			Set Rs = Mesky.Execute("select * from Mesky_SiteManager where ID=" & CLng(Request.QueryString("ID")))
		End If
		Response.Write "<form action=""admin_admin.asp"" method=""post"" name=adminflag onSubmit=""VF_adminflag();return false;"">" & vbCrLf
		Response.Write " <fieldset><legend>"
		If isEdit Then
			Response.Write ("修改管理员")
			Response.Write ("<input type=""Hidden"" name=""action"" value=""modify"">")
			Response.Write ("<input type=""Hidden"" name=""ID"" value=""" & CLng(Request.QueryString("ID")) & """>")
		Else
			Response.Write ("添加管理员")
			Response.Write ("<input type=""Hidden"" name=""action"" value=""saveadd"">")
		End If
		
		Response.Write "</legend>" & vbCrLf
		Response.Write "<script language=""Javascript""><!--" & vbCrLf
		Response.Write "function VF_adminflag(){ //v2.0" & vbCrLf
		Response.Write "<!--start_of_saved_settings-->" & vbCrLf
		Response.Write "<!--type,text,name,Description,required,true,errMsg,管理员描述信息不能为空！-->" & vbCrLf
		Response.Write "<!--type,password,name,Password,required,true,errMsg,密码不能为空！-->" & vbCrLf
		Response.Write "<!--type,text,name,UserName,required,true,errMsg,用户名不能为空！-->" & vbCrLf
		Response.Write "<!--end_of_saved_settings-->" & vbCrLf
		Response.Write "    var theForm = document.adminflag;" & vbCrLf
		Response.Write "    var errMsg = """";" & vbCrLf
		Response.Write "    var setfocus = """";" & vbCrLf
		Response.Write vbCrLf
		Response.Write "    if (theForm['Description'].value == """"){" & vbCrLf
		Response.Write "        errMsg = ""管理员描述信息不能为空！"";" & vbCrLf
		Response.Write "        setfocus = ""['Description']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (theForm['Password'].value == """"){" & vbCrLf
		Response.Write "        errMsg = ""管理员密码不能为空！"";" & vbCrLf
		Response.Write "        setfocus = ""['Password']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (theForm['UserName'].value == """"){" & vbCrLf
		Response.Write "        errMsg = ""管理员用户名不能为空！"";" & vbCrLf
		Response.Write "        setfocus = ""['UserName']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (errMsg != """"){" & vbCrLf
		Response.Write "        alert(errMsg);" & vbCrLf
		Response.Write "        eval(""theForm"" + setfocus + "".focus()"");" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    else theForm.submit();" & vbCrLf
		Response.Write "}//-->" & vbCrLf
		Response.Write "</script>" & vbCrLf
		Response.Write " <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write "  <COLGROUP>" & vbCrLf
		Response.Write "  <COL width=100>" & vbCrLf
		Response.Write "  <COL width=*>" & vbCrLf
		Response.Write "    <tr class=""tdbg2""> " & vbCrLf
		Response.Write "      <td align=""right"" >用 户 名：</td>" & vbCrLf
		Response.Write "      <td><input name=""UserName"" type=text id=""UserName"" value="""
		
		If isEdit Then Response.Write Trim(Rs("UserName"))
		Response.Write """ size=""50"" maxlength=""20""></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg3""> " & vbCrLf
		Response.Write "      <td align=""right"">登陆密码：</td>" & vbCrLf
		Response.Write "      <td><input name=""Password"" type=""password"" id=""Password"" value="""
		
		If isEdit Then Response.Write Trim(Rs("Password"))
		
		Response.Write """ size=""50"" maxlength=""20""></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg2"">" & vbCrLf
		Response.Write "      <td align=""right"">管理员类型：</td>" & vbCrLf
		Response.Write "      <td><input type=""radio"" name=""isAdmin"" value=""1"" "
		
		If isEdit Then
			If Rs("isAdmin") = 1 Then Response.Write ("checked")
		End If
		Response.Write ">超级管理员：拥有所有权限。某些权限（如管理员管理、网站信息配置、等管理权限）只有超级管理员才有。 <br>" & vbCrLf
		Response.Write "      <input name=""isAdmin"" type=""radio"" value=""0"" "
		If isEdit Then
			If Rs("isAdmin") = 0 Then Response.Write ("checked")
		Else
			Response.Write ("checked")
		End If
		Response.Write ">普通管理员：需要详细指定每一项管理权限。</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg3""> " & vbCrLf
		Response.Write "      <td align=""right"">管理员描述：</td>" & vbCrLf
		Response.Write "      <td><input name=""Description"" type=""text"" id=""Description"" size=""65"" maxlength=""100"" value="""
		
		If isEdit Then Response.Write Trim(Rs("Description"))
		
		Response.Write """></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "</table></fieldset>" & vbCrLf
		Response.Write " <p align=""center""><strong>管理员权限详细设置</strong></p>" & vbCrLf
		Response.Write " <fieldset><legend>此管理员在【下载系统】的管理权限</legend>" & vbCrLf
		Response.Write " <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write "  <COLGROUP>" & vbCrLf
		Response.Write "  <COL ""width=50%"">" & vbCrLf
		Response.Write "  <COL width=*>" & vbCrLf
		Response.Write "    <tr class=""tdbg2""> " & vbCrLf
		Response.Write "      <td><input type=""radio"" name=""down"" value=""11"" id=""11"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "11") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""11"" style=""cursor:hand;"">下载资源管理员：拥有的下载资源系统所有管理权限。</label></td>" & vbCrLf
		Response.Write "      <td><input type=""radio"" name=""down"" value=""12"" id=""12"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "12") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""12"" style=""cursor:hand;"">下载资源总编：拥有所有资源的管理权限，但不能添加资源分类。</label></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg2""> " & vbCrLf
		Response.Write "      <td><input name=""down"" type=""radio"" id=""10"" value=""10"" "
		
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "10") Then Response.Write ("checked")
		Else
			Response.Write ("checked")
		End If
		Response.Write "><label for=""10"" style=""cursor:hand;"">在此下载资源管理系统里无任何管理权限。</label></td>" & vbCrLf
		Response.Write "      <td>&nbsp;</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "</table></fieldset><br>" & vbCrLf
		Response.Write " <fieldset><legend>此管理员在【文章系统】的管理权限</legend>" & vbCrLf
		Response.Write " <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write "  <COLGROUP>" & vbCrLf
		Response.Write "  <COL ""width=50%"">" & vbCrLf
		Response.Write "  <COL width=*>" & vbCrLf
		Response.Write "    <tr class=""tdbg2""> " & vbCrLf
		Response.Write "      <td><input type=""radio"" name=""cms"" value=""21"" id=""21"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "21") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""21"">文章资源管理员：拥有的文章资源系统所有管理权限。</label></td>" & vbCrLf
		Response.Write "      <td><input type=""radio"" name=""cms"" value=""22"" id=""22"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "22") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""22"">文章资源总编：拥有所有资源的管理权限，但不能添加资源分类。</label></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg2""> " & vbCrLf
		Response.Write "      <td><input name=""cms"" type=""radio"" id=""20"" value=""20"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "20") Then Response.Write ("checked")
		Else
			Response.Write ("checked")
		End If
		Response.Write "><label for=""20"">在此下文章资源管理系统里无任何管理权限。</label></td>" & vbCrLf
		Response.Write "      <td>&nbsp;</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "</table></fieldset><br>" & vbCrLf
		Response.Write "<style type=""text/css"">" & vbCrLf
		Response.Write "label{cursor:hand;}" & vbCrLf
		Response.Write "</style>" & vbCrLf
		Response.Write " <fieldset><legend>此管理员的其他管理权限：<input name='chkAll' type='checkbox' id='chkAll' value='yes' onclick='SelectAll(this.form)'><label for=""chkAll"">选中所有权限</label></legend>" & vbCrLf
		Response.Write " <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write "  <COLGROUP>" & vbCrLf
		Response.Write "  <COL width=25>" & vbCrLf
		Response.Write "  <COL width=25>" & vbCrLf
		Response.Write "  <COL width=25>" & vbCrLf
		Response.Write "  <COL width=25>" & vbCrLf
		Response.Write "    <tr class=""tdbg2""> " & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""51"" value=""51"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "51") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""51"">生成网站数据管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""52"" value=""52"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "52") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""52"">注册用户管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""53"" value=""53"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "53") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""53"">友情链接管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""54"" value=""54"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "54") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""54"">数据库维护管理</label></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg3""> " & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""55"" value=""55"" "
		
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "55") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""55"">资源信息采集管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""56"" value=""56"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "56") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""56"">修改自己密码</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""57"" value=""57"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "57") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""57"">网站公告管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""58"" value=""58"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "58") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""58"">调查投票管理</label></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg2"">" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""59"" value=""59"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "59") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""59"">系统模板设计管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""60"" value=""60"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "60") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""60"">邮件列表管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""61"" value=""61"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "61") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""61"">IP 限制管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""62"" value=""62"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "62") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""62"">访问统计管理</label></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr class=""tdbg3"">" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""63"" value=""63"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "63") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""63"">下载预定义管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""64"" value=""64"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "64") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""64"">用户评论管理</label></td>" & vbCrLf
		Response.Write "      <td><input type=""checkbox"" name=""other"" id=""65"" value=""65"" "
		If isEdit Then
			If Mesky.ItemInList(Rs("Permission"), "65") Then Response.Write ("checked")
		End If
		Response.Write "><label for=""65"">上传文件管理</label></td>" & vbCrLf
		Response.Write "      <td>&nbsp;</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "</table>" & vbCrLf
		Response.Write " </fieldset>" & vbCrLf
		Response.Write " <table width=""100%""  border=""0"" cellspacing=""1"" cellpadding=""3"">" & vbCrLf
		Response.Write "   <tr>" & vbCrLf
		Response.Write "     <td align=""center""> <input type=""submit"" name=""Submit"" value="" 提 交 ""></td>" & vbCrLf
		Response.Write "   </tr>" & vbCrLf
		Response.Write " </table>" & vbCrLf
		Response.Write "</form>" & vbCrLf
		Response.Write "<SCRIPT language = ""JavaScript"">" & vbCrLf
		Response.Write "<!--" & vbCrLf
		Response.Write "function SelectAll(form){" & vbCrLf
		Response.Write "  for (var i=0;i<form.other.length;i++){" & vbCrLf
		Response.Write "    var e = form.other[i];" & vbCrLf
		Response.Write "    if (e.disabled==false)" & vbCrLf
		Response.Write "       e.checked = form.chkAll.checked;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "//-->" & vbCrLf
		Response.Write "</script>" & vbCrLf
		If isEdit Then Set Rs = Nothing
	End Sub
	Public Sub OnEndPage()
		Response.Write Mesky.CopyRight
	End Sub ' OnEndPage

End Class
 %>