<%@ page language="C#" autoeventwireup="true" inherits="user_user_UserManager, ALL" enableEventValidation="false" %>

<%@ Register Src="~/user/MyHeader.ascx" TagPrefix="uc1" TagName="MyHeader" %>
<%@ Register Src="~/user/MyFooter.ascx" TagPrefix="uc1" TagName="MyFooter" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会议室预约系统</title>
    <link href="/control/plugin/bootstrap3/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/admin/css/style.css?v=201721" rel="stylesheet" />

    <script src="/control/js/jquery.js"></script>
    <script src="/control/plugin/bootstrap3/js/bootstrap.min.js"></script>
    <link href="/control/css/msgbox.css" rel="stylesheet" />
    <script src="/control/js/msgbox.js"></script>

    <link href="/control/plugin/bootstrap-treeview/bootstrap-treeview.min.css" rel="stylesheet" />

    <script src="/control/plugin/bootstrap-treeview/bootstrap-treeview.min.js?v=5"></script>

</head>
<body>
    <uc1:MyHeader runat="server" ID="MyHeader1" />
    <div class=" container-fluid">
        <ul class="nav nav-tabs" role="tablist">
        
     
      
            <li role="presentation" class="active"><a href="/user/user/userManager.aspx">用户管理</a></li>
            <li role="presentation"><a href="/user/room/RoomManager.aspx">会议室管理</a></li>
        </ul>
        <div class="panel">
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-3">
                        <div id="tree"></div>
                        <script>
                            $('#tree').treeview({
                                levels: 10000,
                                showTags: true,
                                data: <%=BuilderTree()%>,
                                onNodeSelected: function(event, node) {
                            setd(node.id);
                        }
                    });
                        </script>
                        <%--
                    <div class="list-group" >
                     <a href="javascript:setd('')" 
                               id=""
                               class="list-group-item ">
                           全部
                           </a>

                   <asp:Repeater ID="rptDepartment" runat="server">
                       <ItemTemplate>
                           <a href="javascript:setd('<%#Eval("d_id") %>')" 
                               id="<%# Eval("d_id") %>"
                               class="list-group-item ">
                               <%#Eval("d_name") %>
                           </a>
                       </ItemTemplate>
                   </asp:Repeater>
               </div>--%>
                    </div>
                    <script type="text/javascript">
          
                        function setd(did) {
                            $("#hfdid").val(did);
                            $("#search").submit();
                        }
                
                    </script>
                    <div class="col-lg-9">
                        <div class="well">
                            <form id="search" class="form-inline" method="get">
                                <div class="form-group">
                                    <label for="txtstart">拼音首字母:</label>
                                    <input type="text" class="form-control" id="txtinitials" style="width: 80px" name="initials" value="<%=Request["initials"] %>" />
                                </div>
                                <div class="form-group">
                                    <label for="txtstart">姓名:</label>
                                    <input type="text" class="form-control" id="txtName" style="width: 80px" name="name" value="<%=Request["name"] %>" />
                                    <input id="hfdid" name="depart" type="hidden" value="<%=Request["depart"] %>" />
                                </div>
                                <div class="form-group">
                                    <label for="txtstart">手机号码:</label>
                                    <input type="text" class="form-control" id="txtPhone" style="width: 130px" name="phone" value="<%=Request["phone"] %>" />
                                </div>
                                <div class="form-group">
                                    <label for="txtstart">E_Mail:</label>
                                    <input type="text" class="form-control" id="txtEmail" style="width: 130px" name="email" value="<%=Request["email"] %>" />
                                </div>
                                <button type="submit" class="btn btn-default">查询</button>
                                <button type="button" class="btn btn-primary" onclick="add()">
                                    <i class="glyphicon glyphicon-plus"></i>添加用户
                                </button>
                            </form>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-body">

                                <asp:Repeater ID="rptData" runat="server">
                                    <HeaderTemplate>
                                        <table id="dataView" class="table table-hover ">
                                            <thead>
                                                <tr class='table-heading'>
                                                    <%--     <th>所在机构</th>--%>
                                                    <th>姓名</th>
                                                    <th>职位</th>
                                                    <th>手机号码</th>
                                                    <th>E-Mail</th>
                                                    <th>允许登录</th>
                                                    <th>角色</th>
                                                    <th>修改日期</th>
                                                    <th></th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr>
                                            <%--          <td><%#Eval("Depart") %></td>--%>
                                            <td>
                                                <%#Eval("ee_name")%>
                                            </td>
                                            <td>
                                                <%#Eval("ee_job")%>
                                            </td>
                                            <td>
                                                <%#Eval("ee_phone")%>
                                            </td>
                                            <td>
                                                <%#Eval("ee_email")%>
                                            </td>
                                            <td>
                                                <%#((bool)Eval("ee_notAllowLogin"))?"<span class='label label-danger'>禁止</span>":"允许"%>
                                            </td>
                                            <td>
                                                <%#((bool)Eval("ee_bespeak"))?"会议室专员":String.Empty%>
                                            </td>
                                            <td>
                                                <%#Eval("ee_udate")%>
                                            </td>
                                            <td>
                                                <button onclick="edit('<%#Eval("ee_id") %>')" class="btn btn-default btn-xs" type="button">编辑</button>
                                                |
                                        <button type="button" class="btn btn-default btn-xs" onclick="rd('<%#Eval("ee_id") %>')">删除</button>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </tbody> </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </div>

                            <%-- <div class="panel-footer">--%>
                            <%--</div>--%>
                        </div>
                        <asp:Literal ID="litPage" runat="server"></asp:Literal>
                    </div>
                </div>

            </div>
        </div>

    </div>
    <uc1:MyFooter runat="server" ID="MyFooter1" />

    <script type="text/javascript">

        function add() {
            $("#iframeContent").hide();
            $("#iframeContent").attr("src", "/user/user/UserManager_Add.aspx");
            $("#OperDialog").modal({ backdrop: false });
            $("#operTitle").text("添加");
        }
        function edit(id) {

            $("#iframeContent").hide();
            $("#iframeContent").attr("src", "/user/user/UserManager_Edit.aspx?id=" + id);
            $("#OperDialog").modal({ backdrop: false });
            $("#operTitle").text("编辑");
        }
        function reload() {
            window.location.reload();
        }
        function ShowDialog() {
            $("#iframeContent").show();
        }
        function rd(key) {
            if (confirm('确定删除该项！')) {
                ZENG.msgbox.show('删除中...', 6);
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    data: { "did": key },
                    success: function (result) {
                        ZENG.msgbox._hide();
                        if (result.state == 1) {
                            location.reload();
                        } else {
                            alert(result.data);
                        }
                    }
                });
            }
        }
    </script>
    <div class="modal" id="OperDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
        <div class="modal-dialog  modal-lg " role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="operTitle"></h4>
                </div>
                <div class="modal-body">
                    <div style="height: 715px">
                        <iframe id="iframeContent" width="100%" height="705" frameborder="0" style="display: none"></iframe>
                    </div>
                    <!-- Table -->
                </div>
            </div>
        </div>
    </div>

</body>
</html>
