<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_User_PowerColumn, QianboCMS" EnableEventValidation="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>管理员权限组</title>
    <link href="../Css/layout.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../../Js/jquery.js"></script>
    <script type="text/javascript" src="../../Js/lhgdialog/lhgdialog.min.js?self=true"></script>
    <script src="../../Js/Common.js" type="text/javascript"></script>
    <script src="../../Js/SystemUserPowerSelect.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
		function CheckValidate()
		{
			if($('PowerName').value.trim()=="")
			{
				alert("管理员组名称不能为空！")
				$('PowerName').focus();
				return false;
			}
		}
		function CheckChannel()
		{
			if($("CheckCh").checked)
			{
				$("allowChannel").innerHTML="无权限频道";
				$("RepallowChannel").innerHTML="添加无权限频道";
				$("title_channel").innerHTML="默认勾选：该组拥有所有频道所有权限，点击【添加无权限频道】连接，设置该组无权限访问的频道。";
			}
			else
			{
				$("allowChannel").innerHTML="有权限频道";
				$("RepallowChannel").innerHTML="添加有权限频道";
				$("title_channel").innerHTML="取消勾选：即该组无所有频道所有权限，点击【添加有权限频道】连接，设置该组有权限访问的频道。";
			}
		}
		function CheckColumn()
		{
			if($("CheckCol").checked)
			{
				$("allowColumn").innerHTML="无权限栏目";
				$("RepallowColumn").innerHTML="添加无权限栏目";
				$("title_column").innerHTML="默认勾选：该组拥有所有栏目所有权限，点击【添加无权限栏目】连接，设置该组无权限访问的栏目。";
			}
			else
			{
				$("allowColumn").innerHTML="有权限栏目";
				$("RepallowColumn").innerHTML="添加有权限栏目";
				$("title_column").innerHTML="取消勾选：即该组无所有栏目所有权限，点击【添加有权限栏目】连接，设置该组有权限访问的栏目。";
			}
		}
    </script>
</head>

