<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0806") then Call ReturnError()
Dim ClassSql,RsClassObj
ClassSql = "Select * from NewsClass where parentID='0' and DelFlag=0"
Set RsClassObj = Conn.Execute(ClassSql)

Function GetChildClassList(ClassID,Str)
	Dim Sql,RsTempObj,TempImageStr,ImageStr,iScheck
	TempImageStr = "<img src=""../Images/folder-.gif"" width=""18"" height=""18""><img src=""../Images/folder.gif"" width=""18"" height=""18"">"
	Sql = "Select * from NewsClass where ParentID='" & ClassID & "' and DelFlag=0"
	ImageStr = Str & "<img src=""../Images/folderHR.gif"" width=""18"" height=""18"">"
	Set RsTempObj = Conn.Execute(Sql)
	do while Not RsTempObj.Eof
		if InStr(1, rs1("PopLIst"),""&RsTempObj("classID")&"" ,1)<>0 then 
			iScheck=" checked"
		end if
		GetChildClassList = GetChildClassList & "<tr><td><table border=""0"" cellspacing=""0"" cellpadding=""0""><tr align=""left""  class=""TempletItem""><td>" & ImageStr & TempImageStr & "</td><td><input name=""PopList"" type=""checkbox"" id=""News"&RsTempObj("Classid")&""" value="""& RsTempObj("Classid")&""""&iScheck&">" & RsTempObj("ClassCName") & "</td></tr></table></td></tr>"
		GetChildClassList = GetChildClassList & GetChildClassList(RsTempObj("ClassID"),ImageStr)
		RsTempObj.MoveNext
	loop
	Set RsTempObj = Nothing
End Function

if request.Form("action")="add" then
	Dim Sql ,Rs
	Sql = "Select * from AdminGroup where id="&request.Form("ID")
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	Rs.Open Sql,Conn,3,3
	Rs("PopList")=request.Form("PopList")
	Rs.update
	Rs.close
	Set Rs=nothing
	Response.Write("<script>dialogArguments.location.reload();window.close();</script>")
	Response.End
end if
	Dim Sql1,Rs1
	Sql1 = "Select * from AdminGroup where id="&request("ID")
	Set Rs1 = Server.CreateObject("ADODB.RecordSet")
	Rs1.Open Sql1,Conn,3,3

%>
<html>
<head>
<link href="System.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>设置管理组权限</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>

<body topmargin="0" leftmargin="0">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
  <form name="PopForm" method="post" action=""><tr><td>
	<table width="100%" border="0" cellpadding="3" cellspacing="0" class="tabbgcolor">
          <tr> 
            <td height="24" colspan="7" class="Nhightblue9ptbold"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td> <input type="checkbox" name="chkall" onClick="CheckAll(this.form)">
                    全选择/取消　<font color="#FF0000">注意，如果要选择子类，粗体大类必须选择，否则设置不成功 
                    <input name="id" type="hidden" id="id" value="<%=request("id")%>">
                    </font></td>
                </tr>
              </table></td>
          </tr>
          <tr> 
            <td width="15%"><strong><font color=red> 
              <input onClick="ChangeSelectState(this,'Info');" name="PopList" type="checkbox" id="PopList" value="P019" style="color:red" <%if InStr(1, rs1("PopLIst"),"P019" ,1)<>0 then response.Write("checked") %>>
              </font>信息管理</strong></td>
            <td width="16%"><input name="PopList" type="checkbox" id="InfoNewFolder" value="P0101" <%if InStr(1, rs1("PopLIst"),"P0101" ,1)<>0 then response.Write("checked") %>>
              新建栏目</td>
            <td width="16%"><input type="checkbox" name="PopList" id="InfoEditFolder"  value="P0102" <%if InStr(1, rs1("PopLIst"),"P0102" ,1)<>0 then response.Write("checked") %>>
              修改栏目 </td>
            <td width="13%"><input type="checkbox" name="PopList" id="InfoMoveFolder"  value="P0103" <%if InStr(1, rs1("PopLIst"),"P0103" ,1)<>0 then response.Write("checked") %>>
              栏目移动</td>
            <td width="12%"><input name="PopList" type="checkbox"  id="InfoSpecialMan"  value="P0104" <%if InStr(1, rs1("PopLIst"),"P0104" ,1)<>0 then response.Write("checked") %>>
              专题管理</td>
            <td width="13%"><input type="checkbox" name="PopList"  id="InfoContribution" value="P0105" <%if InStr(1, rs1("PopLIst"),"P0105" ,1)<>0 then response.Write("checked") %>>
              投稿管理</td>
            <td width="15%"><input name="PopList" type="checkbox"  id="InfoUpFile"  value="P0106" <%if InStr(1, rs1("PopLIst"),"P0106" ,1)<>0 then response.Write("checked") %>>
              上传管理</td>
          </tr>
          <tr> 
            <td>&nbsp; </td>
            <td> <input name="PopList" type="checkbox"  id="InfoRecyle"  value="P0107" <%if InStr(1, rs1("PopLIst"),"P0107" ,1)<>0 then response.Write("checked") %>>
              回收站管理</td>
            <td><input type="checkbox" name="PopList"  id="InfoNewNews" value="P0108" <%if InStr(1, rs1("PopLIst"),"P0108" ,1)<>0 then response.Write("checked") %>>
              新建新闻</td>
            <td><input type="checkbox" name="PopList"  id="InfoMoveNews" value="P0109" <%if InStr(1, rs1("PopLIst"),"P0109" ,1)<>0 then response.Write("checked") %>>
              新闻移动</td>
            <td><input type="checkbox" name="PopList"  id="InfomodifyNews" value="P0110" <%if InStr(1, rs1("PopLIst"),"P0110" ,1)<>0 then response.Write("checked") %>>
              修改新闻</td>
            <td><input type="checkbox" name="PopList"  id="InfoAddToSpecial" value="P0111" <%if InStr(1, rs1("PopLIst"),"P0111" ,1)<>0 then response.Write("checked") %>>
              添加到专题</td>
            <td><input name="PopList" type="checkbox"  id="InfoAuditOrReview"  value="P0112" <%if InStr(1, rs1("PopLIst"),"P0112" ,1)<>0 then response.Write("checked") %>>
              审核/评论 </td>
          </tr>
          <tr> 
            <td ><strong> 
              <input name="PopList" type="checkbox"  onClick="ChangeSelectState(this,'Temp');" id="PopList" value="P039" <%if InStr(1, rs1("PopLIst"),"P039" ,1)<>0 then response.Write("checked") %>>
              模板管理</strong></td>
            <td ><input name="PopList" type="checkbox" id="Tempmanage" value="P0301" <%if InStr(1, rs1("PopLIst"),"P0301" ,1)<>0 then response.Write("checked") %>>
              模板管理</td>
            <td ><input name="PopList" type="checkbox" id="Tempmanagef" value="P0302" <%if InStr(1, rs1("PopLIst"),"P0302" ,1)<>0 then response.Write("checked") %>>
              自定义标签</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
          </tr>
          <tr> 
            <td ><strong> 
              <input name="PopList" type="checkbox"  onClick="ChangeSelectState(this,'make');" id="PopList" value="P049" <%if InStr(1, rs1("PopLIst"),"P049" ,1)<>0 then response.Write("checked") %>>
              生成管理</strong></td>
            <td ><input name="PopList" type="checkbox" id="makeindex" value="P0401" <%if InStr(1, rs1("PopLIst"),"P0401" ,1)<>0 then response.Write("checked") %>>
              首页生成</td>
            <td ><input name="PopList" type="checkbox" id="makeclass" value="P0402" <%if InStr(1, rs1("PopLIst"),"P0402" ,1)<>0 then response.Write("checked") %>>
              栏目生成</td>
            <td ><input name="PopList" type="checkbox" id="makenews" value="P0403" <%if InStr(1, rs1("PopLIst"),"P0403" ,1)<>0 then response.Write("checked") %>>
              新闻生成</td>
            <td ><input name="PopList" type="checkbox" id="makesp" value="P0404" <%if InStr(1, rs1("PopLIst"),"P0404" ,1)<>0 then response.Write("checked") %>>
              专题生成</td>
            <td ><input name="PopList" type="checkbox" id="makedow" value="P0405" <%if InStr(1, rs1("PopLIst"),"P0405" ,1)<>0 then response.Write("checked") %>>
              下载生成</td>
            <td ><input name="PopList" type="checkbox" id="makejs" value="P0406" <%if InStr(1, rs1("PopLIst"),"P0406" ,1)<>0 then response.Write("checked") %>>
              JS生成</td>
          </tr>
          <tr> 
            <td ><strong> 
              <input name="PopList" type="checkbox" onClick="ChangeSelectState(this,'jsma');" id="PopList" value="P059" <%if InStr(1, rs1("PopLIst"),"P059" ,1)<>0 then response.Write("checked") %>>
              J　S管理</strong></td>
            <td ><input name="PopList" type="checkbox" id="jsmasys" value="P0501" <%if InStr(1, rs1("PopLIst"),"P0501" ,1)<>0 then response.Write("checked") %>>
              系统JS</td>
            <td ><input name="PopList" type="checkbox" id="jsmafree" value="P0502" <%if InStr(1, rs1("PopLIst"),"P0502" ,1)<>0 then response.Write("checked") %>>
              自由JS</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
          </tr>
          <tr> 
            <td ><strong> 
              <input name="PopList" type="checkbox" onClick="ChangeSelectState(this,'syst');" id="PopList" value="P069" <%if InStr(1, rs1("PopLIst"),"P069" ,1)<>0 then response.Write("checked") %>>
              系统管理</strong></td>
            <td ><input name="PopList" type="checkbox" id="systpar" value="P0601" <%if InStr(1, rs1("PopLIst"),"P0601" ,1)<>0 then response.Write("checked") %>>
              系统参数</td>
            <td ><input name="PopList" type="checkbox" id="systdow" value="P0607" <%if InStr(1, rs1("PopLIst"),"P0607" ,1)<>0 then response.Write("checked") %>>
              下载参数</td>
            <td ><input name="PopList" type="checkbox" id="systcon" value="P0608" <%if InStr(1, rs1("PopLIst"),"P0608" ,1)<>0 then response.Write("checked") %>>
              站点常量</td>
            <td ><input name="PopList" type="checkbox" id="systback" value="P0604" <%if InStr(1, rs1("PopLIst"),"P0604" ,1)<>0 then response.Write("checked") %>>
              备份/压缩 </td>
            <td ><input name="PopList" type="checkbox" id="systsql" value="P0605" <%if InStr(1, rs1("PopLIst"),"P0605" ,1)<>0 then response.Write("checked") %>>
              执行sql脚本 </td>
            <td ><input name="PopList" type="checkbox" id="systlog" value="P0606" <%if InStr(1, rs1("PopLIst"),"P0606" ,1)<>0 then response.Write("checked") %>>
              后台日志 </td>
          </tr>
          <tr> 
            <td >&nbsp;</td>
            <td ><input name="PopList" type="checkbox" id="systfold" value="P0602" <%if InStr(1, rs1("PopLIst"),"P0602" ,1)<>0 then response.Write("checked") %>>
              虚拟目录 </td>
            <td ><input name="PopList" type="checkbox" id="systlog" value="P0603" <%if InStr(1, rs1("PopLIst"),"P0603" ,1)<>0 then response.Write("checked") %>>
              统计/空间</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
          </tr>
          <tr> 
            <td ><strong> 
              <input name="PopList" type="checkbox" onClick="ChangeSelectState(this,'plus');" id="PopList" value="P079" <%if InStr(1, rs1("PopLIst"),"P079" ,1)<>0 then response.Write("checked") %>>
              系统插件</strong></td>
            <td ><input name="PopList" type="checkbox" id="plusads" value="P0701" <%if InStr(1, rs1("PopLIst"),"P0701" ,1)<>0 then response.Write("checked") %>>
              广告管理</td>
            <td ><input name="PopList" type="checkbox" id="plusvote" value="P0702" <%if InStr(1, rs1("PopLIst"),"P0702" ,1)<>0 then response.Write("checked") %>>
              投票管理</td>
            <td ><input name="PopList" type="checkbox" id="pluscount" value="P0703" <%if InStr(1, rs1("PopLIst"),"P0703" ,1)<>0 then response.Write("checked") %>>
              流量统计</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
          </tr>
          <tr> 
            <td ><strong> 
              <input name="PopList" type="checkbox" onClick="ChangeSelectState(this,'user');" id="PopList" value="P089" <%if InStr(1, rs1("PopLIst"),"P089" ,1)<>0 then response.Write("checked") %>>
              用户管理</strong></td>
            <td ><input name="PopList" type="checkbox" id="usersy" value="P0801" <%if InStr(1, rs1("PopLIst"),"P0801" ,1)<>0 then response.Write("checked") %>>
              系统管理员</td>
            <td ><input name="PopList" type="checkbox" id="usergroup" value="P0802" <%if InStr(1, rs1("PopLIst"),"P0802" ,1)<>0 then response.Write("checked") %>>
              管理员组</td>
            <td ><input name="PopList" type="checkbox" id="userpop" value="P0806" <%if InStr(1, rs1("PopLIst"),"P0806" ,1)<>0 then response.Write("checked") %>>
              权限设置</td>
            <td ><input name="PopList" type="checkbox" id="usermem" value="P0803" <%if InStr(1, rs1("PopLIst"),"P0803" ,1)<>0 then response.Write("checked") %>>
              会员管理</td>
            <td ><input name="PopList" type="checkbox" id="usermengroup" value="P0804" <%if InStr(1, rs1("PopLIst"),"P0804" ,1)<>0 then response.Write("checked") %>>
              会员组管理</td>
            <td ><input name="PopList" type="checkbox" id="userpass" value="P0805" <%if InStr(1, rs1("PopLIst"),"P0805" ,1)<>0 then response.Write("checked") %>>
              修改密码</td>
          </tr>
          <tr> 
            <td ><strong> 
              <input name="PopList" type="checkbox" id="PopList" value="P099" <%if InStr(1, rs1("PopLIst"),"P099" ,1)<>0 then response.Write("checked") %>>
              第三插件</strong></td>
            <td ><strong> 
              <input name="PopList" type="checkbox" id="PopList" value="P109" <%if InStr(1, rs1("PopLIst"),"P109" ,1)<>0 then response.Write("checked") %>>
              代码调用</strong></td>
            <td ><strong> 
              <input name="PopList" type="checkbox" id="PopList" value="P119" <%if InStr(1, rs1("PopLIst"),"P119" ,1)<>0 then response.Write("checked") %>>
              常规管理</strong></td>
            <td ><strong>
              <input name="PopList" type="checkbox" id="PopList" value="P139" <%if InStr(1, rs1("PopLIst"),"P139" ,1)<>0 then response.Write("checked") %>>
              下载管理 </strong></td>
            <td ><strong> </strong></td>
            <td >&nbsp;</td>
            <td >&nbsp;</td>
          </tr>
          <tr> 
            <td valign="top" ><input name="PopList" type="checkbox" id="PopList" value="P149" <%if InStr(1, rs1("PopLIst"),"P149" ,1)<>0 then response.Write("checked") %>>
              <strong>内容采集</strong></td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1401" <%if InStr(1, rs1("PopLIst"),"P1401" ,1)<>0 then response.Write("checked") %>>
              站点设置</td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1402" <%if InStr(1, rs1("PopLIst"),"P1402" ,1)<>0 then response.Write("checked") %>> 
              关键字过滤</td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1403" <%if InStr(1, rs1("PopLIst"),"P1403" ,1)<>0 then response.Write("checked") %>> 
              审核数据</td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1404" <%if InStr(1, rs1("PopLIst"),"P1404" ,1)<>0 then response.Write("checked") %>> 
              历史数据</td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1405" <%if InStr(1, rs1("PopLIst"),"P1405" ,1)<>0 then response.Write("checked") %>> 
              数据规则</td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1406" <%if InStr(1, rs1("PopLIst"),"P1406" ,1)<>0 then response.Write("checked") %>> 
              数据转移</td>
          </tr>
          <tr> 
            <td valign="top" >&nbsp;</td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1407" <%if InStr(1, rs1("PopLIst"),"P1407" ,1)<>0 then response.Write("checked") %>>
              采集新闻 </td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1408" <%if InStr(1, rs1("PopLIst"),"P1408" ,1)<>0 then response.Write("checked") %>>
              修改新闻 </td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1409" <%if InStr(1, rs1("PopLIst"),"P1409" ,1)<>0 then response.Write("checked") %>>
              删除新闻 </td>
            <td ><input name="PopList" type="checkbox" id="PopList" value="P1410" <%if InStr(1, rs1("PopLIst"),"P1410" ,1)<>0 then response.Write("checked") %>>
              新闻入库</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td valign="top" ><strong> 
              <input name="PopList" type="checkbox" onClick="ChangeSelectState(this,'News');"  id="PopList" value="P129" <%if InStr(1, rs1("PopLIst"),"P129" ,1)<>0 then response.Write("checked") %>>
              新闻权限</strong></td>
            <td colspan="6" ><table border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td> </td>
                </tr>
                <%
do while Not RsClassObj.Eof
%>
                <tr> 
                  <td><table border="0" cellspacing="0" cellpadding="0">
                      <tr align="left" class="TempletItem"> 
                        <td><img src="../Images/Folder.gif"></td>
                        <td><%
		  Dim iScheck1
		  if InStr(1, rs1("PopLIst"),""&RsClassObj("Classid")&"" ,1)<>0 then 
			iScheck1=" checked"
		end if
		%> <input name="PopList" type="checkbox" id="News<% = RsClassObj("id") %>" value="<% = RsClassObj("Classid") %>"<%=iScheck1%>> 
                          <% = RsClassObj("ClassCName") %></td>
                      </tr>
                    </table></td>
                </tr>
                <%
	Response.Write(GetChildClassList(RsClassObj("ClassID"),""))
	RsClassObj.MoveNext
loop
%>
              </table></td>
          </tr>
          <tr> 
            <td colspan="7" ><strong> </strong></td>
          </tr>
          <tr> 
            <td colspan="7"> </td>
          </tr>
          <tr> 
            <td colspan="7"><div align="center"> 
                <input type="submit" name="Submit"  value=" 设 置 " onClick="return modify()">
                <input type="button" name="Submit22" value=" 取 消 " onclick="window.close();">
                <input name="action" type="hidden" id="action" value="add">
              </div></td>
          </tr>
        </table>
</td></tr></form></table>
<%
rs1.close
set rs1=nothing
%>
</body>
</html>
<script language="JavaScript" type="text/JavaScript">
function CheckAll(form)
{
for (var i=0;i<PopForm.elements.length;i++)
{
var e = PopForm.elements[i];
if (e.name != 'chkall')
e.checked = PopForm.chkall.checked;
}
}
function CheckAll1(form)
{
for (var i=0;i<PopForm.elements.length;i++)
{
var e = PopForm.elements[i];
if (e.name != 'chkall1')
e.checked = PopForm.chkall1.check;
}
}
function modify(){if(confirm("您确定要修改?")){return true;}return false;}
function ChangeSelectState(Obj,SelectFlag)
{
	for (var i=0;i<document.all.PopList.length;i++)
	{
		var ObjID=document.all.PopList(i).id;
		if (Obj.checked==true)
		{
			if (ObjID.substring(0,4)==SelectFlag) document.all.PopList(i).disabled=false;
		}
		else
		{
			if (ObjID.substring(0,4)==SelectFlag)
			{
				document.all.PopList(i).disabled=true;
				document.all.PopList(i).checked=false;
			}
		}
	}
}
</script>

