<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="View_Data_Log.aspx.cs" Inherits="Neclog_3_0.View_Data_Log" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="obout_Interface" Namespace="Obout.Interface" TagPrefix="cc1" %>
<%@ Register TagPrefix="obout" Namespace="Obout.ComboBox" Assembly="obout_ComboBox" %>
<%@ Register Src="~/UserControls/ucTimeControl.ascx" TagName="ucTimePicker" TagPrefix="ucTime" %>
<%@ Register Src="~/UserControls/ucReport.ascx" TagName="ucReport" TagPrefix="ucRpt" %>
<%@ Register Src="~/UserControls/ucSearchControl.ascx" TagPrefix="ucRpt" TagName="ucSearchControl" %>
<%@ Register TagPrefix="OBgrid" Namespace="Obout.Grid" Assembly="obout_Grid_NET" %>
<%@ Register TagPrefix="cal" Namespace="OboutInc.Calendar2" Assembly="obout_Calendar2_NET" %>
<%@ Register Src="~/UserControls/ucAdminLoginControl.ascx" TagPrefix="ucRpt" TagName="ucAdminLoginControl" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        window.onload = function () {
            debugger;
            oboutGrid.prototype.restorePreviousSelectedRecord = function () {
                return;
            }
            oboutGrid.prototype.markRecordAsSelectedOld = oboutGrid.prototype.markRecordAsSelected;
            oboutGrid.prototype.markRecordAsSelected = function (row, param2, param3, param4, param5) {
                if (row.className != this.CSSRecordSelected) {
                    this.markRecordAsSelectedOld(row, param2, param3, param4, param5);
                } else {
                    var index = this.getRecordSelectionIndex(row);
                    if (index != -1) {
                        this.markRecordAsUnSelected(row, index);
                    }
                }
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class='divtable'>
        <div class='form-box'>
            <asp:UpdatePanel runat="server" UpdateMode="Always">
                <ContentTemplate>
                    <div class="box box-success">
                        <div class="box-header with-border">
                            <div class='row'>
                                <div class='col-md-10'>
                                    <asp:Label ID="lblTitle" runat="server" class="box-title"></asp:Label>
                                    <div id="divGraphHeader" runat="server" class="col-sm-6 control-label" style="float: right; text-align: right;">
                                        <asp:Label ID="lblGraphInstrumentLabel" Text="Instrument Name : " Font-Bold="true" class="control-label" runat="server" />
                                        <asp:Label ID="lblGraphInstrumentName" Text="Instrument Name : " class="control-label" runat="server" />
                                    </div>
                                    <asp:HiddenField ID="hdnReportType" runat="server" />
                                    <asp:HiddenField ID="hdnDbType" Value="0" runat="server" />
                                    <asp:HiddenField ID="hdnHeaderNote" Value="0" runat="server" />
                                    <asp:HiddenField ID="hdnFooterNote" Value="0" runat="server" />
                                    <asp:HiddenField ID="hdnRecordFrom" Value="0" runat="server" />
                                    <asp:HiddenField ID="hdnRecordTo" Value="0" runat="server" />
                                    <asp:HiddenField ID="hdnLoginComment" Value="0" runat="server" />
                                    <asp:HiddenField ID="hdnarraylist" Value="0" runat="server" />
                                </div>
                                <div class="col-md-2">
                                    <asp:Button Text="Search" CssClass="myButton" ID="btnSearch" OnClick="btnSearch_Click" Style="float: right" runat="server" ToolTip="Search" />
                                </div>
                                <div class='col-md-4'>
                                    <%--            <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
                                        <ContentTemplate>--%>
                                    <ucRpt:ucReport ID="rpt" runat="server" Visible="false" />
                                    <%--                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:PostBackTrigger ControlID="ViewLogSetupWizard" />
                                        </Triggers>
                                    </asp:UpdatePanel>--%>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <div class="form-horizontal">
                            <div class="box-body" id="divFormContent" runat="server">
                                <div class="col-sm-13">
                                    <asp:Wizard ID="ViewLogSetupWizard" runat="server" DisplaySideBar="false" Width="100%" OnActiveStepChanged="ViewLogSetupWizard_OnActiveStepChanged"
                                        OnNextButtonClick="ViewLogSetupWizard_NextButtonClick" OnCancelButtonClick="ViewLogSetupWizard_CancelButtonClick">
                                        <WizardSteps>
                                            <asp:WizardStep ID="Step0" StepType="Step" AllowReturn="true" runat="server">
                                                <div class="form-group">
                                                    <asp:Panel ID="pnlReportType" runat="server">
                                                        <asp:Label ID="lblReportType" runat="server" Text="Format*" CssClass="col-sm-2 control-label"></asp:Label>
                                                        <div class="col-sm-3">
                                                            <asp:DropDownList runat="server" ID="ddlReportType" AutoPostBack="true" OnSelectedIndexChanged="ddlReportType_SelectedIndexChanged" CssClass="form-control">
                                                            </asp:DropDownList>
                                                        </div>
                                                    </asp:Panel>
                                                    <div class="col-sm-2 control-label">
                                                        <asp:Label ID="lblInstrumentName" runat="server" CssClass="control-label" Text="Instrument*"></asp:Label>
                                                    </div>
                                                    <div class="col-sm-3">
                                                        <asp:DropDownList runat="server" ID="ddlInstrumentName" CssClass="form-control" OnSelectedIndexChanged="ddlInstrumentName_SelectedIndexChanged" AutoPostBack="true">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <asp:Label ID="Label1" runat="server" Text="From Date*" CssClass="col-sm-2 control-label"></asp:Label>
                                                    <div class="col-sm-2">
                                                        <asp:TextBox ID="txtFromDate" runat="server" MaxLength="20" CssClass="form-control" onKeyUp="scrollDateField(this,event);"
                                                            onBlur="GetDateField(this);" onFocus="SetDateField(this); searchKeyFocus(this);"
                                                            ToolTip="Format : [ddmmyyyy], [d] or [dd], [ddm] or [ddmm], [ ].&#xa;Keys : Day-[Up/Down], Month-[alt+Up/Down], Year-[shift+Up/Down], Today-[Home]."
                                                            onkeypress="searchKeyPress(event);" Width="98%"></asp:TextBox>
                                                    </div>
                                                    <div class="col-sm-1">
                                                        <asp:PlaceHolder runat="server" ID="dtpFromDate"></asp:PlaceHolder>
                                                    </div>
                                                    <div class="col-sm-2 control-label">
                                                        <asp:Label ID="Label3" runat="server" Text="To Date*" CssClass="control-label"></asp:Label>
                                                    </div>
                                                    <div class="col-sm-2">
                                                        <asp:TextBox ID="txtToDate" runat="server" CssClass="form-control" MaxLength="20" onKeyUp="scrollDateField(this,event);"
                                                            onBlur="GetDateField(this);" onFocus="SetDateField(this); searchKeyFocus(this);"
                                                            ToolTip="Format : [ddmmyyyy], [d] or [dd], [ddm] or [ddmm], [ ].&#xa;Keys : Day-[Up/Down], Month-[alt+Up/Down], Year-[shift+Up/Down], Today-[Home]."
                                                            onkeypress="searchKeyPress(event);" Width="98%"></asp:TextBox>
                                                    </div>
                                                    <div class="col-sm-1">
                                                        <asp:PlaceHolder runat="server" ID="dtpToDate"></asp:PlaceHolder>
                                                    </div>
                                                </div>
                                                <div class="form-group" id="divTime" runat="server">
                                                    <asp:Label ID="Label4" runat="server" Text="From Time*" CssClass="col-sm-2 control-label"></asp:Label>
                                                    <div class="col-sm-2">
                                                        <ucTime:ucTimePicker ID="txtFromTime" DefaultTime="00:00" runat="server" />
                                                    </div>
                                                    <div class="col-sm-1">
                                                    </div>
                                                    <div class="col-sm-2 control-label">
                                                        <asp:Label ID="Label5" runat="server" Text="To Time*" CssClass="control-label"></asp:Label>
                                                    </div>
                                                    <div class="col-sm-2">
                                                        <ucTime:ucTimePicker ID="txtToTime" DefaultTime="23:59" runat="server" />
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <div class="messagealert" id="alert_container" role="alert">
                                                    </div>
                                                </div>
                                                <div class="form-group" id="divPloting" runat="server">
                                                    <asp:Label ID="Label2" runat="server" CssClass="col-sm-2 control-label" Text="Plotting Duration*"></asp:Label>
                                                    <div class="col-sm-2">
                                                        <asp:DropDownList runat="server" ID="ddlPlotingDuration" CssClass="form-control">
                                                            <asp:ListItem Text="1" Value="1" />
                                                            <asp:ListItem Text="5" Value="5" />
                                                            <asp:ListItem Text="10" Value="10" />
                                                            <asp:ListItem Text="15" Value="15" />
                                                            <asp:ListItem Text="20" Value="20" />
                                                            <asp:ListItem Text="30" Value="30" />
                                                            <asp:ListItem Text="60" Value="60" />
                                                        </asp:DropDownList>
                                                    </div>
                                                    <div class="col-sm-1">
                                                        &nbsp;
                                                    </div>
                                                    <asp:Panel ID="pnlOrderBy" runat="server">
                                                        <div class="col-sm-2 control-label">
                                                            <asp:Label ID="Label30" runat="server" CssClass="control-label" Text="Order By"></asp:Label>
                                                        </div>
                                                        <div class="col-sm-2">
                                                            <asp:RadioButton ID="rdLogDate" runat="server" GroupName="ReportOrder" Text="Log Date"
                                                                Checked="True" CssClass="control-label" />
                                                            <asp:RadioButton ID="rbRawLog" runat="server" GroupName="ReportOrder" Text="Unsorted" />
                                                        </div>
                                                    </asp:Panel>
                                                    <asp:Panel ID="pnlParameterType" runat="server" Visible="false">
                                                        <div class="col-sm-2 control-label">
                                                            <asp:Label ID="Label6" runat="server" CssClass="control-label" Text="Parameter Type"></asp:Label>
                                                        </div>
                                                        <div class="col-sm-2">
                                                            <asp:DropDownList ID="ddlParameterType" runat="server" CssClass="form-control">
                                                                <asp:ListItem Value="T">Temperature</asp:ListItem>
                                                                <asp:ListItem Value="H">Humidity</asp:ListItem>
                                                                <asp:ListItem Value="B" Selected="True">Both</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                    </asp:Panel>
                                                </div>
                                                <div class="col-sm-13" style="padding-left: 1%">
                                                    <asp:Panel ID="pnlViewLogGrid" Visible="true" runat="server">
                                                        <div class="col-sm-12">
                                                            <div class="col-sm-12 ob_gFCont">
                                                                <div class="ob_gPSTT" style="display: block;"></div>
                                                                <div class="ob_gFEC">
                                                                    <div class="ob_gFP">
                                                                        <div class="ob_gFPT"><span id="grdDataLogCNT" runat="server"></span>&nbsp;</div>
                                                                    </div>
                                                                    <div class="ob_gFALC"></div>
                                                                </div>
                                                            </div>
                                                            <OBgrid:Grid ID="grdDataLog" AllowPaging="false" runat="server" Width="100%" FolderStyle="~/App_Include/StyleSheet/Grid/"
                                                                CallbackMode="true" AutoGenerateColumns="false" AllowAddingRecords="False" Serialize="true" OnRowDataBound="grdDataLog_RowDataBound"
                                                                AllowPageSizeSelection="false" ShowFooter="false" AllowSorting="false">
                                                                <Columns>
                                                                    <OBgrid:CheckBoxSelectColumn Index="0" Width="5%" HeaderAlign="left"></OBgrid:CheckBoxSelectColumn>
                                                                    <OBgrid:Column DataField="EquipmentMasterParameterId" Index="1" Visible="false"></OBgrid:Column>
                                                                    <OBgrid:Column TemplateId="tplParameterName" HeaderText="Name" HeaderAlign="left" DataField="ParameterName" Index="2" Width="60%" runat="server">
                                                                        <TemplateSettings TemplateId="tplParameterName"></TemplateSettings>
                                                                    </OBgrid:Column>
                                                                    <OBgrid:Column TemplateId="tplParameterUnit" HeaderText="Unit" HeaderAlign="left" DataField="ParameterUnit" Index="3" Width="35%" runat="server">
                                                                        <TemplateSettings TemplateId="tplParameterUnit"></TemplateSettings>
                                                                    </OBgrid:Column>
                                                                    <OBgrid:Column DataField="RecordNo" Index="4" Visible="false"></OBgrid:Column>
                                                                    <OBgrid:Column DataField="ParameterColor" Index="5" Visible="false"></OBgrid:Column>
                                                                    <OBgrid:Column DataField="ParameterAxis" Index="6" Visible="false"></OBgrid:Column>
                                                                    <OBgrid:Column DataField="ParameterType" Index="7" Visible="false"></OBgrid:Column>
                                                                </Columns>
                                                                <Templates>
                                                                    <OBgrid:GridTemplate ID="tplParameterName" ControlID="divParameterName">
                                                                        <Template>
                                                                            <div id="divParameterName" runat="server" style="text-align: left; width: 100%"></div>
                                                                        </Template>
                                                                    </OBgrid:GridTemplate>
                                                                    <OBgrid:GridTemplate ID="tplParameterUnit" ControlID="divParameterUnit">
                                                                        <Template>
                                                                            <div id="divParameterUnit" runat="server" style="text-align: left; width: 100%"></div>
                                                                        </Template>
                                                                    </OBgrid:GridTemplate>
                                                                </Templates>
                                                                <ScrollingSettings ScrollHeight="220px" />
                                                            </OBgrid:Grid>
                                                        </div>
                                                    </asp:Panel>
                                                    <asp:Panel ID="pnlAlarmLog" Visible="false" runat="server">
                                                        <div class="col-sm-12">
                                                            <OBgrid:Grid ID="grdAlarmLog" AllowPaging="true" runat="server" Width="100%" FolderStyle="~/App_Include/StyleSheet/Grid/"
                                                                CallbackMode="true" AutoGenerateColumns="false" AllowAddingRecords="False" Serialize="true" OnRowDataBound="grdAlarmLog_RowDataBound"
                                                                PageSize="15" AllowPageSizeSelection="false">
                                                                <Columns>
                                                                    <OBgrid:CheckBoxSelectColumn Index="0" Width="5%" HeaderAlign="left"></OBgrid:CheckBoxSelectColumn>
                                                                    <OBgrid:Column DataField="EquipmentMasterAlarmAuditTrailId" Index="1" Visible="false"></OBgrid:Column>
                                                                    <OBgrid:Column TemplateId="tplAlarmLogDateTime" HeaderText="Log Date Time" HeaderAlign="left" DataField="Log Date" Index="2" Width="35%" runat="server">
                                                                        <TemplateSettings TemplateId="tplAlarmLogDateTime"></TemplateSettings>
                                                                    </OBgrid:Column>
                                                                    <OBgrid:Column TemplateId="tplAlarmEvent" HeaderText="Alarm Desc" HeaderAlign="left" DataField="Alarm Description" Index="3" Width="60%" runat="server">
                                                                        <TemplateSettings TemplateId="tplAlarmEvent"></TemplateSettings>
                                                                    </OBgrid:Column>
                                                                    <OBgrid:Column DataField="Sr No" Index="4" Visible="false"></OBgrid:Column>
                                                                    <OBgrid:Column DataField="Log Time" Index="5" Visible="false"></OBgrid:Column>
                                                                </Columns>
                                                                <Templates>
                                                                    <OBgrid:GridTemplate ID="tplAlarmLogDateTime" ControlID="divAlarmLogDateTime">
                                                                        <Template>
                                                                            <div id="divAlarmLogDateTime" runat="server" style="text-align: left; width: 100%"></div>
                                                                        </Template>
                                                                    </OBgrid:GridTemplate>
                                                                    <OBgrid:GridTemplate ID="tplAlarmEvent" ControlID="divAlarmEvent">
                                                                        <Template>
                                                                            <div id="divAlarmEvent" runat="server" style="text-align: left; width: 100%"></div>
                                                                        </Template>
                                                                    </OBgrid:GridTemplate>
                                                                </Templates>
                                                                <ScrollingSettings ScrollHeight="220px" />
                                                            </OBgrid:Grid>
                                                        </div>
                                                    </asp:Panel>
                                                </div>
                                            </asp:WizardStep>
                                            <asp:WizardStep ID="Step1" StepType="Step" AllowReturn="true" runat="server">
                                                <div class="form-group" style="padding-left: 1%">
                                                    <img alt="Prcessing" src="../Images/AnimatedProgressBar1.gif" style="height: auto" />
                                                </div>
                                                <asp:Timer ID="tmrViewLogConfig" runat="server" Enabled="false" Interval="1000" OnTick="tmrEmailSmsConfig_Tick"></asp:Timer>
                                            </asp:WizardStep>
                                            <asp:WizardStep ID="Step2" StepType="Step" AllowReturn="true" runat="server">
                                                <div class="form-group">
                                                    <div class="col-sm-0 control-label">
                                                        LL
                                                    </div>
                                                    <div class="col-sm-1">
                                                        <asp:TextBox ID="txtLowerLimit" onkeypress="return onlyNumbers(event, this);" runat="server" CssClass="form-control" />
                                                    </div>
                                                    <div class="col-sm-0">
                                                        &nbsp;
                                                    </div>
                                                    <div class="col-sm-0 control-label">
                                                        UL
                                                    </div>
                                                    <div class="col-sm-1">
                                                        <asp:TextBox ID="txtUpperLimit" runat="server" onkeypress="return onlyNumbers(event, this);" CssClass="form-control" />
                                                    </div>
                                                    <div class="col-sm-0">
                                                        &nbsp;
                                                    </div>
                                                    <div class="col-sm-2 control-label"  style="visibility: hidden;">
                                                        No of Plots
                                                    </div>
                                                    <div class="col-sm-1" style="visibility: hidden;">
                                                        <asp:TextBox ID="txtNoOfPlots" runat="server" onkeypress="return onlyNumbers(event, this);" Text="0" CssClass="form-control" />
                                                    </div>
                                                    <div class="col-sm-2" cssclass="form-control">
                                                        <asp:DropDownList runat="server" ID="ddlYAxisType" CssClass="form-control" Visible="false">
                                                            <asp:ListItem Text="Primary" Value="0" Selected="True" />
                                                            <asp:ListItem Text="Secondary" Value="1" />
                                                        </asp:DropDownList>
                                                    </div>
                                                    <div class="col-sm-3">
                                                        <asp:Button ID="btnRefreshGraph" OnClick="btnRefreshGraph_Click" CssClass="myButton" Text="Refresh" runat="server" ToolTip="Refresh" />
                                                        <asp:Button ID="btnReset" OnClick="btnReset_Click" Text="Reset" CssClass="myButton" runat="server" ToolTip="Reset" />
                                                        <asp:Button ID="btnPrintGraph" OnClick="btnPrintGraph_Click" Text="Print" CssClass="myButton" runat="server" ToolTip="Print" />
                                                    </div>
                                                </div>
                                                <div class="col-sm-13 control-label" style="text-align: center">
                                                    <asp:Label ID="lblRecordsFromTo" runat="server" class="control-label"></asp:Label>
                                                </div>
                                                <div class="form-group" style="padding-left: 1%" runat="server">
                                                    <div id="divChart" runat="server" class="col-sm-10" style="overflow-y: scroll; width: 100%; height: 70vh">
                                                        <asp:Chart ID="Chart1" runat="server" EnableViewState="true"></asp:Chart>
                                                    </div>
                                                </div>
                                            </asp:WizardStep>
                                            <asp:WizardStep ID="Step3" StepType="Step" AllowReturn="true" runat="server">
                                                <div style="height: 67vh">
                                                    <ucRpt:ucAdminLoginControl runat="server" ID="ucAdminLogin" />
                                                </div>
                                            </asp:WizardStep>
                                            <asp:WizardStep ID="Step4" StepType="Step" AllowReturn="true" runat="server">
                                                <div class="form-group" style="padding-left: 1%">
                                                    <img alt="Prcessing" src="../Images/AnimatedProgressBar1.gif" style="height: auto" />
                                                </div>
                                                <asp:Timer ID="tmrStep4" runat="server" Enabled="false" Interval="1000" OnTick="tmrStep4_Tick"></asp:Timer>
                                            </asp:WizardStep>
                                        </WizardSteps>
                                        <StepNavigationTemplate>
                                            <div class="form-group" style="padding-right: 3%">
                                                <asp:Button ID="btnPrint" runat="server" Text="Print" CssClass="myButton" OnClick="btnPrint_Click" Visible="false" ToolTip="Print" />
                                                <asp:Button ID="btnNext" runat="server" Text="Next" CssClass="myButton" CommandName="MoveNext" Visible="true" ToolTip="Next" />
                                                <asp:Button ID="btnCancel" runat="server" Text="Back" CssClass="myButton" Visible="false" CommandName="Cancel" ToolTip="Back" />
                                            </div>
                                        </StepNavigationTemplate>
                                    </asp:Wizard>
                                </div>
                            </div>
                        </div>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
</asp:Content>
