<%@ Page Language="C#" AutoEventWireup="true" Inherits="MyITJob.Admin_Admin_Manage" Codebehind="Admin_Manage.aspx.cs" %>

<!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>
        <%=Application["PageTitle"] %>
        ——管理员管理窗口</title>
    <link href="../images/Admin_Style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .red_font {color: #FF0000}
	</style>
	<script language="javascript" type="text/javascript">
	function checkall(name, max){
	    var all = document.getElementById(name);
	    for(var i = 1; i <= max; i++){
	        if(all.checked){
	            var child = document.getElementById(name + i);
	            child.checked = true;
	        }else{
	            var child = document.getElementById(name + i);
	            child.checked = false;
	        }
	    }
	}
	function userAdmin(){
	    var obj = document.getElementById("AddID");
        if(/.*[\u4e00-\u9fa5]+.*$/.test(obj.value)){
        alert('管理员登陆ID不能为中文');
        obj.value = "";
        obj.focus();
        return false; 
        }
	}
	</script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table width='100%' border='0' align='center' cellpadding='4' cellspacing='1' class='border'>
                <tr class='topbg'>
                    <td colspan="2" align='center'>
                        <strong class="Glow">管 理 员 管 理</strong></td>
                </tr>
                <tr class='tdbg'>
                    <td width='70'>
                        <strong>管理导航：</strong></td>
                    <td>
                        <a href="?Action=Add">添加管理员</a> | <a href="Admin_Manage.aspx">管理员列表</a></td>
                </tr>
            </table>
            <br />
            <asp:Panel ID="addP" runat="server" Width="100%" Visible="False">
                <table width='100%' border='0' align='center' cellpadding='4' cellspacing='1' class='border'>
                    <tr class='tdbg'>
                        <td width="15%" class="tdbg2" align="right">
                            管理员ID：</td>
                        <td width="85%">
                            <asp:TextBox ID="AddID" runat="server" MaxLength="10" onblur="userAdmin();" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="AddID" ErrorMessage="请输入管理员登录名"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            初始密码：</td>
                        <td>
                            <asp:TextBox ID="AddPWD" runat="server" TextMode="Password" Width="127px" MaxLength="16" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="AddPWD" ErrorMessage="请输入密码"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            确认密码：
                        </td>
                        <td>
                            <asp:TextBox ID="AddPwd2" runat="server" TextMode="Password" Width="127px" MaxLength="16" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="AddPwd2" ErrorMessage="请输入密码"></asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="AddPWD" ControlToValidate="AddPwd2" ErrorMessage="两次输入的密码不一致"></asp:CompareValidator></td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            管理员姓名：</td>
                        <td>
                            <asp:TextBox ID="AddName" runat="server" MaxLength="10" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="请输入真实姓名" ControlToValidate="AddName"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            管理员QQ：</td>
                        <td>
                            <asp:TextBox ID="AddQQ" runat="server" MaxLength="16"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="请输入QQ号码" ControlToValidate="AddQQ"></asp:RequiredFieldValidator></td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbg2" align="right">
                            管理员邮箱地址：</td>
                        <td>
                            <asp:TextBox ID="AddEMail" runat="server" MaxLength="30"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="AddEMail" ErrorMessage="请输入邮件地址" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            管理员管理地区：</td>
                        <td>
                            <asp:DropDownList ID="DDL1" runat="server">
                            </asp:DropDownList>
                            <span class="STYLE4">* 超级管理员请默认所有地区；分站管理员请选择二级目录，否则无法管理文章、企业和简历。</span></td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="editP" runat="server" Width="100%" Visible="False">
                <table width='100%' border='0' align='center' cellpadding='4' cellspacing='1' class='border'>
                    <tr class='tdbg'>
                        <td width="15%" class="tdbg2" align="right">
                            管理员ID：</td>
                        <td width="85%" valign="top">
                            <asp:TextBox ID="EditID" runat="server" Enabled="false" />
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td width="15%" class="tdbg2" align="right">
                            原始密码：</td>
                        <td width="85%" valign="top">
                            <asp:TextBox ID="OldEditPwd" runat="server" TextMode="Password" Width="127px" MaxLength="16" />
                            <asp:Label ID="EditLabel1" runat="server" ForeColor="Red"></asp:Label></td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            新密码：</td>
                        <td>
                            <asp:TextBox ID="EditPWD" runat="server" TextMode="Password" Width="127px" MaxLength="16" />&nbsp;
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            确认新密码：
                        </td>
                        <td>
                            <asp:TextBox ID="EditPwd2" runat="server" TextMode="Password" Width="127px" MaxLength="16" />
                            <asp:CompareValidator ID="EditCV1" runat="server" ControlToCompare="EditPWD" ControlToValidate="EditPwd2" ErrorMessage="两次输入的密码不一致"></asp:CompareValidator></td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbg2" align="right">
                            管理员QQ：</td>
                        <td>
                            <asp:TextBox ID="EditQQ" runat="server" Width="127px" MaxLength="16" /></td>
                    </tr>
                    <tr class="tdbg">
                        <td class="tdbg2" align="right">
                            管理员邮箱地址：</td>
                        <td>
                            <asp:TextBox ID="EditEmail" runat="server" Width="127px" MaxLength="16" /></td>
                    </tr>
                    <tr class='tdbg'>
                        <td class="tdbg2" align="right">
                            管理员管理地区：</td>
                        <td>
                            <asp:DropDownList ID="EditDDL1" runat="server">
                            </asp:DropDownList></td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="Panel1" runat="server" Width="100%" Visible="false">
            <br />
                <table width='100%' border='0' align='center' cellpadding='4' cellspacing='1' class='border'>
                    <tr class='topbg'>
                        <td colspan="2" align='center'>
                            <strong class="Glow">管 理 员 权 限 管 理</strong></td>
                    </tr>
                    <tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            文章管理权限<input id="article" type="checkbox" onclick="checkall(this.id, 12);" /></td>
                        <td >
                            <label><input id="article1" type="checkbox" value="01" runat="server" />查看文章</label>
                            <label><input id="article2" type="checkbox" value="02" runat="server" />添加文章【包括文章分类】</label><br />
                            <label><input id="article3" type="checkbox" value="03" runat="server" />修改文章【包括置顶、滚动、文章分类操作】</label><br />
                            <label><input id="article4" type="checkbox" value="04" runat="server" />删除文章【包括文章分类】</label><br />
                            <label><input id="article5" type="checkbox" value="14_1" runat="server" />查看投票</label>
                            <label><input id="article6" type="checkbox" value="14_2" runat="server" />添加投票</label>
                            <label><input id="article7" type="checkbox" value="14_3" runat="server" />修改投票</label>
                            <label><input id="article8" type="checkbox" value="14_4" runat="server" />删除投票</label>
                            <label><input id="article9" type="checkbox" value="marqueeM" runat="server" />管理小Q提示</label>
                            <label><input id="article10" type="checkbox" value="marqueeA" runat="server" />添加小Q提示</label>
                            <label><input id="article11" type="checkbox" value="marqueeE" runat="server" />修改小Q提示</label>
                            <label><input id="article12" type="checkbox" value="marqueeD" runat="server" />删除小Q提示</label>
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            采集系统权限<input id="coll" type="checkbox" onclick="checkall(this.id, 4);" /></td>
                        <td>
                            <label><input id="coll1" type="checkbox" value="05" runat="server" />查看采集【包括能进行采集操作】</label>
                            <label><input id="coll2" type="checkbox" value="06" runat="server" />添加采集</label>
                            <label><input id="coll3" type="checkbox" value="07" runat="server" />修改采集</label>
                            <label><input id="coll4" type="checkbox" value="08" runat="server" />删除文章</label>
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            个人管理权限<input id="person" type="checkbox" onclick="checkall(this.id, 4);" /></td>
                        <td>
                            <label><input id="person1" type="checkbox" value="09" runat="server" />个人用户管理、求职管理</label><br />
                            <label><input id="person2" type="checkbox" value="10" runat="server" />修改个人资料【包括求职信息、修改密码】</label><br />
                            <label><input id="person3" type="checkbox" value="11" runat="server" />删除个人资料</label><br />
                            <label><input id="person4" type="checkbox" value="12" runat="server" />个人身份转换【包括普通会员、推荐会员】</label>
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            院校管理权限<input id="school" type="checkbox" onclick="checkall(this.id, 3);" /></td>
                        <td>
                            <label><input id="school1" type="checkbox" value="LookSchool" runat="server" />查看院校列表【包括代理登陆】</label><br />
                            <label><input id="school2" type="checkbox" value="EditSchool" runat="server" />修改院校资料【包括活动上色、修改密码】</label><br />
                            <label><input id="school3" type="checkbox" value="DelSchool" runat="server" />删除院校资料</label><br />
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            企业管理权限<input id="company" type="checkbox" onclick="checkall(this.id, 10);" /></td>
                        <td>
                            <label><input id="company1" type="checkbox" value="13" runat="server" />查看企业列表、招聘列表、充值消费记录</label><br />
                            <label><input id="company2" type="checkbox" value="14" runat="server" />修改企业资料【包括充值、密码、猎头服务】</label><br />
                            <label><input id="company3" type="checkbox" value="15" runat="server" />删除企业资料【包括招聘信息】</label><br />
                            <label><input id="company4" type="checkbox" value="16_0" runat="server" />企业身份转换【包括是否审核、普通、知企、图文、紧急招聘操作】</label><br />
                            <label><input id="company5" type="checkbox" value="16_1" runat="server" />查看企业组</label>
                            <label><input id="company6" type="checkbox" value="16_2" runat="server" />添加企业组</label>
                            <label><input id="company7" type="checkbox" value="16_3" runat="server" />修改企业组</label>
                            <label><input id="company8" type="checkbox" value="16_4" runat="server" />删除企业组</label>
                            <label><input id="company9" type="checkbox" value="Look1zp" runat="server" />查看一句求贤列表</label>
                            <label><input id="company10" type="checkbox" value="Manage_Look1zp" runat="server" />管理查看一句求贤【包括修改、删除操作】</label>
                        </td>
                    </tr><tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            展会管理权限<input id="zh" type="checkbox" onclick="checkall(this.id, 4);" /></td>
                        <td>
                            <label><input id="zh1" type="checkbox" value="zhLook" runat="server" />查看企业展会列表、参会说明、企业订单</label><br />
                            <label><input id="zh2" type="checkbox" value="zhAdd" runat="server" />添加企业展会信息</label><br />
                            <label><input id="zh3" type="checkbox" value="zhEdit" runat="server" />修改企业展会资料【包括修改参会说明、审核企业订单】</label><br />
                            <label><input id="zh4" type="checkbox" value="zhDel" runat="server" />删除企业展会信息</label><br />
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            管理员管理权限<input id="admin" type="checkbox" onclick="checkall(this.id, 4);" /><br /><span class="STYLE4">*全选则创建超级管理员</span></td>
                        <td>
                            <label><input id="admin1" type="checkbox" value="17" runat="server" />查看管理员列表【不勾选这项，登陆者只能查看自己的列表】</label><br />
                            <label><input id="admin2" type="checkbox" value="18" runat="server" />添加管理员资料</label><br />
                            <label><input id="admin3" type="checkbox" value="19" runat="server" />修改管理员资料【如不勾选"查看列表选项"，则只能修改自己的信息，但不能修改权限】</label><br />
                            <label><input id="admin4" type="checkbox" value="20" runat="server" />删除管理员资料</label>
                        </td>
                    </tr>
                    <tr class='tdbg'>
                        <td align="right" class="tdbg2">
                            广告管理权限<input id="ad" type="checkbox" onclick="checkall(this.id, 4);" /></td>
                        <td>
                            <label><input id="ad1" type="checkbox" value="21" runat="server" />查看广告</label>
                            <label><input id="ad2" type="checkbox" value="22" runat="server" />添加广告</label>
                            <label><input id="ad3" type="checkbox" value="23" runat="server" />修改广告</label>
                            <label><input id="ad4" type="checkbox" value="24" runat="server" />删除广告</label>
                        </td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            友情链接权限<input id="friend" type="checkbox" onclick="checkall(this.id, 3);" /></td>
                      <td>
                            <label><input id="friend1" type="checkbox" value="25" runat="server" />查看友情链接</label>
                            <label><input id="friend2" type="checkbox" value="26" runat="server" />修改友情链接</label>
                            <label><input id="friend3" type="checkbox" value="27" runat="server" />删除友情链接</label>
                      </td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            系统设置权限<input id="system" type="checkbox" onclick="checkall(this.id, 6);" /></td>
                      <td>
                            <label><input id="system1" type="checkbox" value="28" runat="server" />查看系统设置</label>
                            <label><input id="system2" type="checkbox" value="29" runat="server" />添加系统设置</label>
                            <label><input id="system3" type="checkbox" value="30" runat="server" />修改系统设置</label>
                            <label><input id="system4" type="checkbox" value="31" runat="server" />删除系统设置</label>
                            <label><input id="system5" type="checkbox" value="32_0" runat="server" />允许发送邮件</label>
                            <label><input id="system6" type="checkbox" value="32_1" runat="server" />修改注册协议</label>
                      </td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            数据库操作权限<input id="sjk" type="checkbox" onclick="checkall(this.id, 2);" /></td>
                      <td>
                            <label><input id="sjk1" type="checkbox" value="33" runat="server" />查看数据</label>
                            <label><input id="sjk2" type="checkbox" value="34" runat="server" />操作数据</label>
                      </td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            模板操作权限<input id="Template" type="checkbox" onclick="checkall(this.id, 4);" /></td>
                      <td>
                            <label><input id="Template1" type="checkbox" value="35" runat="server" />查看模板</label>
                            <label><input id="Template2" type="checkbox" value="36" runat="server" />操作模板</label>
                            <label><input id="Template3" type="checkbox" value="37_0" runat="server" />查看 CSS</label>
                            <label><input id="Template4" type="checkbox" value="37_1" runat="server" />操作 CSS</label>
                      </td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            在线支付操作权限<input id="InterBank" type="checkbox" onclick="checkall(this.id, 2);" /></td>
                      <td>
                            <label><input id="InterBank1" type="checkbox" value="38_0" runat="server" />查看设置</label>
                            <label><input id="InterBank2" type="checkbox" value="38_1" runat="server" />修改设置</label></td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            网站地图生成权限<input id="SiteMap" type="checkbox" onclick="checkall(this.id, 2);" /></td>
                      <td>
                            <label><input id="SiteMap1" type="checkbox" value="39_0" runat="server" />查看设置</label>
                            <label><input id="SiteMap2" type="checkbox" value="39_1" runat="server" />生成操作</label></td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            分站功能权限<input id="ChildHost" type="checkbox" onclick="checkall(this.id, 3);" /></td>
                      <td>
                            <label><input id="ChildHost1" type="checkbox" value="LookHost" runat="server" />查看分站</label>
                            <label><input id="ChildHost2" type="checkbox" value="AddHost" runat="server" />添加分站</label>
                            <label><input id="ChildHost3" type="checkbox" value="EditandDelHost" runat="server" />修改/删除分站</label></td>
                    </tr>
                    <tr class='tdbg'>
                      <td align="right" class="tdbg2">
                            视频管理权限<input id="Video" type="checkbox" onclick="checkall(this.id, 3);" /></td>
                      <td>
                            <label><input id="Video1" type="checkbox" value="LookVideo" runat="server" />查看视频界面</label>
                            <label><input id="Video2" type="checkbox" value="EditVideo" runat="server" />修改视频权限</label>
                            <label><input id="Video3" type="checkbox" value="DelVideo" runat="server" />删除视频权限</label>
                      </td>
                    </tr>
            </table>
            <div align="center">
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="确定" />
            <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="修改" />
            <input type="reset" name="Submit" value="重置" />
            </div>
            <br />
            <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
            </asp:Panel>
            <asp:Panel ID="manageP" runat="server" Width="100%" Visible="False">
                <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
                    <tr class='topbg2'>
                        <td width="7%" align='center' style="height: 24px">
                            <strong class="Glow">序号</strong></td>
                        <td width="18%" align='center' style="height: 24px">
                            <strong class="Glow">管理员ID<span style="color: #000000">（管辖区域）</span></strong></td>
                        <td width="12%" align='center' style="color: #000000; height: 24px">
                            <strong class="Glow">站长</strong></td>
                        <td width="8%" align='center' style="height: 24px">
                            <strong class="Glow">状态</strong></td>
                        <td width="19%" align='center' style="height: 24px">
                            <strong class="Glow">操作</strong></td>
                    </tr>
                    <asp:Repeater ID="RP1" runat="server">
                        <ItemTemplate>
                            <tr class='tdbg'>
                                <td align='center'>
                                    <%#Eval("ID") %>
                                </td>
                                <td align='center'>
                                    <%#Eval("LoginName")%>
                                    <span style="color: #000000">（<%#Eval("loginfrom") %>）</span></strong>
                                </td>
                                <td align='center'>
                                    <%#Eval("ManName") %>
                                    <a target="blank" href="tencent://message/?uin=<%#Eval("LoginQQ") %>&Site=<%=Application["PageTitle"]%>&Menu=yes">
                                        <img border='0' src="http://wpa.qq.com/pa?p=1:<%#Eval("LoginQQ") %>:9 alt='点击我进行留言吧'"></a>
                                </td>
                                <td align='center'>
                                    <%#sf() %>
                                </td>
                                <td align='center'>
                                    <a href="Admin_Manage.aspx?id=<%#Eval("ID")%>&amp;Action=Edit">修改</a> | <a href="Admin_Manage.aspx?id=<%#Eval("ID") %>&amp;Action=Del" onclick="return confirm('确定要删除此项吗？此操作不可逆。');">删除</a></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
                <br />
                <span class="red_font">备注</span>：超级管理员进入修改，可以设置该管理员的各项操作权限。
            </asp:Panel>
        </div>
    </form>
</body>
</html>
