<%@ page language="VB" autoeventwireup="false" title="功能用户" masterpagefile="~/blank.master" inherits="WebExam.Web.department_manage_D, App_Web_st1xh0ee" %>

<%@ MasterType VirtualPath="~/blank.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHead" runat="server">
    <style type="text/css">
        ul
        {
            list-style-type: decimal;
            list-style-position: inside;
        }
        dd{ margin:10px}
    </style>
</asp:Content>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">

        $().ready(
        function () {



            var role = jQuery.url.param("role");
            switch (role) {
                case "5":
                    $("h3").html("部门主管");
                    parent.document.title = "部门主管";
                    document.getElementById("dd_bmzg").style.fontWeight = "bold";
                    break;
                case "6":
                    $("h3").html("题库主管");
                    parent.document.title = "题库主管";
                    document.getElementById("dd_tkzg").style.fontWeight = "bold";
                    break;
                case "3":
                    $("h3").html("部门主考");
                    parent.document.title = "部门主考";
                    document.getElementById("dd_bmzk").style.fontWeight = "bold";
                    break;
                case "7":
                    $("h3").html("内容主管");
                    parent.document.title = "内容主管";
                    document.getElementById("dd_nrzg").style.fontWeight = "bold";
                    break;

            };
        })


        function addExamer() {
            var departid = jQuery.url.param("id");
            if (departid == "") return;
            var url = "/department/users/ulist.aspx?id=" + departid
            parent.__modalFrame(url, 600, 500, null)

        }
        function add(idArr) {
            var departid = jQuery.url.param("id");
            if (departid == "") return;

            document.getElementById("TB_addUsers").value = idArr;
            document.getElementById("<%= Btn_addUsers.ClientId() %>").click();
        }
        function checkselect() {
            var userList = "";
            var userListBox = document.getElementById("tb_selectUser");
            var form = document.forms[0];
            if (form.cb_users == null) userListBox.value = ""; else {
                if (form.cb_users.length == null) {
                    if (form.cb_users.checked) userListBox.value = form.cb_users.value;
                    else

                        userListBox.value = "";
                }
                else {
                    var checklength = form.cb_users.length

                    for (var i = 0; i < checklength; i++) {
                        if (form.cb_users(i).checked)
                        { userList += "," + form.cb_users(i).value; }
                    }
                    if (userList != "")
                        userList = userList.substring(1);
                    userListBox.value = userList;

                }
            }
            if (userListBox.value == "") { alert("请选择用户！"); return false } else {
                if (confirm("确定删除该用户权限吗？")) { return true } else { return false }


            }
        }
        function userInfo_onclick(userid) {
            //window.showModelessDialog('adduser.aspx'+window.location.search,'','scroll:yes;Status:no;help:no');
            var newwin = window.showModalDialog('/department/userinfo.aspx?userid=' + encodeURI(userid), "msgWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=530,height=530,screenX=1,screenY=1,top=" + (screen.AvailHeight - 500) / 2 + ",left=" + (screen.AvailWidth - 540) / 2);


            //window.top.location ='userInfo.aspx?userid='+userid
        }
    </script>
    <h3>
    </h3>
    <asp:Repeater ID="Repeater1" runat="server">
        <HeaderTemplate>
            <ul>
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <input type="checkbox" name="cb_users" value='<%# DataBinder.Eval(Container.DataItem, "userid") %>' /><a
                    href='javascript:userInfo_onclick("<%# DataBinder.Eval(Container.DataItem, "userid") %>")'>
                    <%# DataBinder.Eval(Container.DataItem, "userid") %>
                </a></li>
        </ItemTemplate>
        <FooterTemplate>
            </ul></FooterTemplate>
    </asp:Repeater>
    <div>
        用户名：
        <asp:TextBox ID="TB_user" runat="server" ValidationGroup="a"></asp:TextBox><asp:RequiredFieldValidator
            ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="TB_user"
            ValidationGroup="a"></asp:RequiredFieldValidator>
        <asp:Button ID="Btn_addUsers" runat="server" Text="添加" />
        <input id="tb_selectUser" type="hidden" name="tb_selectUser" />
        <asp:Button runat="server" Text="删除所选" ID="btn_del" ValidationGroup="b" OnClientClick="return checkselect()" />
    </div>
    <dl>
    <dt style="font-weight:bold">用户功能说明</dt>
    <dd class="m" id="dd_bmzk">部门主考：具备编辑试卷、教学资料的权限，并负责组织本部门及下属部门的考试。由系统管理员或其主考部门及上级部门主管维护其账号。</dd>
    <dd class="m" id="dd_bmzg">部门主管：负责维护本部门及下属部门的用户资料，指定本部门或下属部门的主考人员。由系统管理员或其上级部门主管维护其账号。</dd>
    <dd class="m" id="dd_nrzg">内容主管：负责审查维护由其他用户发布在管辖科目及下属科目的练习卷、教学资源等内容。由系统管理员或其上级内容主管维护其账号。</dd>
    <dd class="m" id="dd_tkzg">题库主管：负责维护管辖科目及下属科目的试题资源。由系统管理员或其上级题库主管维护其账号。</dd>
    
    
    </dl>
</asp:Content>
