<%@ page language="C#" autoeventwireup="true" inherits="Forms_VehiclePlanAssignment, App_Web_t42gtr5a" enableeventvalidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/New_Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/New_Footer.ascx" TagName="Footer" TagPrefix="uc2" %>

<%--<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.2" Namespace="DevExpress.Web.ASPxGridView"
    TagPrefix="dxgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.2, Version=8.2.10.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.2" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.2.Export" Namespace="DevExpress.Web.ASPxGridView.Export"
    TagPrefix="exp" %>--%>

<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web" TagPrefix="dxw" %>

<!DOCTYPE html>
<html lang="en">
<head id="head1" runat="server">
    <title>tSense-IoT Maintenance</title>
    <meta content="charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <%--<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Page-Enter" content="blendTrans(Duration=0)" />
    <meta http-equiv="Page-Exit" content="blendTrans(Duration=0)" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />--%>

    <link href="../css/CustomeAlert/demos.css" rel="stylesheet" type="text/css" />
    <link href="../css/CustomeAlert/themes/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <link id="reset" runat="server" href="../css/reset.css" rel="stylesheet" type="text/css" />
    <link id="stylesheet2" runat="server" href="../css/stylesheet2.css" rel="stylesheet" type="text/css" />
    <link id="updatedcss" runat="server" href="../css/Updated_css.css" rel="stylesheet" type="text/css" />
    <link id="dropdown" runat="server" href="../css/dropdown.css" rel="stylesheet" type="text/css" />
    <%--<link id="uidatepicker" runat="server" type="text/css" href="../css/ui.datepicker.css" rel="stylesheet" />--%>
    <link id="uicore" runat="server" type="text/css" href="../css/ui.core.css" rel="stylesheet" />
    <link id="uitheme" runat="server" type="text/css" href="../css/ui.theme.css" rel="stylesheet" />
    <link rel="icon" href="../NewDesign/img/favicon.png" type="image/x-icon">
    <link href="../NewDesign/css/bootstrap.css" rel="stylesheet" />
    <link href="../NewDesign/css/font-awesome.css" rel="stylesheet" />
    <link href="../NewDesign/css/responsive.css" rel="stylesheet" />
    <link href="../NewDesign/css/style.css" rel="stylesheet" />
    <script src="../NewDesign/js/jquery.min.js"></script>
    <script src="../js/jquery-3.3.1.min.js"></script>
    <script src="../NewDesign/js/bootstrap.min.js"></script>
    <script src="../NewDesign/js/jquery.js"></script>
    <script src="../NewDesign/js/script.js"></script>
    <link href="../NewDesign/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
    <link href="../NewDesign/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" />

    <%--Custom Theme for DevEx 14.2--%>
    <link id="GridView" runat="server" type="text/css" href="~/App_Themes/Office2003Blue/GridView/grid.css" rel="stylesheet" />
    <link id="Editors" runat="server" type="text/css" href="~/App_Themes/Office2003Blue/Editors/styles.css" rel="stylesheet" />

    <%--BootStrap Css--%>
    <%--<link id="BootStrapCss" href="../css/bootstrap.css" runat="server" rel="stylesheet" type="text/css" />--%>
    <link id="mainstyle" runat="server" href="../css/mainstyle.css" rel="stylesheet" type="text/css" />
    <%--End of BootStrap Css--%>

    <script src="../js/CustomAlert/jquery.min.js" type="text/javascript"></script>
    <script src="../js/CustomAlert/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <script src="../js/CustomAlert/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
    <script src="../js/CustomAlert/CustomAlert.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/jquery-1.5.1.min.js"></script>
    <%--<script type="text/javascript" src="../js/ui.datepicker.js"></script>--%>
    <%--<script type="text/javascript" src="../js/JQQueryDatePicker.js"></script>--%>

    <script type="text/javascript">
        function hidestatus() {
            window.status = ''
            return true
        }
        if (document.layers)
            document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
        document.onmouseover = hidestatus
        document.onmouseout = hidestatus
    </script>
    <script src="../js/wow.min.js"></script>
