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


<%@ Register Src="~/admin/MyHeader.ascx" TagPrefix="uc1" TagName="MyHeader" %>
<%@ Register Src="~/admin/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"></script>

</head>
<body>
    <uc1:MyHeader runat="server" ID="MyHeader1" />
    <div class=" container-fluid">
        <div class="row">
            <div class="col-xs-12 ">
                <h3 class="page-header" style="margin: 15px 0 20px;">会议室管理<small> 管理会议室信息和相关预约</small></h3>
            </div>
        </div>
        <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);
                        }
                    });

                    function setd(id)
                    {
                     
                        $("#hfdepart").val(id);
                        $("#search").submit();
                    }
                </script>
            </div>
            <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="txtName" name="name" value="<%=Request["name"] %>" />
                            <input id="hfdepart" name="depart" type="hidden" />
                        </div>
                        <button type="submit" class="btn btn-default">查询</button>
                        <a type="button" class="btn btn-primary" href="Room_Add.aspx">
                            <i class="glyphicon glyphicon-plus"></i>添加会议室
                        </a>
                    </form>
                </div>

                <div class="panel">
                    <div class="panel-body">
                        <asp:Repeater ID="rptData" runat="server">
                            <HeaderTemplate>
                                <table id="dataView" class="table table-hover table-striped ">
                                    <thead>
                                        <tr class='table-heading'>
                                            <th>序号</th>
                                            <th>所属机构</th>
                                            <th>会议室名称</th>
                                            <th>面积</th>
                                            <th>可容纳人数</th>
                                            <th>预约限制</th>
                                            <th>修改日期</th>
                                            <th>禁止预订</th>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <%#Eval("rowNum") %>
                                    </td>
                                    <td>
                                        <%#Eval("d_index") %>/<%#Eval("d_name") %>
                                    </td>
                                    <td>
                                        <%#Eval("r_name")%>
                                    </td>
                                    <td>
                                        <%#Eval("r_size")%>
                                    </td>
                                    <td>
                                        <%#Eval("r_maxNumber")%>
                                    </td>



                                    <td>
                                        <%#((bool)Eval("r_bespeak"))?"专员":"不限"%>
                                    </td>

                                    <td>
                                        <%#Eval("r_udate")%>
                                    </td>
                                    <td>
                                        <%#((bool)Eval("r_disable"))?"<span class='label label-danger'>禁止预订</span>":String.Empty%>
                                    </td>
                                    <td>
                                        <a href="Room_Edit.aspx?id=<%#Eval("id")%>" class="btn btn-default btn-xs">编辑</a>

                                        <a href="Room_Details.aspx?id=<%#Eval("id")%>" class="btn btn-default btn-xs">详细</a>
                                        <a href="Room_Meeting.aspx?id=<%#Eval("id")%>" class="btn btn-default btn-xs">会议</a>

                                       <%-- <button type="button" onclick="rd('<%#Eval("id")%>')" class="btn  btn-danger btn-xs">删除</button>--%>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </tbody> </table>
                            </FooterTemplate>
                        </asp:Repeater>

                    </div>

                </div>




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

    <%--    <script type="text/javascript">

        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>--%>
</body>
</html>
