<%@ Page Title="" Language="C#" MasterPageFile="~/helpdesk/Reporting.master" AutoEventWireup="true" CodeBehind="Report_PC_Intro.aspx.cs" Inherits="helpdesk.helpdesk.Report_PC_Intro" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

    


    <style>
        .thered {
      color:red; 
        }
        .thebold {
         font-weight:bold;
        }
    </style>


      <h4>1.PC正常/过保统计(不包含报废)</h4>
     当前系统数据库共有 <asp:label runat="server" ID="lbl_total" ClientIDMode="Static"  class="thered thebold"></asp:label> 台。过保与维保期内比率图如下：<br />

       <div id="div_status" style="width:250px; height:250px; margin-left:50px; margin-top:50px;">
            <img src="images/loading.gif" />
        </div>




     <br /> <br />

    <asp:HiddenField runat="server" ID="hf_gb" ClientIDMode="Static" />
       <asp:HiddenField runat="server" ID="hf_normal" ClientIDMode="Static" />


      <h4>2.PC资产统计(包含报废)</h4>
    当前系统数据库共有<span id="pc_count" class="thered thebold"></span>台PC资产，具体明细如下。
    <br /> <br />













    <table class="table table-hover" id="tbl_pc">
        <tr>
            <th>部门\类别</th>
            <th>在用</th>
            <th>在库</th>
             <th>维护</th>
            <th>报废</th>
            <th  class='thered thebold'>行合计</th>
        </tr>
        
        <asp:Repeater runat="server"  ClientIDMode="Static" ID="rpt_pc">
            <ItemTemplate>
                <tr>
                    <td>
                        <%#Eval("部门") %>
                    </td>
                    <td>
 <%#Eval("在用") %>
                    </td>

                     <td>
 <%#Eval("在库") %>
                    </td>

                     <td>
 <%#Eval("维护") %>
                    </td>

                     <td>
 <%#Eval("报废") %>
                    </td>


                     <td class="thered">
  
                    </td>

                </tr>

            </ItemTemplate>

        </asp:Repeater>

    </table>
     
    <script>



        var ipts;
    
        $('#tbl_pc tr').each(function () { 
            rowsum = 0;
            tds = $(this).find('td');           
            rowsum = parseFloat($(tds[1]).html()) + parseFloat($(tds[2]).html()) + parseFloat($(tds[3]).html()) + parseFloat($(tds[4]).html());
            $(tds[5]).html(rowsum); 
             
        });

           
        var col1 = 0;
        var col2 = 0;
        var col3 = 0;
        var col4 = 0;
        var col5 = 0;
        var result = "<tr style='border-bottom:solid 1px #ddd' >";
        $.each($('#tbl_pc tr'), function (i, _tr) {
            if (i != 0) {

                col1 += parseFloat($(_tr).find('td')[1].innerHTML);
                col2 += parseFloat($(_tr).find('td')[2].innerHTML);
                col3 += parseFloat($(_tr).find('td')[3].innerHTML);
                col4 += parseFloat($(_tr).find('td')[4].innerHTML);
                col5 += parseFloat($(_tr).find('td')[5].innerHTML);

            }
        });

        result += "<td class='thered thebold'>列合计</td>"
        result += "<td class=thered>" + col1 + "</td>"
        result += "<td class=thered>" + col2 + "</td>"
        result += "<td class=thered>" + col3 + "</td>"
        result += "<td class=thered>" + col4 + "</td>"
        result += "<td class='thered thebold'>" + col5 + "</td>"
        result += "</tr>";
       
        $("#pc_count").html(col5);
        $('#tbl_pc').append(result);

      

        $("#lbl_total").html(parseInt($("#hf_gb").val()) + parseInt($("#hf_normal").val()));


        var data = [{ "name":"过保","value": $("#hf_gb").val() }, { "name":"正常", "value": $("#hf_normal").val() }];
      
        DrawPie(data, "div_status", "")

    </script>

</asp:Content>
