<%@ Page Title="" Language="C#" MasterPageFile="~/Application.Master" AutoEventWireup="true" CodeBehind="EquipmentAction.aspx.cs" Inherits="ICDAS_3_0_Web_App.ICDAS_3_0.Configuration.EquipmentAction" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%@ Register Src="~/User_Controls/ucUserValidation.ascx" TagPrefix="ucValidate" TagName="ucUserValidation" %>

    <script type="text/javascript">
        window.onload = function () {
            var h = document.getElementById("<%=div_position.ClientID%>");
            document.getElementById("<%=dvScroll.ClientID%>").scrollTop = h.value;
        }
        function SetDivPosition() {
            var intY = document.getElementById("<%=dvScroll.ClientID%>").scrollTop;
            var h = document.getElementById("<%=div_position.ClientID%>");
            h.value = intY;
        }

        function afterpostback() {

            var h = document.getElementById("<%=div_position.ClientID%>");
            document.getElementById("<%=dvScroll.ClientID%>").scrollTop = h.value;

        }

        function SelectAllCheckboxes(spanChk) {
            var xState = spanChk.checked;
            var theBox = spanChk;
            elm = theBox.form.elements;
            for (i = 0; i < elm.length; i++)
                if (elm[i].type == "checkbox" && elm[i].id != theBox.id) {
                    if (elm[i].checked != xState)
                        elm[i].click();
                }
        }

    </script>

    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
            font-family: Arial;
        }

        .loadingmodal {
            position: fixed;
            z-index: 999 !important;
            height: 100%;
            width: 100%;
            top: 0;
            background-color: white;
            filter: alpha(opacity=60);
            opacity: 0.8;
            -moz-opacity: 1;
        }

        .loadingcenter {
            z-index: 1000 !important;
            width: 200px;
            height: 100px;
            position: absolute;
            left: 45%;
            top: 60%;
            margin-left: -150px;
            margin-top: -150px;
            opacity: 1;
            /*-moz-opacity: 1;*/
            background: url("Images/loading.gif") no-repeat;
        }
    </style>


</asp:Content>
<asp:Content ID="cotMain" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upnlwzEmailAction">
        <ProgressTemplate>
            <div class="loadingmodal">
                <div class="loadingcenter">
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="upnlwzEmailAction" UpdateMode="Always" runat="server">
        <ContentTemplate>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_content">
                            <asp:HiddenField ID="hdnRecordIds" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnComments" runat="server" Value="0" />
                            <asp:HiddenField ID="div_position" Value="0" runat="server" />
                            <div class="x_title">
                                <h4>
                                    <asp:Label ID="lblFormTitle" runat="server"></asp:Label></h4>
                                <div class="clearfix"></div>
                            </div>
                            <div class="col-xs-12 col-sm-12 col-lg-12">
                                <div class="row">
                                    <div class="col-xs-12 col-sm-12 col-lg-4">
                                        <div class="input-group">
                                            <span class="input-group-addon">Current Status</span>
                                            <asp:RadioButtonList ID="rdBtn" runat="server" CssClass="form-control" RepeatDirection="Horizontal" AutoPostBack="true" OnSelectedIndexChanged="rdBtn_SelectedIndexChanged" Width="300px">
                                                <asp:ListItem Value="0" Selected="True">Active</asp:ListItem>
                                                <asp:ListItem Value="1" style="margin-left: 40px;">Not Active</asp:ListItem>
                                            </asp:RadioButtonList>
                                        </div>
                                    </div>
                                    <div class="col-xs-12 col-sm-12 col-lg-12">
                                        <table id="tblHeader0" runat="server" style="background: #ddd" class="table table-striped table-bordered dt-responsive nowrap">
                                            <tr>
                                                <td style="width: 3%; text-align: center">
                                                    <asp:CheckBox ID="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                                        AutoPostBack="false" ToolTip="Select/Deselect All" Visible ="false"></asp:CheckBox></td>
                                                <td style="width: 47%; text-align: center; font-weight: bold;">Equipment Name</td>
                                                <td style="width: 48%; text-align: center; font-weight: bold;">IP Address</td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div class="col-xs-12 col-sm-12 col-lg-12">
                                        <div id="dvNodata" runat="server" visible="false">
                                            <img src="Images/data-not-available.jpg" id="ImgNodata" style="margin-left: 25%; height: 50%; width: 50%;" />
                                        </div>
                                        <div id="dvScroll" onscroll="SetDivPosition()" runat="server" style="height: 250px; overflow: auto; overflow-x: hidden;">
                                            <asp:GridView ID="grdEquipmentAction" runat="server" ShowHeaderWhenEmpty="true" CellPadding="0" CellSpacing="0"
                                                AllowPaging="false" AllowSorting="false" AutoGenerateColumns="False"
                                                CssClass="table table-striped table-bordered dt-responsive nowrap"
                                                ShowHeader="false" EmptyDataText="No records Found">
                                                <HeaderStyle CssClass="bg-success" />
                                                <Columns>
                                                    <asp:TemplateField ControlStyle-CssClass="widthchk">
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chkRecordId" runat="server" AutoPostBack="false" OnCheckedChanged="chkRecordId_CheckedChanged"></asp:CheckBox>
                                                        </ItemTemplate>
                                                        <ItemStyle Width="3%" />
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="EquipmentMasterId" HeaderText="EquipmentMaster Id">
                                                        <HeaderStyle CssClass="hidden txtalign" />
                                                        <ItemStyle CssClass="hidden" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="Equipment Name" HeaderText="Equipment Name">
                                                        <ItemStyle Width="47%" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="IP Address" HeaderText="IP Address">
                                                        <ItemStyle Width="48%" />
                                                    </asp:BoundField>
                                                </Columns>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 col-lg-12">
                                        <asp:TextBox ID="txtEquipmentIds" MaxLength="100" runat="server" AutoCompleteType="Disabled" autocomplete="off"
                                            placeholder="Enter Equipment Name" Style="display: none" />
                                    </div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 col-lg-12">
                                        <br />
                                        <ucValidate:ucUserValidation runat="server" ID="ucUserValidation" />
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
