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

   <script>
       function rf()
       {
           window.location = "../pc_list.aspx";
       }


   </script>
 


    <style>
        .pagination-ys {
    /*display: inline-block;*/
    padding-left: 0;
    margin: 20px 0;
    border-radius: 4px;
}

.pagination-ys table > tbody > tr > td {
    display: inline;
}

.pagination-ys table > tbody > tr > td > a,
.pagination-ys table > tbody > tr > td > span {
    position: relative;
    float: left;
    padding: 8px 12px;
    line-height: 1.42857143;
    text-decoration: none;
    color: #336699;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    margin-left: -1px;
}

.pagination-ys table > tbody > tr > td > span {
    position: relative;
    float: left;
    padding: 8px 12px;
    line-height: 1.42857143;
    text-decoration: none;    
    margin-left: -1px;
    z-index: 2;
    color: #aea79f;
    background-color: #f5f5f5;
    border-color: #dddddd;
    cursor: default;
}

.pagination-ys table > tbody > tr > td:first-child > a,
.pagination-ys table > tbody > tr > td:first-child > span {
    margin-left: 0;
    border-bottom-left-radius: 4px;
    border-top-left-radius: 4px;
}

.pagination-ys table > tbody > tr > td:last-child > a,
.pagination-ys table > tbody > tr > td:last-child > span {
    border-bottom-right-radius: 4px;
    border-top-right-radius: 4px;
}

.pagination-ys table > tbody > tr > td > a:hover,
.pagination-ys table > tbody > tr > td > span:hover,
.pagination-ys table > tbody > tr > td > a:focus,
.pagination-ys table > tbody > tr > td > span:focus {
    color: #97310e;
    background-color: #eeeeee;
    border-color: #dddddd;
}
 

    </style>

    
      










    <div class="panel panel-default">
  <div class="panel-heading"><b>服务器机器搜索</b> 系统采用浏览器Javascript进行分页，只显示最新的500条。请使用服务器搜索进行过滤。</div>
  <div class="panel-body">

       所属组织：<asp:DropDownList runat="server" AutoPostBack="true"  AppendDataBoundItems="true" CssClass="form-control inline" Width="150" ID="ddl_belongto">

             <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
            </asp:DropDownList>


       所属部门：<asp:DropDownList runat="server"  AutoPostBack="true" CssClass="form-control inline" Width="150" AppendDataBoundItems="true" ID="ddl_dept">

             <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
            </asp:DropDownList>
               
          &nbsp;&nbsp;     
  


        状态 <asp:DropDownList CssClass="form-control inline"   runat="server" ID="ddl_usestatus1" AppendDataBoundItems="true" Width="150px" AutoPostBack="true">
                   <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
                    </asp:DropDownList>
        &nbsp;&nbsp;     
        用途 <asp:DropDownList   CssClass="form-control inline"   Width="150px" runat="server" ID="ddl_usetype1" AppendDataBoundItems="true" AutoPostBack="true">
                   <asp:ListItem Text="--不限--" Value=""></asp:ListItem>
                    </asp:DropDownList>
            &nbsp;&nbsp;             
                  使用者 <asp:TextBox runat="server" ID="txt_enduser" style="width:100px; display:inline-block" CssClass="form-control"></asp:TextBox>
             
               
                <asp:Button ID="Button1" runat="server" Text="搜索"  
            class="btn btn-primary btn-sm " onclick="Button1_Click"    />




      
      </div>
        </div>  
                  
           
            
         
           
          
    
   
              <div class="well">
          

               
                 <a href="PC_addeditpc.aspx" class="btn  bg-green   btn-flat "    >添加电脑</a>
            
                          

  <a href="javascript:void(0)"; onclick="ept('Export_Data.aspx?types=pc')" class="btn   btn-primary   btn-flat"> 导出</a>
   <a href="javascript:void(0)"; onclick="ept('Import_Data.aspx?types=pc')" class="btn    bg-teal  btn-flat"> 导入</a>
            | 

 <input type="button" id="del"  onclick="if(!isselect()) return false;   _del();" value="删除" class="btn  btn-flat btn-danger"/>
                
   |
                
<a href="javascript:void(0)";  class="btn bg-aqua   btn-flat" onclick=" if(!isselect()) return false; op('change','ajax/pclist_op.aspx?t=usestatus','更改机器在库状态','pc_list.aspx',true); ">更改在库状态...</a>



<a  href="javascript:void(0)"; class="btn bg-teal   btn-flat"   onclick=" if(!isselect()) return false; op('change','ajax/pclist_op.aspx?t=dept','更改机器使用部门','pc_list.aspx',true);return false;">更改使用部门...</a>