<body>
    <table cellspacing="1" cellpadding="0" class="wzdh" align="center">
        <tr>
            <td style="padding-left: 10px;">
                <img src="../Images/Skin/Default/you.gif" align="absmiddle" />
                您现在的位置：<a href="../SystemInfo.aspx">后台管理</a> &gt;&gt; <a href='AdminGroupList.aspx'>管理员组管理</a> &gt;&gt; 新增管理员组
			</td>
        </tr>
    </table>
    <table cellspacing="1" cellpadding="0" class="border" align="center">
        <tr>
            <td class="wzlist"><a href="AdminGroupList.aspx">管理员组列表</a> | <a href="PowerColumn.aspx">新增管理员组</a> | <a href="AdminList.aspx">管理员列表</a> | <a href="SetAdmin.aspx">新增管理员</a></td>
        </tr>
    </table>
    <form id="form1" runat="server">
        <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border" align="center">
            <tbody>
                <tr>
                    <td class="bqleft"><strong>管理员组名称：</strong></td>
                    <td class="bqright">
                        <asp:TextBox ID="PowerName" runat="server" Columns="35" MaxLength="40"></asp:TextBox>
                        <span style="color: red;">*</span>
					</td>
                </tr>
                <tr>
                    <td class="bqleft"><strong>请选择管理员组模型：</strong></td>
                    <td class="bqright">
                        <asp:DropDownList ID="PowerModel_List" runat="server" onchange="ModelPowerColumn(this.value)">
                            <asp:ListItem Value="0">不选择</asp:ListItem>
                        </asp:DropDownList>
					</td>
                </tr>
                <tr>
                    <td class="bqleft"><strong>管理员组说明：</strong></td>
                    <td class="bqright">
                        <asp:TextBox ID="PowerContent" runat="server" Columns="50" Rows="6" TextMode="MultiLine"></asp:TextBox>
					</td>
                </tr>
            </tbody>
            <tr>
                <td class="bqleft">内容管理：</td>
                <td class="qxright">
                    <table width="100%" cellpadding="0" cellspacing="1" border="0">
                        <tr>
                            <td colspan="2">
                                <asp:CheckBox ID="CheckCh" runat="server" Text="允许所有频道" onclick="CheckChannel()" Checked="true" />
							</td>
                        </tr>
                        <tr>
                            <td colspan="3"><span id="title_channel">默认勾选：该组拥有所有频道所有权限，点击【添加无权限频道】连接，设置该组无权限访问的频道。</span></td>
                        </tr>
                        <tr>
                            <td class="bqleft"><span id="allowChannel">无权限频道</span>
                                <asp:TextBox ID="ChannelInfoString" runat="server" Style="display: none;"></asp:TextBox>
							</td>
                            <td width="90%">
                                <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border" align="center">
                                    <tr class="title">
                                        <td>频道Id</td>
                                        <td>频道名称</td>
                                        <td>查看</td>
                                        <td>录入</td>
                                        <td>修改</td>
                                        <td>删除</td>
                                        <td>操作</td>
                                    </tr>
                                    <asp:Repeater ID="ChannelInfoPower" runat="server" OnItemCommand="ChannelInfoPower_ItemCommand">
                                        <ItemTemplate>
                                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                                <td><asp:Label ID="LabelChId" runat="server" Text='<%#Eval("ChId") %>'></asp:Label></td>
                                                <td><%#Eval("ChName") %></td>
                                                <td><asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#getCheck(Eval("show","{0}")) %>' onclick=<%#"SelectChannelInfoString('"+Eval("ChId","{0}")+"','0',this.checked)" %> /></td>
                                                <td><asp:CheckBox ID="CheckBox5" runat="server" Checked='<%#getCheck(Eval("insert","{0}")) %>' onclick=<%#"SelectChannelInfoString('"+Eval("ChId","{0}")+"','1',this.checked)" %> /></td>
                                                <td><asp:CheckBox ID="CheckBox6" runat="server" Checked='<%#getCheck(Eval("update","{0}")) %>' onclick=<%#"SelectChannelInfoString('"+Eval("ChId","{0}")+"','2',this.checked)" %> /></td>
                                                <td><asp:CheckBox ID="CheckBox7" runat="server" Checked='<%#getCheck(Eval("delete","{0}")) %>' onclick=<%#"SelectChannelInfoString('"+Eval("ChId","{0}")+"','3',this.checked)" %> /></td>
                                                <td><asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" CommandArgument='<%# Eval("ChId") %>'>删除</asp:LinkButton></td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    <script type="text/javascript">
										var jq = jQuery.noConflict();
										jQuery(function(){
											jQuery('#RepallowChannel').click(function(){
												jQuery.dialog({
													id: 'txtRepallowChannel',
													lock: true,
													title: '添加无权限频道',
													content: "url:../Common/SelChannel.aspx?ControlId=ChannelInfoString&ControlId2=ChannelBnt&ControlId3=system",
													width: 800,
													height: 500
												});
											});
											jQuery('#RepallowColumn').click(function(){
												jQuery.dialog({
													id: 'txtRepallowColumn',
													lock: true,
													title: '添加无权限栏目',
													content: "url:../Common/SelColumn.aspx?ControlId=ColumnInfoString&ControlId2=ColumnBnt&ControlId3=system",
													width: 800,
													height: 500
												});
											});
										});
                                    </script>
                                    <tr>
                                        <td colspan="9" class="qxright">
                                            <asp:ImageButton ID="ChannelBnt" runat="server" ImageUrl="~/Images/but.gif" OnClick="ImageButton1_Click" />
                                            <a id="RepallowChannel" class="mouseStyle">添加无权限频道</a>
										</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:CheckBox ID="CheckCol" runat="server" Text="允许所有栏目" onclick="CheckColumn()" Checked="true" />
							</td>
                        </tr>
                        <tr>
                            <td colspan="2"><span id="title_column">默认勾选：该组拥有所有栏目所有权限，点击【添加无权限栏目】连接，设置该组无权限访问的栏目。</span></td>
                        </tr>
                        <tr>
                            <td class="bqleft"><span id="allowColumn">无权限栏目</span>
                                <asp:TextBox ID="ColumnInfoString" runat="server" Style="display: none;"></asp:TextBox>
							</td>
                            <td>
                                <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border" align="center">
                                    <tr class="title">
                                        <td>栏目Id</td>
                                        <td>栏目名称</td>
                                        <td>查看</td>
                                        <td>录入</td>
                                        <td>修改</td>
                                        <td>删除</td>
                                        <td>操作</td>
                                    </tr>
                                    <asp:Repeater ID="ColumnInfoPower" runat="server" OnItemCommand="ColumnInfoPower_ItemCommand">
                                        <ItemTemplate>
                                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                                <td><%#Eval("ColId") %></td>
                                                <td><%#Eval("ColName") %></td>
                                                <td><asp:CheckBox ID="CheckBox2" runat="server" Checked='<%#getCheck(Eval("show","{0}")) %>' onclick=<%#"SelectColumnInfoString('"+Eval("ColId","{0}")+"','0',this.checked)" %> /></td>
                                                <td><asp:CheckBox ID="CheckBox5" runat="server" Checked='<%#getCheck(Eval("insert","{0}")) %>' onclick=<%#"SelectColumnInfoString('"+Eval("ColId","{0}")+"','1',this.checked)" %> /></td>
                                                <td><asp:CheckBox ID="CheckBox6" runat="server" Checked='<%#getCheck(Eval("update","{0}")) %>' onclick=<%#"SelectColumnInfoString('"+Eval("ColId","{0}")+"','2',this.checked)" %> /></td>
                                                <td><asp:CheckBox ID="CheckBox7" runat="server" Checked='<%#getCheck(Eval("delete","{0}")) %>' onclick=<%#"SelectColumnInfoString('"+Eval("ColId","{0}")+"','3',this.checked)" %> /></td>
                                                <td><asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" CommandArgument='<%# Eval("ColId") %>'>删除</asp:LinkButton></td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    <tr>
                                        <td class="qxright" colspan="9">
                                            <asp:ImageButton ID="ColumnBnt" runat="server" ImageUrl="~/Images/but.gif" OnClick="ColumnBnt_Click" />
                                            <a id="RepallowColumn" class="mouseStyle">添加无权限栏目</a>
										</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="bqleft"><strong>权限设置：</strong></td>
                <td class="bqright">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border" align="center">
                        <tbody>
                            <tr class="qxright">
                                <td colspan="4" align="left">
									<strong>模块权限</strong>
                                    <input type="checkbox" name="CheckTemp" value="checkbox" onclick="CheckBox('CheckTemp','1,2,3,4,5,6,7,8,9,10,11,12,36,38,35,33,48,49')">
                                    <span id="ShowCheckTemp">选择全部</span>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_1" runat="server" />
                                    <%=GetPowerColumn(1)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_36" runat="server" />
                                    <%=GetPowerColumn(36)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_2" runat="server" />
                                    <%=GetPowerColumn(2)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_3" runat="server" />
                                    <%=GetPowerColumn(3)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_5" runat="server" />
                                    <%=GetPowerColumn(5)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_6" runat="server" />
                                    <%=GetPowerColumn(6)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_7" runat="server" />
                                    <%=GetPowerColumn(7)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_8" runat="server" />
                                    <%=GetPowerColumn(8)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_9" runat="server" />
                                    <%=GetPowerColumn(9)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_10" runat="server" />
                                    <%=GetPowerColumn(10)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_11" runat="server" />
                                    <%=GetPowerColumn(11)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_12" runat="server" />
                                    <%=GetPowerColumn(12)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_4" runat="server" />
                                    <%=GetPowerColumn(4)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_38" runat="server" />
                                    <%=GetPowerColumn(38)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_35" runat="server" />
                                    <%=GetPowerColumn(35)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_33" runat="server" />
                                    <%=GetPowerColumn(33)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_48" runat="server" />
                                    <%=GetPowerColumn(48)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_49" runat="server" />
                                    <%=GetPowerColumn(49)%>
								</td>
                                <td align="left"></td>
                                <td align="left"></td>
                            </tr>
                            <tr class="qxright">
                                <td colspan="4" align="left"><strong>用户权限</strong>
                                    <input type="checkbox" name="CheckUser" value="checkbox" onclick="CheckBox('CheckUser','13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,37,46,47')">
                                    <span id="ShowCheckUser">选择全部</span>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_13" runat="server" />
                                    <%=GetPowerColumn(13)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_14" runat="server" />
                                    <%=GetPowerColumn(14)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_15" runat="server" />
                                    <%=GetPowerColumn(15)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_37" runat="server" />
                                    <%=GetPowerColumn(37)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_16" runat="server" />
                                    <%=GetPowerColumn(16)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_17" runat="server" />
                                    <%=GetPowerColumn(17)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_18" runat="server" />
                                    <%=GetPowerColumn(18)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_19" runat="server" />
                                    <%=GetPowerColumn(19)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_20" runat="server" />
                                    <%=GetPowerColumn(20)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_21" runat="server" />
                                    <%=GetPowerColumn(21)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_22" runat="server" />
                                    <%=GetPowerColumn(22)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_23" runat="server" />
                                    <%=GetPowerColumn(23)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_24" runat="server" />
                                    <%=GetPowerColumn(24)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_25" runat="server" />
                                    <%=GetPowerColumn(25)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_26" runat="server" />
                                    <%=GetPowerColumn(26)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_27" runat="server" />
                                    <%=GetPowerColumn(27)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_46" runat="server" />
                                    <%=GetPowerColumn(46)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_47" runat="server" />
                                    <%=GetPowerColumn(47)%>
								</td>
                                <td align="left"></td>
                                <td align="left"></td>
                            </tr>
                            <tr class="qxright">
                                <td colspan="4" align="left"><strong>批量设置权限</strong>
                                    <input type="checkbox" name="CheckBatch" value="checkbox" onclick="CheckBox('CheckBatch','40,41,42,43,44,45')">
                                    <span id="ShowCheckBatch">选择全部</span>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_40" runat="server" />
                                    <%=GetPowerColumn(40)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_41" runat="server" />
                                    <%=GetPowerColumn(41)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_42" runat="server" />
                                    <%=GetPowerColumn(42)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_43" runat="server" />
                                    <%=GetPowerColumn(43)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_44" runat="server" />
                                    <%=GetPowerColumn(44)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_45" runat="server" />
                                    <%=GetPowerColumn(45)%>
								</td>
                                <td align="left"></td>
                                <td align="left"></td>
                            </tr>
                            <tr class="qxright">
                                <td colspan="4" align="left"><strong>其他权限</strong>
                                    <input type="checkbox" name="CheckOther" value="checkbox" onclick="CheckBox('CheckOther','28,29,30,31,32,39,34')">
                                    <span id="ShowCheckOther">选择全部</span>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_28" runat="server" />
                                    <%=GetPowerColumn(28)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_29" runat="server" />
                                    <%=GetPowerColumn(29)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_30" runat="server" />
                                    <%=GetPowerColumn(30)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_31" runat="server" />
                                    <%=GetPowerColumn(31)%>
								</td>
                            </tr>
                            <tr class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                                <td align="left">
                                    <asp:CheckBox ID="PCId_32" runat="server" />
                                    <%=GetPowerColumn(32)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_39" runat="server" />
                                    <%=GetPowerColumn(39)%>
								</td>
                                <td align="left">
                                    <asp:CheckBox ID="PCId_34" runat="server" />
                                    <%=GetPowerColumn(34)%>
								</td>
                                <td align="left"></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="bqleft"></td>
                <td class="bqright">
                    <asp:Button ID="Button1" runat="server" CssClass="btn" Text="保存设置" OnClick="Button1_Click" OnClientClick=" return CheckValidate()" />
                    <asp:Button ID="Button2" runat="server" CssClass="btn" Text="保存为管理员组模型" OnClick="Button1_Click" />
				</td>
            </tr>
        </table>
        <asp:Literal ID="LitMsg" runat="server"></asp:Literal>
    </form>
    <br />
</body>
</html>