<%@ page language="C#" autoeventwireup="true" inherits="sadmin_Equipment_Equipment_UseSearch, App_Web_equipment_usesearch.aspx.a929186b" enableEventValidation="false" %>

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

<!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>
    <!-- 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" />
     
    <script src="/control/plugin/My97DatePicker/WdatePicker.js"></script>
    <script src="/lib/Lodop6.204_CLodop/LodopFuncs.js"></script>
    <!--[if lt IE 9]>
      <script src="/js/html5shiv.min.js"></script>
      <script src="/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="wrapper">
        <uc1:NewHeader runat="server" ID="NewHeader" />
        <div class="container">
            <div class="row">
                <form class="form-inline" runat="server">
                    <div class="col-lg-12">
                        <h3 class="page-header"><i class="glyphicon glyphicon-envelope"></i>预约设备分配统计 <small>统计预约设备累计时长，预约设备累计分配次数 </small></h3>
                        <div class=" well well-sm  ">

                            <div class="form-group">
                                日期：
                                <asp:TextBox ID="txt_start" CssClass="form-control" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" runat="server"></asp:TextBox>
                                -
                                <asp:TextBox ID="txt_end" CssClass="form-control" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" runat="server"></asp:TextBox>
                            </div>
                            <div class="form-group">
                                实验项目
                                <asp:DropDownList ID="ddlproject" CssClass="form-control" runat="server"></asp:DropDownList>
                            </div>
                            <div class="form-group">
                                用户
                                <asp:DropDownList ID="ddluser" CssClass="form-control" runat="server"></asp:DropDownList>
                            </div>
                            <div class="form-group">
                                按照
                                <asp:DropDownList ID="ddlgroup" CssClass="form-control" runat="server">
                                    <asp:ListItem Value="1">仪器名称</asp:ListItem>
                                    <asp:ListItem Value="2">申请人</asp:ListItem>
                                    <asp:ListItem Value="3">实验项目</asp:ListItem>
                                </asp:DropDownList>
                                汇总
                            </div>
                            <asp:Button ID="Btn" CssClass="btn btn-primary" OnClick="Btn_Click" runat="server" Text="查询" />
                            <button type="button" onclick="print()" class="btn btn-primary">打印</button>
                        </div>
                        <div class="panel panel-default">
                            <div class="panel-body">

                                <div class=" panel-heading">
                                    
                                </div>
                                <div class="panel-body">
                                    <h2 style="text-align: center;margin-bottom:14px;">
                                        <asp:Literal ID="LitTitle" runat="server"></asp:Literal></h2>
                                    <div class="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>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <tr>
                                                    <th><%#Eval("name") %></th>
                                                    <td><%#(Convert.ToDecimal(Eval("useHour")) / 60M).ToString("0.00") %></td>
                                                    <td><%#Eval("sum")%></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>
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </div>
    <script src="/control/plugin/bootstrap3/js/bootstrap.min.js"></script>
    <script src="/control/plugin/Highcharts/highcharts.js?v=20160102"></script>
    <script src="/control/plugin/Highcharts/data.js"></script>
    <script src="/control/plugin/Highcharts/exporting.js?v=20160101"></script>
    <script>
        function print() {
            var style = '<style>table,th,td{border:1px solid #000;border-collapse:collapse;}table{margin-left:180px;}</style>'
            var table = $("#dataView").parent().parent().parent().html();
            var LODOP = getLodop();
            LODOP.PRINT_INIT('打印');
            LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
            LODOP.ADD_PRINT_HTML(50, 0, "90%", "100%", style+table);
            LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);
            LODOP.SET_PREVIEW_WINDOW(1, 2, 1, 900, 700, "预览查看.开始打印");
            LODOP.PREVIEW();
        }
    </script>
</body>
</html>
