<%@ Page Title="" Language="C#" MasterPageFile="~/Report/Report.Master" AutoEventWireup="true" CodeBehind="DataAnalyze.aspx.cs" Inherits="Book.Report.DataAnalyze" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cont_form" runat="server">

   年份 <asp:DropDownList runat="server" AutoPostBack="true"  CssClass="form-control" style="display:inline-block; width:100px" ID="ddl_year" OnSelectedIndexChanged="ddl_year_SelectedIndexChanged"></asp:DropDownList>
    月份 <asp:DropDownList runat="server" AutoPostBack="true"  ID="ddl_month"  CssClass="form-control" style="display:inline-block; width:100px" OnSelectedIndexChanged="ddl_month_SelectedIndexChanged"></asp:DropDownList>

 

    <br /><br />

    <h4>1.会议分析</h4>
         <asp:HiddenField runat="server" ID="hf_roomids"   ClientIDMode="Static" />
      <asp:HiddenField runat="server" ID="hf_hours"  ClientIDMode="Static"/>

    <asp:HiddenField runat="server" ID="hf_it" ClientIDMode="Static"/>
      <asp:HiddenField runat="server" ID="hf_admin" ClientIDMode="Static" />





      <asp:HiddenField runat="server" ID="hf_other1_count" ClientIDMode="Static" />
      <asp:HiddenField runat="server" ID="hf_other1_num" ClientIDMode="Static" />
   
        
      <asp:HiddenField runat="server" ID="hf_other2_count" ClientIDMode="Static" />
          <asp:HiddenField runat="server" ID="hf_other2_num" ClientIDMode="Static" />
    















    <asp:Repeater runat="server" ID="rpt_room" ClientIDMode="Static">




       <HeaderTemplate>

                 <table class="table">
                  <tr style="background-color:#808080; color:#ffffff">
               <th width="300">
                会议室名称<br />(A)
               </th>
               <th width="200">
                容纳人数<br />(N)
               </th>

                  <th width="200">
                时长合计<br />(H)
               </th>

                             <th>
                月利用率 (R=H/176hr *100)
                                 <br />（8hr*22天=176hr）
               </th>

           </tr>

       </HeaderTemplate>

        <ItemTemplate>

       


                   <tr>
               <th>
                <%#Eval("catname") %>
               </th>
                        <th>
            <%#Eval("num") %>人
               </th>

                
                       
                          <th>
              <span id="roomid_<%#Eval("id") %>" class="_room"></span>
                         
               </th>

                             <th>
                 <span id="rate_<%#Eval("id") %>" class="_rate"></span>
               </th>

           </tr>


              

          
        </ItemTemplate>

      <FooterTemplate>
             </table>


      </FooterTemplate>
    </asp:Repeater>








    <script>


        function setHours()
        {
            roomids = $("#hf_roomids").val().split(',');
            hours = $("#hf_hours").val().split(',');
            len = roomids.length;
            for(var i=0;i<len;i++)
            {
                v = hours[i];
                
                if (v == "") {

                    $("#roomid_" + roomids[i]).html("--"); 
                    $("#rate_" + roomids[i]).html("--");
                }
                else {

                    $("#roomid_" + roomids[i]).html(Number(v).toFixed(2));
                    r = (100 * Number(v) / 176.0).toFixed(2);
                    $("#rate_" + roomids[i]).html(r + "%");
                }
               

            }
            

           

        }


        setHours();


    </script>









    <br /><br />

     <h4>2.IT资源分析</h4>
    <asp:Repeater runat="server" ID="rpt_other1">
        <HeaderTemplate>
               <table class="table">
                  <tr style="background-color:#808080; color:#ffffff">
               <th width="300px" >
                资源名称<br />(N)
               </th>
               <th width="200">
                预定次数<br />(N)
               </th>

                  <th >
                共计人员<br />(Number)
               </th>

                
           </tr>
        </HeaderTemplate>


        <ItemTemplate>

        <tr class="bd">
            <td>
                <%#Eval("name") %>

            </td>

            <td>
                <%# GetOther1Count(Eval("name").ToString()  ) %>

            </td>
               <td>
 <%# GetOther1Num(Eval("name").ToString()  ) %>

            </td>

        </tr>
           
        </ItemTemplate>

      <FooterTemplate>
             </table>


      </FooterTemplate>
    </asp:Repeater>




        <br /><br />

     <h4>3.行政资源分析</h4>
   
     <asp:Repeater runat="server" ID="rpt_other2">
        <HeaderTemplate>
               <table class="table">
                  <tr style="background-color:#808080; color:#ffffff">
               <th  width="300" >
                资源名称<br />(N)
               </th>
               <th width="200">
                预定次数<br />(N)
               </th>

                  <th>
                共计人员<br />(Number)
               </th>

                 

           </tr>
        </HeaderTemplate>


        <ItemTemplate>

        <tr class="bd">
            <td>
                <%#Eval("name") %>

            </td>

               <td>
                <%# GetOther2Count(Eval("name").ToString()  ) %>

            </td>
               <td>
 <%# GetOther2Num(Eval("name").ToString()  ) %>

            </td>
        </tr>
           
        </ItemTemplate>

      <FooterTemplate>
             </table>


      </FooterTemplate>
    </asp:Repeater>




    <script>


        function setother()
        {
            
            _other1_count = $("#hf_other1_count").val().split(',');
            _other1_num = $("#hf_other1_num").val().split(',');
            rows1 = _other1_count.length;

            _other2_count = $("#hf_other2_count").val().split(',');
            _other2_num = $("#hf_other2_num").val().split(',');
            rows2 = _other2_count.length;

            var span_other_counts = $(".other1_count");



            $(".other1_count").each(

                function (index, ele)
                {
                    v=(_other1_count[index]);
                    if(v=="")
                        v="0";
                    $(this).html(v);

                } );




            $(".other1_num").each(

                function (index, ele) {
                    v = (_other1_num[index]);
                    if (v == "")
                        v = "0";
                    $(this).html(v);

                });

            
            $(".other2_count").each(

              function (index, ele) {
                  v = (_other2_count[index]);
                  if (v == "")
                      v = "0";
                  $(this).html(v);

              });

            $(".other2_num").each(

               function (index, ele) {
                   v = (_other2_num[index]);
                   if (v == "")
                       v = "0";
                   $(this).html(v);

               });


        }




       // setother();

    </script>
</asp:Content>