<a  href="javascript:void(0)";  class="btn  bg-purple   btn-flat"   onclick=" if(!isselect()) return false;  op('change','ajax/pclist_op.aspx?t=usetype','更改机器使用用途','pc_list.aspx',true);return false;">更改使用用途...</a>



 <a href="javascript:void(0)";  class="btn  bg-blue   btn-flat"    onclick=" if(!isselect()) return false;  op('change','ajax/pclist_op.aspx?t=os','更改机器操作系统','pc_list.aspx',true);return false;">更改操作系统...</a>





 
 
            
           </div> 
        
         

     


   <div style="margin-top:20px;" >
       
    <asp:GridView ID="gv_list"  PageSize="20"
        ClientIDMode="Static" 
        AllowPaging="true"   
        AutoGenerateColumns="false" 
        runat="server"   
        EnableViewState="false" 
      
        GridLines="None"
        AllowSorting="True" 
        CssClass="table table-hover display"
        onrowdatabound="gv_list_RowDataBound" OnPreRender="gv_list_PreRender" OnPageIndexChanging="gv_list_PageIndexChanging"> 
    <Columns>
    
        <asp:TemplateField>
            <HeaderStyle Width="70px" />
            <HeaderTemplate>
                      <input type="checkbox"  id="cb_selectall"/> ID 

            </HeaderTemplate>

            <ItemTemplate>

               <input type="checkbox" class="ck_item" value='<%# Eval("id") %>'/>
      <%#Eval("id")%>
 
            </ItemTemplate>
        </asp:TemplateField>


    <asp:BoundField  HeaderText="使用部门" DataField="dept"    HeaderStyle-Width="100px"   />
        <asp:BoundField  HeaderText="所属机构" DataField="belongto"    HeaderStyle-Width="80px"   />
  
    
         <asp:TemplateField>
             <HeaderStyle Width="80px" />
             <HeaderTemplate>机器名</HeaderTemplate>
             <ItemTemplate>
 <a  href="javascript:void(0);" class="pcid"   pcid="<%# Eval("id") %>" ><%# Eval("pcname") %></a>

             </ItemTemplate>

         </asp:TemplateField>

    

    <asp:BoundField  HeaderText="使用者" DataField="enduser"    HeaderStyle-Width="100px"   />

    <asp:BoundField  HeaderText="制造商" DataField="mainboardmanufacture"    HeaderStyle-Width="100px"   />

        
    <asp:BoundField  HeaderText="使用状态" DataField="usestatus"    HeaderStyle-Width="100px"   />
    <asp:BoundField  HeaderText="机器用途" DataField="usetype"    HeaderStyle-Width="80px"   />
    <asp:BoundField  HeaderText="操作系统" DataField="os"    HeaderStyle-Width="100px"   />
    
    <asp:BoundField  HeaderText="保修日期" DataField="expiredate"   DataFormatString="{0:yyyy-MM-dd}"   HeaderStyle-Width="100px"   />
  


           <asp:TemplateField>
             <HeaderStyle Width="40px" />
             <HeaderTemplate>查看</HeaderTemplate>
             <ItemTemplate>
 <a  href="PC_addeditpc.aspx?id=<%# Eval("id") %>" target="_blank" >查看</a>

             </ItemTemplate>

         </asp:TemplateField>

    </Columns>
    <PagerStyle CssClass="pagination-ys" />
    </asp:GridView>
   
   
   </div>   

       


        <input type="hidden" name="hf_ids" id="hf_ids" />

 










    <script>


  

        

        $(".pcid").click(

           function () {
               var pcid = $(this).attr("pcid");
               var _detail = GetAjaxCall(pcid);
               
               layer.open({
                   type: 1,
                   skin: 'layui-layer-rim', //加上边框
                   area: ['600px', '350px'], //宽高 
                  
                   content: formatStr(_detail)
               });
                
           });

         

        function formatStr(_detail) {
            var result = "<table class=table>";
         
            result += "<tr>"
            result += "<th>机器名:</th><td>" + _detail.pcname + "</td>";
            result += "<th>使用者:</th><td>" + _detail.enduser + "</td>";
            result += "</tr>";


            result += "<tr>"                
            result += "<th>IP:</th><td>" + _detail.ip + "</td>";
            result += "<th>MAC地址:</th><td>" + _detail.mac + "</td>";
            result += "</tr>";


            result += "<tr>"
            result += "<th>CPU:</th><td>" + _detail.cpu + "</td>";
            result += "<th>内存:</th><td>" + _detail.mem + "</td>";
            result += "</tr>";



            result += "<tr>"
            result += "<th>型号:</th><td>" + _detail.spec + "</td>";
            result += "<th>硬盘:</th><td>" + _detail.harddisk + "</td>";
            result += "</tr>";


            result += "<tr>"
            result += "<th>鼠标:</th><td>" + _detail.mouse + "</td>";
            result += "<th>键盘:</th><td>" + _detail.keywoard + "</td>";
            result += "</tr>";


            result += "<tr>"
            result += "<th>显示器:</th><td>" + _detail.display + "</td>";
            result += "<th>网卡:</th><td>" + _detail.netcard + "</td>";
            result += "</tr>";

            result += "<tr>"
            result += "<th>声卡:</th><td>" + _detail.sound + "</td>";
            result += "<th>光驱:</th><td>" + _detail.cd + "</td>";
          
            result += "</tr>";
         
            result += "</table>";
            return result;
        }




         
        function GetAjaxCall(pcid)
        {

            for (var i = 0; i < details.length; i++) {
               
                if (details[i].id == pcid) { 
                    return details[i];
                }
            }

        }
      







 


        function _del()
        {
           
            if ($("#hf_ids").val() == "")
            {
                  return;
            }
             
            $(".ck_item").each(

                function ()
                {
                    if ($(this).prop("checked"))
                    { 
                        $(this).parent().parent().remove();
                    }
                }

                );
         
            $.ajax("ajax/del_pc.aspx?ids=" + escape($("#hf_ids").val()));


        }



         

        function showpara(_contId, _txtId) {

            layer.open({
                type: 1,
                skin: 'layui-layer-rim', //加上边框
                area: ['420px', '240px'], //宽高
                content: formatStr($("#" + _contId).html(), _txtId)
            });

        }
      
         
    </script>








</asp:Content>