</head>
<body class="white">
    <div class="page-wrapper">
        <div class="preloader"></div>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="updGrid" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <!-- Header Starts Here -->
                    <uc1:Header ID="ucHeader" runat="server" />
                    <!-- Nav Ends Here -->
                    <!-- Content Starts Here -->

                    <div class="vlive-reports-section maintenance">
                        <div class="container-fluid">
                            <div class="row clearfix">
                                <div class="col-ks-6 HeaderTest">
                                    <div class="col-ks-16">
                                        <h2 class="pull-left">
                                            <asp:Literal ID="lblFleetMaintenanceCaption" Text="Maintenance" runat="server"></asp:Literal>
                                        </h2>
                                    </div>
                                    <div class="col-ks-16">
                                        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
                                            <NodeStyle CssClass="active" />
                                        </asp:SiteMapPath>
                                    </div>
                                </div>
                                <div class="col-ks-10 HeaderTopButton">
                                    <div class="col-ks-16">
                                        <asp:LinkButton ID="ibtnAssignPlan" runat="server" OnClick="ibtnAssignPlan_Click" OnClientClick="ShowPopUp();"
                                            CssClass="btn btn-primary btn-fa-check-square-o" Text="&nbsp;&nbsp;Assign Plan" />
                                        <asp:LinkButton ID="ibtnMaintenancePlan" runat="server" PostBackUrl="~/Forms/MaintenancePlan.aspx"
                                            CssClass="btn-fa-file-text-o btn btn-primary" Text="&nbsp;&nbsp;Maintenance Plan" />
                                        <asp:LinkButton ID="lnkbtnfleetmaintenance" runat="server" CausesValidation="false" CssClass="btn btn-primary fa-arrow-left" Text="&nbsp;&nbsp;Maintenance Service" PostBackUrl="~/Forms/FleetMaintenancePanel.aspx">
                                        </asp:LinkButton>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="vlive-filter">
                        <div class="container-fluid">
                            <div class="vlive-centrifugal-fan maintenance-plan">
                                <div class="col-ks-16 vlive-header_VXL">
                                    <div class="col-ks-16">
                                        <asp:Label ID="lblHeading" runat="server" CssClass="pnlhearder" Text="Device Maintenance Plan List"></asp:Label>
                                    </div>
                                </div>
                                <div class="row ftop">
                                    <div class="col-md-12">
                                        <div class="col-ks-1">
                                            <asp:Label ID="lblFleet" runat="server" Text="Fleet"></asp:Label>
                                        </div>
                                        <div class="col-ks-2_5">
                                            <asp:DropDownList ID="ddlFleet" runat="server" AutoPostBack="true" onchange="ShowPopUp();"
                                                OnSelectedIndexChanged="ddlFleet_SelectedIndexChanged" CssClass="form-control">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="col-ks-1" id="tdVehicleIcon" runat="server">
                                            <asp:Label ID="lblVehicle" runat="server" Text="Device"></asp:Label>
                                        </div>
                                        <div class="col-ks-2_5" id="tdVehicle" runat="server">
                                            <asp:DropDownList ID="ddlVehicle" runat="server"
                                                AppendDataBoundItems="true" CssClass="form-control">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="col-ks-1">
                                            <asp:Label ID="lblPlan" runat="server" Text="Plan"></asp:Label>
                                        </div>
                                        <div class="col-ks-2_5">
                                            <%-- <asp:DropDownList ID="ddlFleetPlans" runat="server" AutoPostBack="true" onchange="ShowPopUp();" AppendDataBoundItems="true"
                                                OnSelectedIndexChanged="ddlFleetPlans_SelectedIndexChanged" CssClass="form-control">
                                            </asp:DropDownList>--%>
                                            <asp:DropDownList ID="ddlFleetPlans" runat="server" AppendDataBoundItems="true"
                                                CssClass="form-control">
                                            </asp:DropDownList>
                                        </div>
                                        <div class="col-ks-1 icons" align="center">
                                            <asp:LinkButton ID="btnLoadDetails" runat="server" CssClass="btn btn-danger btn-circle btn-lg" OnClick="btnLoadDetails_Click" OnClientClick="return Filtervalidatecontrol();">
                                                <i class="fa fa-search" aria-hidden="true"></i>
                                            </asp:LinkButton>
                                            <asp:LinkButton ID="ibtnViewPolicy" runat="server" CssClass="btn btn-danger btn-circle btn-lg" Style="margin-left: 15px;" OnClick="ibtnViewPolicy_Click">
                                                <i class="fa fa-binoculars" aria-hidden="true"></i>
                                            </asp:LinkButton>
                                        </div>
                                        <div class="col-ks-1 icons" align="center">

                                            <%--<asp:ImageButton ID="ibtnViewPolicy" runat="server" ToolTip="View Plan Details" Style="width: auto;"
                                                ImageUrl="../images/icn-view.gif" OnClick="ibtnViewPolicy_Click"></asp:ImageButton>--%>
                                        </div>
                                        <div class="col-ks-2">
                                            <asp:LinkButton ID="ibtnCancel" runat="server" CausesValidation="false" OnClick="ibtnCancel_Click" Text="&nbsp;&nbsp;Cancel" CssClass="btn btn-primary btn-fa-ban" />
                                        </div>

                                    </div>
                                    <div class="col-md-12" id="trSearch" runat="server">
                                        <div id="divStatusCaption">
                                            <div class="col-ks-1">

                                                <asp:Label ID="lblStatus" runat="server" Text="Status"></asp:Label>
                                            </div>
                                            <div class="col-ks-2_5">
                                                <asp:DropDownList ID="ddlStatus" runat="server" CssClass="form-control">
                                                    <asp:ListItem Selected="True" Value="2">All</asp:ListItem>
                                                    <asp:ListItem Value="1">Active</asp:ListItem>
                                                    <asp:ListItem Value="0">Inactive</asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div id="divStatusValue">
                                            <div class="col-ks-1">
                                                <asp:Label ID="lblRecurringServicee" runat="server" Text="Plan Type"></asp:Label>
                                            </div>
                                            <div class="col-ks-2_5">
                                                <asp:DropDownList ID="ddlRecurringService" CssClass="form-control" runat="server">
                                                    <asp:ListItem Selected="True" Value="2">All</asp:ListItem>
                                                    <asp:ListItem Value="1">Recurring</asp:ListItem>
                                                    <asp:ListItem Value="0">Non-Recurring</asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="col-ks-1">
                                            <asp:LinkButton ID="ibtnSearch" runat="server" OnClientClick="document.getElementById('divMsg').innerHTML=''; ShowPopUp();"
                                                OnClick="ibtnSearch_Click" CssClass="btn btn-fa-search btn-primary" Text="&nbsp;&nbsp;Search"></asp:LinkButton>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <asp:Panel runat="server" ID="pnlPlanAssignList">
                        <div class="vlive-filter">
                            <div class="container-fluid">
                                <div class="vlive-centrifugal-fan maintenance-plan">
                                    <div class="col-ks-16 vlive-header_VXL">
                                        <div class="col-ks-13">
                                            <asp:Label ID="lblMntPlan" runat="server" CssClass="pnlhearder" Text="Device Maintenance Details"></asp:Label>
                                        </div>
                                        <div class="col-ks-1">
                                            <dxw:ASPxComboBox ID="ASPxCboExport" runat="server" ValueType="System.String" CssClass="form-control exportddl"
                                                ShowImageInEditBox="false" ItemImage-Height="12px" ClientInstanceName="ASPxCboExport" SelectedIndex="0" Style="display: none"
                                                CssFilePath="~/App_Themes/Office2003Blue/Editors/styles.css" CssPostfix="Office2003_Blue"
                                                EnableTheming="true" Theme="Office2003Blue">
                                                <Items>
                                                    <dxw:ListEditItem ImageUrl="../images/icn-pdf.jpg" Text="pdf" Value="pdf" />
                                                    <dxw:ListEditItem ImageUrl="../images/icn-excel.jpg" Text="xls" Value="xls" />
                                                    <dxw:ListEditItem ImageUrl="../images/icn-excel-xlsx.png" Text="xlsx" Value="xlsx" />
                                                    <dxw:ListEditItem ImageUrl="../images/icn-word.jpg" Text="rtf" Value="rtf" />
                                                    <%--<dxw:ListEditItem ImageUrl="../images/icn-csv.gif" Text="csv" Value="csv" />--%>
                                                </Items>
                                            </dxw:ASPxComboBox>
                                        </div>
                                        <div class="col-ks-2">
                                            <asp:LinkButton ID="ibtnExport" runat="server" Text="&nbsp;&nbsp;Export" CssClass="btn btn-primary fa-file-excel-o"
                                                OnClick="ibtnExport_Click" />
                                        </div>
                                    </div>
                                    <div class="row ftop">
                                        <div class="col-md-12">
                                            <dxw:ASPxGridView ID="gvVehiclePlanAssignment" runat="server" Width="100%" KeyFieldName="VehiclePlanId" ClientInstanceName="gvVehiclePlanAssignment"
                                                CssFilePath="~/App_Themes/Office2003Blue/GridView/styles.css" CssPostfix="Office2003_Blue" EnableTheming="true" Theme="Office2003Blue">
                                                <Styles CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" AlternatingRow-Enabled="True"
                                                    CssPostfix="Office2003_Blue">
                                                    <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                    </Header>
                                                    <LoadingPanel ImageSpacing="10px">
                                                    </LoadingPanel>
                                                    <PagerBottomPanel CssClass="PageFooter">
                                                    </PagerBottomPanel>
                                                    <PagerTopPanel CssClass="PageFooter">
                                                    </PagerTopPanel>
                                                </Styles>
                                                <SettingsPager PrevPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pPrev.gif"
                                                    PrevPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pPrevDisabled.gif"
                                                    NextPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pNextDisabled.gif"
                                                    NextPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pNext.gif" AlwaysShowPager="true"
                                                    PageSize="10">
                                                </SettingsPager>
                                                <Columns>
                                                    <dxw:GridViewDataColumn FieldName="VehiclePlanId" Caption="AutoID" VisibleIndex="0"
                                                        Visible="false">
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn FieldName="VehicleDescription" Caption="Device Name" VisibleIndex="1"
                                                        Width="20%" HeaderStyle-HorizontalAlign="Center">
                                                        <HeaderCaptionTemplate>
                                                            <center>
                                                                <table cellpadding="0" cellspacing="0" border="0">
                                                                    <tr>
                                                                        <td style="height: 20px; padding-top: 3px">
                                                                            <asp:Label ID="lblgVehicleName" runat="server" Text="Device Name"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </center>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:LinkButton ID="glbtnVehicleName" runat="server" Text='<%# Eval("VehicleDescription").ToString() %>'
                                                                CommandArgument='<%# Eval("PlanId") + "," + Eval("VehicleDescription").ToString() %>'
                                                                OnClientClick="document.getElementById('divMsg').innerHTML=''; ShowPopUp();"
                                                                OnClick="glbtnVehicleName_Click"></asp:LinkButton>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="True" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn FieldName="PlanName" Caption="Plan Name" VisibleIndex="2"
                                                        Width="20%">
                                                        <Settings AllowAutoFilter="True" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn FieldName="IsActive" Caption="Active Status" VisibleIndex="3" Width="12%" CellStyle-HorizontalAlign="Center">
                                                        <DataItemTemplate>
                                                            <table>
                                                                <tr>
                                                                    <%-- <td>
                                                                            <asp:Image ID="imgActiveStatus" runat="server" ImageUrl='<%# Eval("IsActive").ToString() == "True" ? "../images/icn-active.gif" : "../images/icn-inactive.gif" %>' />
                                                                        </td>--%>
                                                                    <td style="vertical-align: middle">
                                                                        <asp:Label ID="glblIsActive" runat="server" Text='<%# Eval("IsActive").ToString() == "True" ? "Active" : "Inactive" %>'></asp:Label>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="True" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn FieldName="EngineHrsStartValue" Caption="Last Executed On (Running Hrs)"
                                                        VisibleIndex="4" Width="16%" CellStyle-Wrap="True" CellStyle-HorizontalAlign="Center" Visible="false">
                                                        <Settings AllowAutoFilter="False" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn FieldName="OdometerReadingStartValue" Caption="Last Executed On (Odometer)"
                                                        VisibleIndex="5" Width="16%" CellStyle-Wrap="True" CellStyle-HorizontalAlign="Center" Visible="false">
                                                        <Settings AllowAutoFilter="False" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn Caption="Last Executed On (Time Based)" FieldName="TimeBasedStartValue"
                                                        VisibleIndex="6" Width="16%" CellStyle-Wrap="True" CellStyle-HorizontalAlign="Center">
                                                        <DataItemTemplate>
                                                            <asp:Label ID="glblTimeBasedStartValue" runat="server" Text='<%# (Eval("TimeBasedStartValue") == DBNull.Value || Eval("TimeBasedStartValue").ToString() == "1/1/9000 12:00:00 AM" || Eval("TimeBasedStartValue").ToString() == "01/01/9000 12:00:00 AM") ?  "N/A" : Eval("TimeBasedStartValue") %>'></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="False" />
                                                    </dxw:GridViewDataColumn>
                                                </Columns>
                                                <Settings ShowFilterRow="True" ShowFilterRowMenu="True" />
                                                <SettingsText EmptyDataRow="No maintenance plan assignments were found for the vehicle" />
                                            </dxw:ASPxGridView>
                                            <dxw:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvVehiclePlanAssignment" OnRenderBrick="gvVehiclePlanAssignmentExport_RenderBrick"
                                                ReportHeader="{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Arial;}}
                                                                    \viewkind4\uc1\pard\qc\ul\b\f0\fs28 Vehicle Plan Assignment\par\pard\ulnone\f1\par\par}"
                                                DetailHorizontalOffset="1" DetailVerticalOffset="1" MaxColumnWidth="12000">
                                                <Styles>
                                                    <Default VerticalAlign="Middle">
                                                    </Default>
                                                    <Header BackColor="#D1D1D1" Font-Bold="True" Font-Names="Arial" Font-Size="10pt"
                                                        ForeColor="Black" HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True">
                                                    </Header>
                                                    <Cell VerticalAlign="Middle">
                                                    </Cell>
                                                </Styles>
                                                <PageHeader VerticalAlignment="None">
                                                    <Font Bold="False" Size="10pt"></Font>
                                                </PageHeader>
                                                <PageFooter Right="[Page # of Pages #]">
                                                </PageFooter>
                                            </dxw:ASPxGridViewExporter>
                                            <asp:HiddenField ID="hdnTimeBased" runat="server" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </asp:Panel>
                    <asp:Panel ID="pnlPlanAssign" runat="server" CssClass="ControlShow">
                        <asp:Panel ID="pnlAssignedVehicleList" runat="server">
                            <div class="vlive-filter">
                                <div class="container-fluid">
                                    <div class="vlive-centrifugal-fan maintenance-plan">
                                        <div class="col-ks-16 vlive-header_VXL">
                                            <div class="col-ks-16">
                                                <span class="pnlhearder">Assigned Devices</span>
                                            </div>
                                        </div>
                                        <div class="row ftop" style="padding-bottom: 0px;">
                                            <div class="col-md-12">
                                                <div class="table-responsive">
                                                    <dxw:ASPxGridView ID="gvAssignedVehicles" runat="server" Width="100%" KeyFieldName="VehicleId" ClientInstanceName="gvAssignedVehicles"
                                                        CssFilePath="~/App_Themes/Office2003Blue/GridView/styles.css" CssPostfix="Office2003_Blue" EnableTheming="true" Theme="Office2003Blue" OnHtmlRowCreated="gvAssignedVehicles_HtmlRowCreated">
                                                        <ClientSideEvents SelectionChanged="function(s, e) { OnGridVehPlanSelectionChanged(2); }" />
                                                        <%--<Images ImageFolder="~/App_Themes/Office2003Blue/GridView/">
                                                                        <CollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                                            Width="11px" />
                                                                        <ExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                                            Width="11px" />
                                                                        <DetailCollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                                            Width="11px" />
                                                                        <DetailExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                                            Width="11px" />
                                                                    </Images>--%>
                                                        <Styles CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" AlternatingRow-Enabled="True"
                                                            CssPostfix="Office2003_Blue">
                                                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                            </Header>
                                                            <LoadingPanel ImageSpacing="10px">
                                                            </LoadingPanel>
                                                            <PagerBottomPanel CssClass="PageFooter">
                                                            </PagerBottomPanel>
                                                            <PagerTopPanel CssClass="PageFooter">
                                                            </PagerTopPanel>
                                                        </Styles>
                                                        <SettingsPager PrevPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pPrev.gif"
                                                            PrevPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pPrevDisabled.gif"
                                                            NextPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pNextDisabled.gif"
                                                            NextPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pNext.gif" AlwaysShowPager="true"
                                                            PageSize="5">
                                                        </SettingsPager>
                                                        <Columns>
                                                            <dxw:GridViewDataColumn FieldName="VehicleId" Caption="AutoID" VisibleIndex="0"
                                                                Visible="false">
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="1" Width="5%">
                                                                <HeaderTemplate>
                                                                    <input type="checkbox" onclick="gvAssignedVehicles.SelectAllRowsOnPage(this.checked);"
                                                                        style="vertical-align: middle;" title="Select/Unselect all rows on the page"></input>
                                                                </HeaderTemplate>
                                                                <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center" />
                                                            </dxw:GridViewCommandColumn>
                                                            <dxw:GridViewDataColumn FieldName="VehicleDescription" Caption="Device Name" VisibleIndex="2"
                                                                Width="20%">
                                                                <%--<HeaderCaptionTemplate>
                                                                                <table cellpadding="0" cellspacing="0">
                                                                                    <tr>
                                                                                        <td>
                                                                                            <asp:Image ID="imgAssVehVehicleName" runat="server" ImageUrl="..\Images\icn-vehicle-name.gif" />
                                                                                        </td>
                                                                                        <td style="padding-top: 0px">
                                                                                            <asp:Label ID="lblAssVehVehicleName" runat="server" Text="Vehicle Name"></asp:Label>
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </HeaderCaptionTemplate>--%>
                                                                <Settings AllowAutoFilter="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="IsActive" Caption="Active Status" VisibleIndex="3"
                                                                Width="10%" CellStyle-HorizontalAlign="Center">
                                                                <DataItemTemplate>
                                                                    <table>
                                                                        <tr>
                                                                            <td>
                                                                                <asp:LinkButton ID="imgActiveStatus" runat="server" alternatetext="Click to change the status"
                                                                                    ToolTip="Click to change the status" OnClick="ChangeActiveStatus" CssClass="handButton"
                                                                                    CommandArgument='<%# Eval("VehiclePlanId")+","+Eval("IsActive") %>'>
                                                                                </asp:LinkButton>
                                                                                <%--<asp:ImageButton ID="imgActiveStatus" runat="server" AlternateText="Click to change the status"
                                                                                    ToolTip="Click to change the status" OnClick="ChangeActiveStatus" CssClass="handButton"                                                                                    
                                                                                    CommandArgument='<%# Eval("VehiclePlanId")+","+Eval("IsActive") %>' />--%>
                                                                                <%--ImageUrl='<%# Eval("IsActive").ToString() == "True" ? "../images/icn-active.gif" : "../images/icn-inactive.gif" %>'--%>
                                                                            </td>
                                                                            <td style="vertical-align: middle">&nbsp;&nbsp;<asp:Label ID="glblIsActive" runat="server" Text='<%# Eval("IsActive").ToString() == "True" ? "Active" : "Inactive" %>'></asp:Label>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="CurrentEngineHours" Caption="Current Running Hrs"
                                                                VisibleIndex="4" Width="10%" CellStyle-HorizontalAlign="Center">
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblCurrEngineHrs" runat="server" Text='<%# Eval("CurrentValues") %>' />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="EngineHrsDueOn" Caption="Running Hrs Due On" VisibleIndex="5"
                                                                Width="10%" CellStyle-HorizontalAlign="Center">
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblEngineHrsDueOn" runat="server" Text='<%# Eval("EngineHrsDueOn") %>' />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="CurrentOdometerReading" Caption="Current Odometer Reading"
                                                                VisibleIndex="6" Width="15%" CellStyle-HorizontalAlign="Center" HeaderStyle-Wrap="True" Visible="false">
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblCurrOdometerReading" runat="server" Text='<%# Eval("CurrentOdometerReading") %>' />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="OdometerReadingDueOn" Caption="Odometer Reading Due On"
                                                                VisibleIndex="7" Width="15%" CellStyle-HorizontalAlign="Center" HeaderStyle-Wrap="True" Visible="false">
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblOdometerReadingDueOn" runat="server" Text='<%# Eval("OdometerReadingDueOn") %>' />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="CurrentDate" Caption="Current Date" VisibleIndex="8"
                                                                Width="7%" CellStyle-HorizontalAlign="Center">
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblCurrentDate" runat="server" Text='<%# Eval("CurrentDate") == DBNull.Value ? "N/A" : Eval("CurrentDate") %>' />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="DueOnDate" Caption="Due On Date" VisibleIndex="9"
                                                                Width="7%" CellStyle-HorizontalAlign="Center">
                                                                <DataItemTemplate>
                                                                    <asp:Label ID="lblDueOnDate" runat="server" Text='<%# Eval("DueOnDate") == DBNull.Value ? "N/A" : Eval("DueOnDate") %>' />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                        </Columns>
                                                        <Settings ShowFilterRow="true" ShowFilterRowMenu="True" />
                                                        <SettingsText EmptyDataRow=" No Assigned Devices found" />
                                                    </dxw:ASPxGridView>
                                                </div>
                                                <asp:HiddenField ID="hdnVehicleIdsToBeUnassinged" runat="server" />
                                                <asp:HiddenField ID="hdnAssignedVehicleList" runat="server" />
                                            </div>
                                            <div class="col-md-12" align="right">
                                                <asp:LinkButton ID="lbtnUnassignVehicles" runat="server" class="btn btn-primary btn-fa-times-circle-o" TabIndex="10"
                                                    OnClientClick="return CheckSelectionForManipulation(2,'lbtnUnassignVehicles');"
                                                    OnClick="lbtnUnassignVehicles_Click" Text="&nbsp;&nbsp;Unassign">
                                                </asp:LinkButton>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </asp:Panel>
                        <asp:Panel ID="pnlUnAssignedVehicleList" runat="server">
                            <div class="vlive-filter">
                                <div class="container-fluid">
                                    <div class="vlive-centrifugal-fan maintenance-plan">
                                        <div class="col-ks-16 vlive-header_VXL">
                                            <div class="col-ks-16">
                                                <span class="pnlhearder">Add Devices to plan</span>
                                            </div>
                                        </div>
                                        <div class="row ftop">
                                            <div class="col-md-12">
                                                <asp:HiddenField ID="hdnVehicleIdsToBeAssinged" runat="server" />
                                                <asp:TextBox ID="txtTimeBasedSIDate" runat="server" CssClass="date" Style="display: none"></asp:TextBox>
                                                <asp:TextBox ID="txtIsRecurring" runat="server" CssClass="date" Style="display: none"></asp:TextBox>
                                                <div class="table-responsive">
                                                    <dxw:ASPxGridView ID="gvUnAssignedVehicles" runat="server" Width="100%" EnableTheming="true" Theme="Office2003Blue"
                                                        KeyFieldName="VehicleId" CssFilePath="~/App_Themes/Office2003Blue/GridView/styles.css"
                                                        ClientInstanceName="gvUnAssignedVehicles" CssPostfix="Office2003_Blue" ClientIDMode="AutoID">
                                                        <%--<Settings ShowVerticalScrollBar="true" VerticalScrollableHeight="140" />--%>
                                                        <ClientSideEvents SelectionChanged="function(s, e) {OnGridVehPlanSelectionChanged(1); }" />
                                                        <%--<Images ImageFolder="~/App_Themes/Office2003Blue/GridView/">
                                                                        <CollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                                            Width="11px" />
                                                                        <ExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                                            Width="11px" />
                                                                        <DetailCollapsedButton Height="12pxdd" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                                            Width="11px" />
                                                                        <DetailExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                                            Width="11px" />
                                                                    </Images>--%>
                                                        <Styles CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" AlternatingRow-Enabled="True"
                                                            CssPostfix="Office2003_Blue">
                                                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                            </Header>
                                                            <LoadingPanel ImageSpacing="10px">
                                                            </LoadingPanel>
                                                            <PagerBottomPanel CssClass="PageFooter">
                                                            </PagerBottomPanel>
                                                            <PagerTopPanel CssClass="PageFooter">
                                                            </PagerTopPanel>
                                                        </Styles>
                                                        <SettingsPager PrevPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pPrev.gif"
                                                            PrevPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pPrevDisabled.gif"
                                                            NextPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pNextDisabled.gif"
                                                            NextPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pNext.gif" AlwaysShowPager="true"
                                                            PageSize="5">
                                                        </SettingsPager>
                                                        <Columns>
                                                            <dxw:GridViewDataColumn FieldName="VehicleId" Caption="AutoID" VisibleIndex="0"
                                                                Visible="false">
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="1" Width="5%">
                                                                <HeaderTemplate>
                                                                    <input type="checkbox" onclick="gvUnAssignedVehicles.SelectAllRowsOnPage(this.checked);"
                                                                        style="vertical-align: middle;" title="Select/Unselect all rows on the page"></input>
                                                                </HeaderTemplate>
                                                                <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center" />
                                                            </dxw:GridViewCommandColumn>
                                                            <dxw:GridViewDataColumn FieldName="VehicleDescription" Caption="Device Name" VisibleIndex="2"
                                                                Width="15%">
                                                                <%--<HeaderCaptionTemplate>
                                                                                <table cellpadding="0" cellspacing="0">
                                                                                    <tr>
                                                                                        <td>
                                                                                            <asp:Image ID="imgUnAssVehVehicleName" ImageUrl="..\Images\icn-vehicle-name.gif"
                                                                                                runat="server" />
                                                                                        </td>
                                                                                        <td style="padding-top: 0px">
                                                                                            <asp:Label ID="lblUnAssVehVehicleName" runat="server" Text="Vehicle Name"></asp:Label>
                                                                                        </td>
                                                                                    </tr>
                                                                                </table>
                                                                            </HeaderCaptionTemplate>--%>
                                                                <DataItemTemplate>
                                                                    <asp:HiddenField ID="hdnVehicleId" runat="server" Value='<%# Eval("VehicleId") %>' />
                                                                    <asp:HiddenField ID="hdnVehName" runat="server" Value='<%# Eval("VehicleDescription") %>' />
                                                                    <%--  <asp:LinkButton ID="lbtnVehicleName" runat="server" Text='<%# Eval("VehicleDescription") %>'
                                                                                    OnClientClick="return OpenSetOdometerPopup(this);"></asp:LinkButton>--%>
                                                                    <asp:Label ID="LinkButton1" runat="server" Text='<%# Eval("VehicleDescription") %>'
                                                                        OnClientClick="return OpenSetOdometerPopup(this);"></asp:Label>
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="True" />
                                                            </dxw:GridViewDataColumn>
                                                            <%--<dxw:GridViewDataColumn FieldName="EngineHrsOpeningValue" Caption="Opening Value (Running Hours)"
                                                                Name="EngHrsOpenValue" VisibleIndex="3" Width="16%" HeaderStyle-Wrap="True" CellStyle-HorizontalAlign="Center" Visible="false">
                                                                <DataItemTemplate>
                                                                    <asp:TextBox ID="txtEngineHrsOpeningValue" runat="server" CssClass="form-control" oncopy="return false"
                                                                        ondrop="return false" onpaste="return false" MaxLength="7" Text='<%# Eval("EngineHrsOpeningValue") %>'
                                                                        onkeypress="return chkNumeric_only(event);" Enabled="false" />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>--%>
                                                            <dxw:GridViewDataColumn FieldName="CurrentValues" Caption="Current Running Hrs" VisibleIndex="4"
                                                                Name="CurrentValues" Width="10%">
                                                                <DataItemTemplate>
                                                                    <asp:TextBox ID="txtEngineHrsCurrentValues" runat="server" CssClass="form-control" oncopy="return false"
                                                                        ondrop="return false" onpaste="return false" MaxLength="7" Text='<%# Eval("CurrentValues") %>'
                                                                        onkeypress="return chkNumeric_only(event);" Enabled="false" />
                                                                    <%--<asp:Label ID="glblCurrentReading" runat="server" Text='<%# Eval("CurrentValues").ToString() %>'></asp:Label>--%>
                                                                </DataItemTemplate>
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="EngineHrsSIValue" Caption="Last Executed On (Running Hrs)"
                                                                Name="EngHrsSIValue" VisibleIndex="5" Width="16%" HeaderStyle-Wrap="True" CellStyle-HorizontalAlign="Center">
                                                                <DataItemTemplate>
                                                                    <asp:TextBox ID="txtEngineHrsInitializationValue" runat="server" CssClass="form-control" oncopy="return false"
                                                                        ondrop="return false" onpaste="return false" MaxLength="6" Text='<%# Eval("EngineHrsSIValue") %>'
                                                                        onkeypress="return chkNumeric_only(event);" />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="OdometerOpeningValue" Caption="Opening Value (Odometer Reading)"
                                                                Name="OdometerOpenValue" VisibleIndex="6" Width="16%" HeaderStyle-Wrap="True"
                                                                CellStyle-HorizontalAlign="Center" Visible="false">
                                                                <DataItemTemplate>
                                                                    <asp:TextBox ID="txtOdometerOpeningValue" runat="server" CssClass="form-control" oncopy="return false"
                                                                        ondrop="return false" onpaste="return false" MaxLength="7" Text='<%# Eval("OdometerOpeningValue") %>'
                                                                        onkeypress="return chkNumeric_only(event);" Enabled="false" />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="OdometerSIValue" Caption="Last Executed On (Odometer Reading)"
                                                                Name="OdometerSIValue" VisibleIndex="7" Width="16%" HeaderStyle-Wrap="True" CellStyle-HorizontalAlign="Center" Visible="false">
                                                                <DataItemTemplate>
                                                                    <asp:TextBox ID="txtOdometerInitializationValue" runat="server" CssClass="form-control" oncopy="return false"
                                                                        ondrop="return false" onpaste="return false" MaxLength="7" Text='<%# Eval("OdometerSIValue") %>'
                                                                        onkeypress="return chkNumeric_only(event);" />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                            <dxw:GridViewDataColumn FieldName="TimeBasedSIValue" Caption="Last Executed On (Time Based)"
                                                                Name="TimeBasedSIValue" VisibleIndex="8" Width="15%" HeaderStyle-Wrap="True"
                                                                CellStyle-HorizontalAlign="Center">
                                                                <DataItemTemplate>
                                                                    <asp:TextBox ID="txtTimeBasedInitializationValue" runat="server" CssClass="form-control" oncopy="return false"
                                                                        oncut="return false" onkeydown="doCheckBackSpaceOrDelete()" onkeypress="return false"
                                                                        Text='<%# (Eval("TimeBasedSIValue").ToString() == "1/1/9000" || Eval("TimeBasedSIValue").ToString() == "01/01/9000") ? DBNull.Value : Eval("TimeBasedSIValue") %>'
                                                                        onpaste="return false" ToolTip="dd-MMM-yyyy" />
                                                                </DataItemTemplate>
                                                                <Settings AllowAutoFilter="False" />
                                                            </dxw:GridViewDataColumn>
                                                        </Columns>
                                                        <SettingsText EmptyDataRow="No Unassigned Vehicles found" />
                                                        <Settings ShowFilterRow="true" ShowFilterRowMenu="True" />
                                                    </dxw:ASPxGridView>
                                                </div>
                                            </div>
                                            <div class="col-md-12" align="right">
                                                <asp:LinkButton ID="lbtnAssignVehicles" runat="server" TabIndex="10"
                                                    OnClientClick="if (CheckSelectionForManipulation(1,'lbtnAssignVehicles')) { return true; } else { return false; }"
                                                    OnClick="lbtnAssignVehicles_Click" CssClass="btn btn-primary btn-fa-check-circle-o" Text="&nbsp;&nbsp;Assign">
                                                </asp:LinkButton>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:Panel>
                    </asp:Panel>
                    <asp:Timer ID="tmrCheck" runat="server" Enabled="false" OnTick="tmrCheck_Tick">
                    </asp:Timer>
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="ibtnExport" />
                    <asp:PostBackTrigger ControlID="btnLoadDetails" />
                </Triggers>
            </asp:UpdatePanel>
            <asp:Panel ID="pnlViewPolicy" runat="server" Style="display: none;" CssClass="landmarkPanel">
                <asp:UpdatePanel ID="upPolicy" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div class="popup">
                            <div class="top">
                                <h1>
                                    <asp:Label ID="lblViewPolicyHeading" Text="Plan Details" runat="server"></asp:Label>
                                </h1>
                                <div class="close">
                                    <asp:LinkButton ID="ibtClose" runat="server" OnClientClick="CategoryPopup(false); return false;"
                                        CssClass="Map-btn-fa-times-circle-o" />
                                </div>
                                <div class="clear clearfix"></div>
                            </div>
                            <div class="popup-content">
                                <asp:Panel runat="server" class="panel panel-default override-col-width">
                                    <div class="panel-heading">
                                        <strong>
                                            <asp:Label ID="lblPolicyName" runat="server" Text="Details of Plan 1"></asp:Label>
                                        </strong>
                                    </div>
                                    <div class="panel-body">
                                        <div class="form-horizontal col-sm-12 padding-width-sm">
                                            <div class="form-group">
                                                <div class="col-sm-3 padding-width-sm override-col-width">
                                                    <strong>
                                                        <asp:Label ID="lblServicesApplicableCaption" runat="server" Text="Services Applicable"></asp:Label>
                                                    </strong>
                                                </div>
                                                <div class="col-sm-6 padding-width-sm">
                                                    <asp:Label ID="lblServicesApplicable" runat="server" Text=""></asp:Label>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-3 padding-width-sm override-col-width">
                                                    <strong>
                                                        <asp:Label ID="lblRecurringServiceH" runat="server" Text="Recurring Plan"></asp:Label>
                                                    </strong>
                                                </div>
                                                <div class="col-sm-6 padding-width-sm">
                                                    <asp:Label ID="lblRecurringService" runat="server" Text=""></asp:Label>
                                                </div>
                                            </div>
                                            <div class="clearfix"></div>
                                            <div class="form-group">
                                                <div id="col-xs-12">
                                                    <div class="fleetContent table-responsive">
                                                        <asp:GridView ID="gvPlanDetails" runat="server" AllowPaging="False" AllowSorting="False"
                                                            AutoGenerateColumns="False" CellPadding="0" CellSpacing="1" CssClass="table table-bordered"
                                                            GridLines="None" Width="100%" UseAccessibleHeader="true">
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="Service Type" HeaderStyle-Width="15%">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="glblServiceType" runat="server" Text='<%# (Eval("ServiceType").ToString() == "0") ? "Running Hours" : (Eval("ServiceType").ToString() == "1" ? "Odometer" : Eval("ServiceType").ToString() == "2"? "Time Based" :"Concrete Mix Hours") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Service Interval" HeaderStyle-Width="15%">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="glblServiceInterval" runat="server" Text='<%# Eval("ServiceInterval").ToString() + " " + (Eval("Frequency").ToString() == "0" ? "days" : (Eval("Frequency").ToString() == "1" ? "months" : (Eval("Frequency").ToString() == "2" ? "years" : (Eval("Frequency").ToString() == "3" ? "hrs" : Eval("DistanceUnits").ToString())))) %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <%--<asp:BoundField DataField="ServicesApplicable" HeaderText="Services Applicable" HeaderStyle-Width="40%" />--%>
                                                                <asp:TemplateField HeaderText="Reminder 1" HeaderStyle-Width="10%">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="glblNotification1" runat="server" Text='<%# Eval("Notification1").ToString() + "%" %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Reminder 2" HeaderStyle-Width="10%">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="glblNotification2" runat="server" Text='<%# Eval("Notification2").ToString() == "0" ? "None" : (Eval("Notification2").ToString() + "%") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Reminder 3" HeaderStyle-Width="10%">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="glblNotification3" runat="server" Text='<%# Eval("Notification3").ToString() == "0" ? "None" : (Eval("Notification3").ToString() + "%") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <EmptyDataTemplate>
                                                                No maintenance plan details found.
                                                            </EmptyDataTemplate>
                                                            <RowStyle VerticalAlign="Middle" />
                                                            <%--<FooterStyle CssClass="fleetFoot" />--%>
                                                            <AlternatingRowStyle VerticalAlign="Middle" />
                                                            <PagerStyle HorizontalAlign="Left" />
                                                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                            <%--<EmptyDataRowStyle CssClass="fleetHead" />--%>
                                                        </asp:GridView>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                                <div class="form-group">
                                    <div class="col-xs-5">
                                    </div>
                                    <div class="col-xs-7">
                                        <asp:LinkButton ID="btnCancelViewPolicyDetails" runat="server" class="btn btn-primary btn-fa-ban"
                                            CausesValidation="false" OnClientClick="CategoryPopup(false); return false;" Text="&nbsp;&nbsp;Cancel" />
                                    </div>
                                </div>
                                <div class="clear clearfix"></div>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </asp:Panel>
            <asp:HiddenField ID="hdnbtnName" runat="server" />
            <cc1:ModalPopupExtender ID="mpeProgressIndicator" runat="server" PopupControlID="progressPopUp"
                TargetControlID="btnTesting" BackgroundCssClass="modalBackground">
            </cc1:ModalPopupExtender>
            <asp:Button ID="btnTesting" Style="display: none;" runat="server" />
            <asp:Panel ID="progressPopUp" runat="server" CssClass="processMessage" Style="z-index: 1000; display: none;">
                <center>
                <br />
                <img alt="Please Wait ..." src="../images/47.gif" /><br />
                <br />
                <asp:Label ID="lbl_msg12" Text="Processing... Please Wait..." runat="server" CssClass="specialdisplay"></asp:Label>
                <br />
                <br />
            </center>
            </asp:Panel>
            <asp:Panel ID="pnlOdometerCmd" runat="server" Style="display: none;" CssClass="iButtonPanelImport">
                <asp:UpdatePanel ID="upOdometerCmd" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <div class="popup">
                            <div class="top">
                                <h1>
                                    <asp:Label ID="lblSendCommandHeading" Text="Set Odometer Reading" runat="server"></asp:Label>
                                </h1>
                                <div class="close">
                                    <asp:LinkButton ID="ibtnClose" runat="server" CssClass="Map-btn-fa-times-circle-o" Text=" "
                                        OnClientClick="document.getElementById('hdnVehName').value = '';document.getElementById('pnlOdometerCmd').style.display = 'none'; return false;" />
                                </div>
                                <div class="clear clearfix"></div>
                            </div>
                            <div class="popup-content">
                                <div class="form-tbl">
                                    <div class="row">
                                        <div class="col-sm-4 padding-width-sm icon-img">
                                            <asp:Label ID="lblVehName" runat="server" Text="Device Name"></asp:Label>
                                        </div>
                                        <div class="col-sm-8 padding-width-sm">
                                            <asp:HiddenField ID="hdnVehicleId" runat="server" />
                                            <asp:HiddenField ID="hdnVehName" runat="server" />
                                            <asp:Label ID="lblVehicleName" runat="server" Text=""></asp:Label>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-sm-4 padding-width-sm icon-img">
                                            <asp:Label ID="lblSetOdometer" runat="server" Text="Set Odometer"></asp:Label>
                                        </div>
                                        <div class="col-sm-8 padding-width-sm">
                                            <div class="col-xs-8 nullpadding">
                                                <asp:TextBox ID="txtOdometer" runat="server" MaxLength="8" onpaste="return false;"
                                                    ondrop="return false;" onkeypress="return chkNumeric_only(event);" CssClass="form-control"></asp:TextBox>
                                            </div>
                                            <div class="col-xs-4 padding-width-sm-left icon-label">
                                                <asp:Label ID="lblOdometerReadingUnits" runat="server" Text="Kilometers"></asp:Label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-sm-12 padding-width-sm icon-img">
                                            <asp:ImageButton ID="btnSend" runat="server" CssClass="btn" OnClick="btnSend_Click"
                                                OnClientClick="document.getElementById('divMsg').innerHTML='';if(checkOdometerReading()){ShowPopUp(); return true;} else{return false;}"
                                                ImageUrl="~/images/btn-send-command.jpg"></asp:ImageButton>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div id="divMsg" runat="server" align="center" style="font-weight: bold;"></div>
                                        </div>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </asp:Panel>
            <asp:HiddenField ID="hdnLogout" runat="server" />

            <script type="text/javascript" language="javascript">
                function OnGridVehPlanSelectionChanged(Type) {
                    if (Type == 1) {
                        gvUnAssignedVehicles.GetSelectedFieldValues('VehicleId', OnGridSelectionCompleteUnAssVeh);

                    }
                    else {
                        gvAssignedVehicles.GetSelectedFieldValues('VehicleId', OnGridSelectionCompleteAssVeh);
                    }
                }

                function OnGridSelectionCompleteUnAssVeh(values) {
                    var counter = document.getElementById("hdnVehicleIdsToBeAssinged");
                    counter.value = '';
                    for (var i = 0; i < values.length; i++) {
                        counter.value = counter.value + values[i] + ',';
                    }
                }

                function OnGridSelectionCompleteAssVeh(values) {
                    var counter = document.getElementById("hdnVehicleIdsToBeUnassinged");
                    counter.value = '';
                    for (var i = 0; i < values.length; i++) {
                        counter.value = counter.value + values[i] + ',';
                    }
                }

                function CategoryPopup(isShow) {
                    if (document.getElementById('pnlViewPolicy') != null) {
                        document.getElementById('pnlViewPolicy').style.display = (isShow) ? "block" : "none";
                    }

                    return false;
                }

                function ShowAssignPlan(isShow) {
                    if (document.getElementById('pnlPlanAssign') != null) {
                        document.getElementById('pnlPlanAssign').style.display = (isShow) ? "" : "none";
                    }

                    if (document.getElementById('ibtnCancel') != null) {
                        document.getElementById('ibtnCancel').style.display = (isShow) ? "" : "none";
                    }

                    if (document.getElementById('pnlPlanAssignList') != null) {
                        document.getElementById('pnlPlanAssignList').style.display = (isShow) ? "none" : "";
                    }

                    if (document.getElementById('ibtnAssignPlan') != null) {
                        document.getElementById('ibtnAssignPlan').style.display = (isShow) ? "none" : "";
                    }

                    if (document.getElementById('trSearch') != null) {
                        document.getElementById('trSearch').style.display = (isShow) ? "none" : "";
                    }

                    if (document.getElementById('divStatusCaption') != null) {
                        document.getElementById('divStatusCaption').style.display = (isShow) ? "none" : "";
                    }

                    if (document.getElementById('divStatusValue') != null) {
                        document.getElementById('divStatusValue').style.display = (isShow) ? "none" : "";
                    }

                    //if (document.getElementById('ddlStatus') != null) {
                    //    document.getElementById('ddlStatus').style.display = (isShow) ? "none" : "block";
                    //}
                }

                // Function to open the Set Odometer Popup
                // Included on 15-Sep-10
                function OpenSetOdometerPopup(vehName) {
                    var hdnVehNameId = vehName.id.replace('lbtnVehicleName', 'hdnVehName');
                    document.getElementById('lblVehicleName').innerHTML = document.getElementById(hdnVehNameId).value;
                    document.getElementById('hdnVehName').value = document.getElementById(hdnVehNameId).value
                    document.getElementById('hdnVehicleId').value = document.getElementById(hdnVehNameId.replace('hdnVehName', 'hdnVehicleId')).value;
                    document.getElementById('pnlOdometerCmd').style.display = '';
                    document.getElementById('txtOdometer').value = '';
                    document.getElementById('divMsg').innerHTML = '';
                    return false;
                }

                function checkOdometerReading() {
                    var canProcess = 1;
                    var odometerReading = document.getElementById('txtOdometer').value;

                    if (isNaN(odometerReading) || odometerReading.length == 0) {
                        canProcess = 0;
                        controlToBefocused = document.getElementById('txtOdometer');
                    }
                    else {
                        if (eval(odometerReading) < 1 || eval(odometerReading) > 16777215) {
                            canProcess = 0;
                            controlToBefocused = document.getElementById('txtOdometer')
                        }
                    }

                    if (canProcess == 1) {
                        document.getElementById('pnlOdometerCmd').style.display = 'none';
                        return true;
                    }
                    else {
                        alert('Check the value for odometer reading.');
                        try {
                            controlToBefocused.focus();
                        } catch (Error) { }
                        return false;
                    }
                }
            </script>

            <script type="text/javascript" language="javascript">
                //function StartHandler() {
                //    $("[id$='_txtTimeBasedInitializationValue']").datepicker({
                //        numberOfMonths: 1,
                //        showButtonPanel: true,
                //        dateFormat: 'dd-M-yy',
                //        changeYear: true,
                //        changeMonth: true,
                //        maxDate: '0',
                //        hideIfNoPrevNext: true
                //    });
                //}
                //function pageLoad() {
                //var prm = Sys.WebForms.PageRequestManager.getInstance();
                //prm.add_endRequest(function () {
                //    $("[id$='_txtTimeBasedInitializationValue']").datepicker({
                //        numberOfMonths: 1,
                //        showButtonPanel: true,
                //        dateFormat: 'dd-M-yy',
                //        changeYear: true,
                //        changeMonth: true,
                //        maxDate: '0',
                //        hideIfNoPrevNext: true
                //    });
                //});
            </script>
            <script src="../js/myformvalidations.js" type="text/javascript"></script>
            <script type="text/javascript" language="javascript" src="../js/DateValidations.js"></script>
            <script>
                function CheckIsSelected(dropdownvalue) {
                    return dropdownvalue != '-Select-' ? true : false;
                }

                function Filtervalidatecontrol() {
                    var ddlCustomer = document.getElementById('ddlCustomer');
                    var ddlFleet = document.getElementById('ddlFleet');
                    var isError = false;
                    var controlToBeFocused;
                    var alertMessage = '';
                    if (!CheckIsSelected(ddlCustomer.value)) {
                        alertMessage += (alertMessage.length > 0 ? '</br>' : '') + 'Please select the customer.';
                        if (!isError) {
                            isError = true;
                            controlToBeFocused = ddlCustomer;
                        }
                        ddlCustomer.style.backgroundColor = 'lightyellow';
                    }
                    else {
                        ddlCustomer.style.backgroundColor = 'white';
                    }
                    if (!CheckIsSelected(ddlFleet.value)) {
                        alertMessage += (alertMessage.length > 0 ? '</br>' : '') + 'Please select the site.';
                        if (!isError) {
                            isError = true;
                            controlToBeFocused = ddlFleet;
                        }
                        ddlFleet.style.backgroundColor = 'lightyellow';
                    }
                    else {
                        ddlFleet.style.backgroundColor = 'white';
                    }
                    if (isError) {
                        controlToBeFocused.focus();
                        TrinetraCustomAlerts(alertMessage);
                        return false;
                    }
                    else {
                        return true;
                    }
                }

            </script>
            <script language="javascript" type="text/javascript">
                function HidePopUp() {
                    if ($find('mpeProgressIndicator') != undefined) {
                        $find('mpeProgressIndicator').hide();
                    }
                }
                function ShowPopUp() {
                    if ($find('mpeProgressIndicator') != undefined) {
                        $find('mpeProgressIndicator').show();
                    }
                }
            </script>

        </form>
    </div>
    <!-- Content Ends Here -->
    <uc2:Footer ID="ucFooter" runat="server" />
    <script type="text/javascript" src="../JQTimePicker/jquery-2.1.1.min.js"></script>
    <link id="Link3" runat="server" href="../css/Monitor_css/bootstrap-datetimepicker.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JQTimePicker/moment-with-locales.js"></script>
    <script type="text/javascript" src="../js/Monitor_js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="../js/BDatePicker.js"></script>
</body>
</html>
