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

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

    <style>
        div#MyGrid {
            width: 100%;
            height: 500px;
            overflow: scroll;
            position: relative;
        }

            div#MyGrid th {
                top: expression(document.getElementById("AdjResultsDiv").scrollTop-2);
                left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
                position: relative;
                z-index: 20;
            }

        div#AdjResultsDiv {
            width: 100%;
            height: 500px;
            overflow: scroll;
            position: relative;
        }

            div#AdjResultsDiv th {
                top: expression(document.getElementById("AdjResultsDiv").scrollTop-2);
                left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
                position: relative;
                z-index: 20;
            }
    </style>

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

        }
        function SetDivPosition() {
            var intY = document.getElementById("<%=dvScroll.ClientID%>").scrollTop;
            var intYY = document.getElementById("<%=dvScrollSMS.ClientID%>").scrollTop;
            var h = document.getElementById("<%=div_position.ClientID%>");
            h.value = intY;
            h.value = intYY;
        }

        function afterpostback() {

            var h = document.getElementById("<%=div_position.ClientID%>");
            document.getElementById("<%=dvScroll.ClientID%>").scrollTop = h.value;
            document.getElementById("<%=dvScrollSMS.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="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upnlwzEmailSMSAlert">
        <ProgressTemplate>
            <div class="loadingmodal">
                <div class="loadingcenter">
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="upnlwzEmailSMSAlert" 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="hdnRecordId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnRecordIds" Value="" runat="server" />
                            <asp:HiddenField ID="hdnRowIndex" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnEquipmentType" Value="" runat="server" />
                            <asp:HiddenField ID="hdnEquipmentId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnRecordKeyId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnAlarmCodeLookUpId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnAlarmType" Value="" runat="server" />
                            <asp:HiddenField ID="hdnsssUserId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnLoginComments" Value="" runat="server" />
                            <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 id="wizard" class="form_wizard wizard_horizontal">
                                <ul class="wizard_steps">
                                    <li>
                                        <a runat="server" id="aStep1" class="selected">
                                            <span class="step_no">1</span>
                                            <small>Search Records</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a runat="server" id="aStep2" class="disabled">
                                            <span class="step_no">2</span>
                                            <small>Active Email Alert for Alarm</small>
                                            </span>
                                        </a>
                                    </li>
                                    <%--<li>
                                        <a runat="server" id="aStep3" class="disabled">
                                            <span class="step_no">3</span>
                                            <small>Active SMS Alert for Alarm</small>
                                            </span>
                                        </a>
                                    </li>--%>
                                </ul>
                            </div>
                            <div class="col-xs-12 col-sm-12 col-lg-12">
                                <ucToolBar:ucToolBar runat="server" ID="ucToolBar" DisplaySaveAs="N" DisplayAdd="N" DisplayPrint="N" DisplayDelete="N" />
                                </span>
                            </div>
                            <div class="col-xs-12 col-sm-12 col-lg-12">
                                <asp:Wizard ID="wzMain" CssClass="col-sm-12" DisplaySideBar="false" OnActiveStepChanged="wzMain_ActiveStepChanged"
                                    runat="server" class="form_wizard wizard_horizontal">
                                    <WizardSteps>
                                        <asp:WizardStep ID="Step0" runat="server">
                                            <ucSearchGrid:ucSearchGrid runat="server" ID="ucSearchGrid" />
                                        </asp:WizardStep>
                                        <asp:WizardStep StepType="Step" ID="Step1" runat="server">
                                            <div class="row">
                                                <div class="col-xs-12 col-sm-12 col-lg-8">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Equipment Name*</span>
                                                        <asp:TextBox ID="txtEquipmentName" MaxLength="100" runat="server" ReadOnly="true" class="form-control" AutoCompleteType="Disabled" autocomplete="off"
                                                            placeholder="CO2 Incubator" required />
                                                    </div>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-4">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Status</span>
                                                        <asp:TextBox ID="txtAlertEmailStatus" MaxLength="10" runat="server" ReadOnly="true" class="form-control" AutoCompleteType="Disabled" autocomplete="off"
                                                            placeholder="Online" />
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                                <div class="row">
                                                    <div class="col-xs-12 col-sm-12 col-lg-12">
                                                        <table id="Table1" runat="server" width="100%" style="background-color: #b7ecd3" class="table table-bordered dt-responsive nowrap ">
                                                            <tr>
                                                                <td style="width: 5%; text-align: Left">
                                                                    <asp:CheckBox ID="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                                                        AutoPostBack="false" ToolTip="Select/Deselect All"></asp:CheckBox></td>
                                                                <td style="width: 95%; text-align: Left">Active Email Alert For Alarm</td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                    <div class="col-xs-12 col-sm-12 col-lg-12">
                                                        <div id="dvScroll" onscroll="SetDivPosition()" runat="server" style="height: 350px; overflow: auto; overflow-x: hidden;">
                                                            <asp:GridView ID="GridEmailAlert" runat="server" ShowHeaderWhenEmpty="true" CellPadding="0" CellSpacing="0"
                                                                AllowPaging="false" AllowSorting="false" AutoGenerateColumns="False"
                                                                CssClass="table table-bordered dt-responsive nowrap"
                                                                ShowHeader="false">
                                                                <HeaderStyle CssClass="bg-success" />
                                                                <Columns>
                                                                    <asp:BoundField DataField="AlarmCodeLookUpId" HeaderText="">
                                                                        <HeaderStyle CssClass="hidden txtalign" />
                                                                        <ItemStyle CssClass="hidden" />
                                                                    </asp:BoundField>
                                                                    <asp:TemplateField ControlStyle-CssClass="widthchk" ItemStyle-Width="5%">
                                                                        <HeaderTemplate>
                                                                            <asp:CheckBox ID="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                                                                AutoPostBack="false" ToolTip="Select/Deselect All"></asp:CheckBox>
                                                                        </HeaderTemplate>
                                                                        <ItemTemplate>
                                                                            <asp:CheckBox ID="chkAlarmCodeLookUpId" runat="server"></asp:CheckBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="Alarmdescription" ItemStyle-Width="95%" HeaderText="Active Email Alert For Alarm" />
                                                                </Columns>
                                                            </asp:GridView>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:WizardStep>
                                        <asp:WizardStep ID="Step2" runat="server">
                                            <div class="row">
                                                <div class="col-xs-12 col-sm-12 col-lg-8">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Equipment Name*</span>
                                                        <asp:TextBox ID="txtEquipmentName1" MaxLength="100" runat="server" ReadOnly="true" class="form-control" AutoCompleteType="Disabled" autocomplete="off"
                                                            placeholder="CO2 Incubator" required />
                                                    </div>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-4">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Status</span>
                                                        <asp:TextBox ID="txtStatus1" MaxLength="10" runat="server" ReadOnly="true" class="form-control" AutoCompleteType="Disabled" autocomplete="off"
                                                            placeholder="Online" />
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-xs-12 col-sm-12 col-lg-12">
                                                    <table id="tblHeader0" runat="server" width="100%" style="background-color: #b7ecd3" class="table table-bordered dt-responsive nowrap ">
                                                        <tr>
                                                            <td style="width: 5%; text-align: Left">
                                                                <asp:CheckBox ID="CheckBox1" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                                                    AutoPostBack="false" ToolTip="Select/Deselect All"></asp:CheckBox></td>
                                                            <td style="width: 95%; text-align: Left">Active SMS Alert For Alarm</td>
                                                        </tr>
                                                    </table>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-12">
                                                    <div id="dvScrollSMS" onscroll="SetDivPosition()" runat="server" style="height: 350px; overflow: auto; overflow-x: hidden;">
                                                        <asp:GridView ID="GridSMSAlert" runat="server" ShowHeaderWhenEmpty="true" CellPadding="0" CellSpacing="0"
                                                            AllowPaging="false" AllowSorting="false" AutoGenerateColumns="False" ShowHeader="false"
                                                            CssClass="table table-bordered dt-responsive nowrap">
                                                            <HeaderStyle CssClass="bg-success" />
                                                            <Columns>
                                                                <asp:BoundField DataField="AlarmCodeLookUpId" HeaderText="">
                                                                    <HeaderStyle CssClass="hidden txtalign" />
                                                                    <ItemStyle CssClass="hidden" />
                                                                </asp:BoundField>
                                                                <asp:TemplateField ControlStyle-CssClass="widthchk" ItemStyle-Width="5%">
                                                                    <HeaderTemplate>
                                                                        <asp:CheckBox ID="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                                                            AutoPostBack="false" ToolTip="Select/Deselect All"></asp:CheckBox>
                                                                    </HeaderTemplate>
                                                                    <ItemTemplate>
                                                                        <asp:CheckBox ID="chkAlarmCodeLookUpId" runat="server"></asp:CheckBox>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:BoundField DataField="Alarmdescription" HeaderText="Active SMS Alert For Alarm" />
                                                            </Columns>
                                                        </asp:GridView>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:WizardStep>
                                    </WizardSteps>
                                    <StartNavigationTemplate>
                                        <asp:Button ID="NextButton" Visible="false" runat="server" Text="Next" CommandName="MoveNext" CssClass="btn btn-primary btn-sm" />
                                    </StartNavigationTemplate>
                                    <StepNavigationTemplate>
                                        <br />
                                        <%--<asp:Button ID="btnStepPrevious" formnovalidate="true" runat="server" CausesValidation="false" Text="Previous" CssClass="btn btn-success btn-sm" ToolTip="CONTINUE TO PREVIOUS SCREEN WITHOUT SAVING RECORDS" CommandName="MovePrevious" />
                                        <asp:Button ID="btnStepNext" formnovalidate="true" runat="server" CausesValidation="false" Text="Continue" CssClass="btn btn-success btn-sm" ToolTip="CONTINUE TO NEXT SCREEN WITHOUT SAVING RECORDS" CommandName="MoveNext" OnClick="btnStepNext_Click" />--%>
                                        <asp:Button ID="btnFinishStepNext" formnovalidate="true" runat="server" CausesValidation="false" Text="Save" CssClass="btn btn-success btn-sm" OnClick="btnFinishStepNext_Click" Visible="false" />
                                        <asp:Button ID="btnPrevious" runat="server" formnovalidate="true" Text="Previous" CssClass="btn btn-success btn-sm" ToolTip="MOVE BACK TO PREVIOUS SCREEN" CommandName="MovePrevious" />
                                    </StepNavigationTemplate>
                                    <FinishNavigationTemplate>
                                        <br />
                                        <asp:Button ID="btnFinishStepNext" formnovalidate="true" runat="server" CausesValidation="false" Text="Save" CssClass="btn btn-success btn-sm" OnClick="btnFinishStepNext_Click" Visible="false" />
                                        <asp:Button ID="btnPrevious" runat="server" formnovalidate="true" Text="Previous" CssClass="btn btn-success btn-sm" ToolTip="MOVE BACK TO PREVIOUS SCREEN" CommandName="MovePrevious" />
                                    </FinishNavigationTemplate>
                                </asp:Wizard>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
