<%@ page language="C#" autoeventwireup="true" inherits="sysadmin_EquipmentUse, App_Web_equipmentuse.aspx.670f2b03" enableEventValidation="false" %>

<%@ Register Src="~/sadmin/NewHeader.ascx" TagPrefix="uc2" TagName="NewHeader" %>
<%@ Register Src="~/sadmin/NewFooter.ascx" TagPrefix="uc2" TagName="NewFooter" %>


<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>网上预约系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link href="/control/plugin/bootstrap3/css/bootstrap.min.css" rel="stylesheet" />
    <script src="/control/js/jquery.js"></script>
    <script src="/control/plugin/bootstrap3/js/bootstrap.min.js"></script>
    <link href="/control/webcss/sysadmin.css" rel="stylesheet" />
    <link href="/control/css/msgbox.css" rel="stylesheet" />
    <script src="/control/js/msgbox.js"></script>

     <!-- ionicons -->
    <link href="/lib/ionicons/ionicons.min.css" rel="stylesheet" />
    <!-- Animate -->
    <link href="/lib/animate/animate.min.css" rel="stylesheet" />
    <!-- base -->
    <link href="/css/base.css" rel="stylesheet" /> 
    <!--[if lt IE 9]>
      <script src="/js/html5shiv.min.js"></script>
      <script src="/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="wrapper">
        <uc2:NewHeader runat="server" ID="MyHeader1" />
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                     <h3 class="page-header"><i class="glyphicon glyphicon-envelope"></i> 预约设备分配记录 <small> 各预约设备的时间分配情况 </small></h3>
                </div>
            </div>
            <div class="row">

                <div class="col-lg-2 col-md-3">
                    <div class="list-group">
                        <a href="EquipmentUse.aspx" id="ball" class="list-group-item">全部</a>
                        <asp:Repeater ID="rptEquipment" runat="server">
                            <ItemTemplate>
                                <a href="EquipmentUse.aspx?eid=<%#Eval("e_id") %>" id="<%#Eval("e_id") %>" class="list-group-item"><%#Eval("e_name") %></a>
                            </ItemTemplate>
                        </asp:Repeater>
                    </div>
                </div>

                <div class="col-lg-10 col-md-3">
                    <div class=" well well-sm  ">
                        <form class="form-inline" action="EquipmentUse.aspx" method="get">

                            <div class="form-group">
                                <input id="u_user" name="u_user" value="<%=Request["u_user"] %>" type="text" class="form-control" placeholder="输入用户名" />
                            </div>

                            <div class="form-group  ">
                                <input id="eid" value="<%=Request["eid"] %>" type="hidden" />
                                <input id="u_name" name="u_name" value="<%=Request["u_name"] %>" type="text" class="form-control" placeholder="输入姓名" />
                                <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
                            </div>

                            <div class="form-group pull-right">
                                <a href="EquipmentUseCreate.aspx" class="btn btn-success "><i class="glyphicon glyphicon-plus"></i></a>
                            </div>

                        </form>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-body  table-responsive">
                            <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>预约设备</th>
                                                <th>开始</th>
                                                <th>结束</th>
                                                <th></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <%#Eval("b_index")==Convert.DBNull?"无对应预约":Eval("b_index")%>
                                        </td>
                                        <td><%#Eval("u_user ") %></td>
                                        <td><%#Eval("u_name ") %></td>
                                        <td><%#Eval("p_name")%></td>
                                        <td><%#Eval("e_name") %></td>
                                        <td><%#((DateTime)Eval("eu_start")).ToString("yyyy-MM-dd HH:mm")%></td>
                                        <td><%#((DateTime)Eval("eu_end")).ToString("yyyy-MM-dd HH:mm")%></td>
                                        <td>
                                            <button type="button" class="btn btn-primary  btn-min" onclick="currentKey('<%#Eval("id") %>')" data-toggle="modal" data-target="#myModal">
                                                <i class=" glyphicon glyphicon-remove "></i>删除 
                                            </button>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </tbody> 
                                </table>
                
                                 <div class="alert alert-warning" style="display: <%#bool.Parse((rptData.Items.Count==0).ToString())?"block":"none"%>">

                                     <strong>暂无信息</strong>

                                 </div>

                                </FooterTemplate>
                            </asp:Repeater>
                        </div>
                    </div>
                    <div class="text-right">
                        <asp:Literal ID="litPage" runat="server"></asp:Literal>
                    </div>

                    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                    <h4 class="modal-title" id="myModalLabel">确定删除</h4>
                                </div>
                                <div class="modal-body">
                                    <h3>确定删除该分配时间吗？</h3>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                    <button type="button" class="btn btn-primary" onclick="rd()">确定</button>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

            <script type="text/javascript">
                var deleteID = null;
                function currentKey(key) {
                    deleteID = key;
                }
                function rd() {
                    ZENG.msgbox.show('取消中...', 6);
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        data: { "did": deleteID },
                        success: function (result) {
                            ZENG.msgbox._hide();
                            if (result.state == 1) {
                                location.reload();
                            } else {
                                alert(result.data);
                            }
                        }
                    });
                }

                $(function () {
                    var eid = $("#eid").val();
                    if (eid != '') {
                        $("#" + eid).addClass("active");
                    } else {
                        $("#ball").addClass("active");
                    }
                });

            </script>
        </div>

        <uc2:NewFooter runat="server" ID="NewFooter" />
    </div>
</body>
</html>
