<%@ page language="C#" autoeventwireup="true" inherits="Forms_SchedulingOfCommands, App_Web_faos2cxk" 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, Version=8.2.10.0, Culture=neutral, PublicKeyToken=9B171C9FD64DA1D1"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ 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, Version=8.2.10.0, Culture=neutral, PublicKeyToken=9B171C9FD64DA1D1"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="exp" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.2, Version=8.2.10.0, Culture=neutral, PublicKeyToken=9B171C9FD64DA1D1"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>--%>
<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web" TagPrefix="dxw" %>
<%--********* For Bootstrap Implementation *************--%>
<!DOCTYPE html>
<html lang="en">
<%--********* End of Bootstrap Implementation *************--%>
<head id="Head1" runat="server">
    <title>tSense-IoT Scheduling Of Commands</title>
    <%--********* For Bootstrap Implementation *************--%>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <%--********* End of Bootstrap Implementation *************--%>
    <%--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">--%>
    <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="dropdown" runat="server" href="../css/dropdown.css" rel="stylesheet" type="text/css" />
    <link id="datepicker" 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" type="text/css" href="~/App_Themes/Office2003Blue/GridView/grid.css" rel="stylesheet" />
    <link id="Editors" type="text/css" href="~/App_Themes/Office2003Blue/Editors/styles.css" rel="stylesheet" />
    <%--********* For Bootstrap Implementation *************--%>
    <%--<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 Implementation *************--%>
    <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" lang="javascript" src="../js/JQQueryDatePicker.js"></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 runat="server" ID="updDriverDetails">
                <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-16">
                                    <div class="col-ks-8 HeaderTest">
                                        <div class="col-ks-16">
                                            <h2>
                                                <asp:Literal ID="lblConfigurationSetupCaption" Text="Configuration" 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-8 HeaderTopButton">
                                        <div style="display: none;">
                                            <asp:LinkButton ID="lbtnHistory" runat="server" class="btn" Width="100px" PostBackUrl="~/Forms/ScheduleListing.aspx"><span>Schedule History</span></asp:LinkButton>
                                        </div>
                                        <asp:ImageButton ID="ibtnBackToConfig1" runat="server" CausesValidation="false" ImageUrl="~/images/btn-back-to-configuration.jpg"
                                            PostBackUrl="~/Forms/ConfigurationSetup.aspx" Visible="false" />
                                        <asp:LinkButton ID="ibtnBackToConfig" runat="server" CssClass="fa-arrow-left btn btn-primary" CausesValidation="false"
                                            PostBackUrl="~/Forms/ConfigurationSetup.aspx">
                                        </asp:LinkButton>
                                    </div>
                                </div>
                                <div class="col-ks-6">
                                </div>
                                <div class="col-ks-10 HeaderTopButton ControlHide">
                                    <div class="col-ks-4">
                                        <asp:ImageButton ID="ImgSchedule1" runat="server" ImageUrl="~/images/btn-view-schedules.png"
                                            OnClick="ImgSchedule_Click" Visible="false" />
                                        <asp:LinkButton ID="ImgSchedule" runat="server" CssClass="MultilingualBtn" OnClick="ImgSchedule_Click">
                                            <span id="Span1" runat="server" class="MultilingualBtnspan">
                                                <div class="ViewSchedule">
                                                    <div id="ViewScheduleButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                        View Schedule
                                                    </div>
                                                </div>
                                            </span>
                                        </asp:LinkButton>
                                    </div>
                                    <div class="col-ks-4">
                                        <asp:ImageButton ID="lbtnNewSchedule1" runat="server" CausesValidation="false" ImageUrl="~/images/add-schedule.png"
                                            OnClick="lbtnNewSchedule_Click" Visible="false" />
                                        <asp:LinkButton ID="lbtnNewSchedule" runat="server" CssClass="MultilingualBtn" CausesValidation="false"
                                            OnClick="lbtnNewSchedule_Click" Visible="false">
                                            <span id="Span2" runat="server" class="MultilingualBtnspan">
                                                <div class="AddSchedule">
                                                    <div id="AddScheduleDiv" runat="server" class="MultilingualBtnTextAlign">
                                                        Add Schedule
                                                    </div>
                                                </div>
                                            </span>
                                        </asp:LinkButton>
                                    </div>
                                    <div class="col-ks-8" align="right">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <asp:Panel ID="pnlScheulingInformation" 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">
                                            <asp:Label ID="lblCapSchInformation" Text="Scheduling Information" runat="server"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="row ftop">
                                        <div class="col-md-12">
                                            <div class="col-ks-4">
                                                <asp:Label ID="lblFleet" runat="server" Text="Fleet Name"></asp:Label>
                                                <asp:Label ID="Label8" runat="server" ForeColor="Red">*</asp:Label>
                                            </div>
                                            <div class="col-ks-6">
                                                <asp:DropDownList ID="ddlFleet" runat="server" CssClass="form-control" Width="" OnSelectedIndexChanged="ddlFleet_SelectedIndexChanged"
                                                    AutoPostBack="true">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="col-ks-4">
                                                <asp:Label ID="lblVehicle" runat="server" Text="Vehicle Name"></asp:Label>
                                                <asp:Label ID="Label7" runat="server" ForeColor="Red">*</asp:Label>
                                            </div>
                                            <div class="col-ks-6" id="dvVehicle">
                                                <asp:CheckBox ID="chkSelectAll" runat="server" Text="All" onclick="selectAll(this.checked);" />
                                                <asp:CheckBoxList ID="ddlVehicle" runat="server" Height="30px" onclick="validateSelectAll();">
                                                </asp:CheckBoxList>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="col-ks-4">
                                                <asp:Label ID="lblCommand" runat="server" Text="Select Commmand"></asp:Label>
                                                <asp:Label ID="Label9" runat="server" ForeColor="Red">*</asp:Label>
                                            </div>
                                            <div class="col-ks-6">
                                                <asp:ImageButton ID="btnCommand1" runat="server" CausesValidation="false" ImageUrl="~/images/commands.png"
                                                    OnClientClick="return CheckVehicles();" OnClick="btnCommand_Click" Visible="false" />
                                                <asp:LinkButton ID="btnCommand" runat="server" CssClass="MultilingualBtn" CausesValidation="false"
                                                    OnClientClick="return CheckVehicles();" OnClick="btnCommand_Click">
                                                    <span id="Span4" runat="server" class="MultilingualBtnspan">
                                                        <div class="Command">
                                                            <div id="CommandDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                Command
                                                            </div>
                                                        </div>
                                                    </span>
                                                </asp:LinkButton>
                                            </div>
                                        </div>
                                        <asp:Label ID="lblCommandName" ForeColor="Blue" Style="text-align: center; padding-bottom: 5;"
                                            runat="server"></asp:Label>
                                        <div class="col-md-12">
                                            <div class="col-ks-4">
                                                <asp:Label ID="lblToCaption" runat="server" Text="Retries Period"></asp:Label>
                                                <asp:Label ID="lblEffectiveTillMandatory" runat="server" ForeColor="Red">*</asp:Label>
                                            </div>
                                            <div class="col-ks-6">
                                                <asp:DropDownList ID="ddlRetriesTime" CssClass="form-control" runat="server">
                                                    <asp:ListItem Text="1 Day" Value="1" Selected="True"></asp:ListItem>
                                                    <asp:ListItem Text="3 Days" Value="3"></asp:ListItem>
                                                    <asp:ListItem Text="7 Days" Value="7"></asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="col-ks-16">
                                                <asp:Label ID="Label3" runat="server" ForeColor="Red">*</asp:Label>&nbsp;
                                                        <asp:Label ID="lblIndicatesMandatory" runat="server">Required Fields</asp:Label>
                                            </div>
                                        </div>
                                        <div class="col-md-12">
                                            <div class="col-ks-4">
                                                <asp:ImageButton ID="ibtnSave1" runat="server" OnClientClick="return ValidateSchedulingOfCommands(false);"
                                                    ImageUrl="~/images/btn-save.jpg" OnClick="ibtnSave_Click" Visible="false" />
                                                <asp:LinkButton ID="ibtnSave" runat="server" CssClass="MultilingualBtn" OnClientClick="return ValidateSchedulingOfCommands(false);"
                                                    OnClick="ibtnSave_Click">
                                                    <span id="Span5" runat="server" class="MultilingualBtnspan">
                                                        <div class="Save">
                                                            <div id="SaveButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                Save
                                                            </div>
                                                        </div>
                                                    </span>
                                                </asp:LinkButton>&nbsp;
                                                        <asp:ImageButton ID="ibtnCancel1" runat="server" ImageUrl="~/images/btn-cancel.jpg"
                                                            OnClick="ibtnCancel_Click" Visible="false" />
                                                <asp:LinkButton ID="ibtnCancel" runat="server" CssClass="MultilingualBtn" OnClick="ibtnCancel_Click">
                                                    <span id="Span6" runat="server" class="MultilingualBtnspan">
                                                        <div class="Cancel">
                                                            <div id="CancelButDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                Cancel
                                                            </div>
                                                        </div>
                                                    </span>
                                                </asp:LinkButton>
                                            </div>
                                            <div class="col-ks-6"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </asp:Panel>
                    <div class="clear clearfix">
                    </div>
                    <asp:Panel ID="pnlScheulingList" 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">
                                            <asp:Label ID="lblCapSchedule" Text="Command History Details" CssClass="pnlhearder" runat="server"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="row ftop">
                                        <div class="col-md-12">
                                            <div id="trInputs" runat="server">
                                                <div runat="server" id="Div_Customer">
                                                    <div class="col-ks-1_5">
                                                        <asp:Label ID="Label10" runat="server" Text="Customer"></asp:Label>
                                                        <%--<asp:Label ID="Label12" runat="server" ForeColor="Red">*</asp:Label>--%>
                                                    </div>
                                                    <div class="col-ks-2_5">
                                                        <asp:DropDownList ID="ddlCustomer" CssClass="form-control form-controllinebreak man-dat" runat="server" OnSelectedIndexChanged="ddlCustomer_SelectedIndexChanged"
                                                            AutoPostBack="true">
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="col-ks-1_5">
                                                    <asp:Label ID="Label1" runat="server" Text="Fleet"></asp:Label>
                                                    <%--<asp:Label ID="Label2" runat="server" ForeColor="Red">*</asp:Label>--%>
                                                </div>
                                                <div class="col-ks-2_5">
                                                    <asp:DropDownList ID="ddlFleet1" CssClass="form-control form-controllinebreak man-dat" runat="server" OnSelectedIndexChanged="ddlFleet1_SelectedIndexChanged"
                                                        AutoPostBack="true">
                                                    </asp:DropDownList>
                                                </div>
                                                <div class="col-ks-1_5">
                                                    <asp:Label ID="Label4" runat="server" Text="Vehicle"></asp:Label>
                                                    <%--<asp:Label ID="Label5" runat="server" ForeColor="Red">*</asp:Label>--%>
                                                </div>
                                                <div class="col-ks-2_5">
                                                    <asp:DropDownList ID="ddlVehicle1" CssClass="form-control form-controllinebreak man-dat" runat="server" AutoPostBack="false">
                                                    </asp:DropDownList>
                                                </div>
                                                <div class="col-ks-1_5">
                                                    <asp:Label ID="lblReptype" runat="server" Text="Interval"></asp:Label>
                                                </div>
                                                <div class="col-ks-2_5">
                                                    <asp:DropDownList ID="ddlRepType" CssClass="form-control form-controllinebreak" runat="server" onchange="IntervalsNew();">
                                                        <asp:ListItem Selected="True" Text="Date Range" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="This Week" Value="2"></asp:ListItem>
                                                        <asp:ListItem Text="Last Week" Value="3"></asp:ListItem>
                                                        <asp:ListItem Text="This Month" Value="4"></asp:ListItem>
                                                        <asp:ListItem Text="Last Month" Value="5"></asp:ListItem>
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <asp:HiddenField ID="hdnArMonth" runat="server" Value="يناير,فبراير,مارس,أبريل/إبريل,مايو,يونيو/يونية,يوليو/يولية,أغسطس,سبتمبر,أكتوبر,نوفمبر,ديسمبر" />
                                        </div>
                                        <div class="col-md-12">
                                            <div class="col-ks-1_5">
                                                <asp:Label ID="lblFromDate" runat="server" Text="From" CssClass="label"></asp:Label>
                                                <%--<asp:Label ID="Label15" runat="server" ForeColor="Red">*</asp:Label>--%>
                                            </div>
                                            <div class="col-ks-2_5">
                                                <div class="input-group" id="dtFromDate" runat="server">
                                                    <asp:TextBox ID="txtFromDate" CssClass="form-control form-controllinebreak man-dat" runat="server" onkeypress="return false" onpaste="return false"></asp:TextBox>
                                                    <div class="input-group-addon" style="cursor: pointer">
                                                        <i class="fa fa-calendar"></i>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-ks-1_5">
                                                <asp:Label ID="lblToDate" runat="server" CssClass="label" Text="To"></asp:Label>
                                                <%--<asp:Label ID="Label6" runat="server" ForeColor="Red">*</asp:Label>--%>
                                            </div>
                                            <div class="col-ks-2_5">
                                                <div class="input-group" id="dtToDate" runat="server">
                                                    <asp:TextBox ID="txtToDate" CssClass="form-control form-controllinebreak man-dat" runat="server" onkeypress="return false" onpaste="return false"
                                                        TabIndex="12" Width=""></asp:TextBox>
                                                    <div class="input-group-addon" style="cursor: pointer">
                                                        <i class="fa fa-calendar"></i>
                                                    </div>
                                                </div>
                                            </div>
                                          <%--  <script>
                                                $(function () {

                                                    var startdate = new Date();
                                                    var today = new Date();
                                                    today.setMonth(today.getMonth() + 120)
                                                    startdate.setMonth(startdate.getMonth() - 6);
                                                    $('#dtFromDate').datetimepicker({
                                                        format: "DD-MMM-YYYY",
                                                        showTodayButton: true,
                                                        defaultDate: startdate,
                                                        //showClear: true,
                                                        showClose: true,
                                                        minDate: startdate,
                                                        maxDate: today

                                                    }
                                                    );
                                                    //$('#dtFromDate').data("DateTimePicker").minDate(startdate);
                                                    //$('#dtFromDate').data("DateTimePicker").maxDate(today);
                                                });
                                                $(function () {
                                                    var startdate = new Date();
                                                    var today = new Date();
                                                    today.setMonth(today.getMonth() + 120)
                                                    startdate.setMonth(startdate.getMonth() - 6);
                                                    $('#dtToDate').datetimepicker({
                                                        format: "DD-MMM-YYYY",
                                                        showTodayButton: true,
                                                        //showClear: true,
                                                        showClose: true,
                                                        minDate: startdate,
                                                        maxDate: today

                                                    }
                                                    );
                                                    //$('#dtToDate').data("DateTimePicker").minDate(startdate);
                                                    //$('#dtToDate').data("DateTimePicker").maxDate(today);
                                                });
                                                var prm = Sys.WebForms.PageRequestManager.getInstance();
                                                prm.add_endRequest(function (s, e) {
                                                    $(function () {

                                                        $(function () {
                                                            var startdate = new Date();
                                                            var today = new Date();
                                                            today.setMonth(today.getMonth() + 120)
                                                            startdate.setMonth(startdate.getMonth() - 1);
                                                            $('#dtFromDate').datetimepicker({
                                                                format: "DD-MMM-YYYY",
                                                                showTodayButton: true,
                                                                defaultDate: startdate,
                                                                //showClear: true,
                                                                showClose: true,
                                                                minDate: startdate,
                                                                maxDate: today

                                                            }
                                                            );
                                                            //$('#dtFromDate').data("DateTimePicker").minDate(startdate);
                                                            //$('#dtFromDate').data("DateTimePicker").maxDate(today);
                                                        });
                                                        $(function () {

                                                            var startdate = new Date();
                                                            var today = new Date();
                                                            today.setHours(today.getHours())
                                                            startdate.setMonth(startdate.getMonth() - 6);
                                                            $('#dtToDate').datetimepicker({
                                                                format: "DD-MMM-YYYY",
                                                                showTodayButton: true,
                                                                //showClear: true,
                                                                showClose: true,
                                                                minDate: startdate,
                                                                maxDate: today
                                                            }
                                                            );
                                                            //$('#dtToDate').data("DateTimePicker").minDate(startdate);
                                                            //$('#dtToDate').data("DateTimePicker").maxDate(today);
                                                        });
                                                    });
                                                });
                                            </script>--%>
                                            <div class="col-ks-1_5">
                                                <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 form-controllinebreak" AutoPostBack="true" OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
                                                    <asp:ListItem Text="All" Value="All" Selected="True"></asp:ListItem>
                                                    <asp:ListItem Text="Success" Value="Success"></asp:ListItem>
                                                    <asp:ListItem Text="Pending" Value="Pending"></asp:ListItem>
                                                    <asp:ListItem Text="Expired" Value="Expired"></asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                            <div class="col-ks-1_5">
                                            </div>
                                            <div class="col-ks-2_5">
                                                <asp:ImageButton ID="btnView1" runat="server" OnClientClick="return ValidateScheduleofCommands();"
                                                    OnClick="btnView_Click" ImageUrl="~/images/btn-view-schedules.png" Visible="false" />
                                                <asp:LinkButton ID="btnView" runat="server" CssClass="btn-fa-paper-plane btn btn-primary" OnClientClick="return ValidateScheduleofCommands();"
                                                    OnClick="btnView_Click" Text="&nbsp;&nbsp;View Command">
                                                </asp:LinkButton>
                                            </div>
                                        </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-13">
                                            <asp:Label ID="Label11" Text="Command History" CssClass="pnlhearder" runat="server"></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"
                                                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:ImageButton ID="btnExport1" runat="server" ImageUrl="~/images/btn-export.jpg"
                                                OnClick="btnExport_Click" Visible="false" />
                                            <asp:LinkButton ID="btnExport" runat="server" CssClass="fa-file-excel-o btn btn-primary" OnClick="btnExport_Click">
                                            </asp:LinkButton>
                                        </div>
                                    </div>
                                    <div class="row ftop">
                                        <div class="col-md-12">
                                            <dxw:ASPxGridView ID="gvScheduleDetails" ClientInstanceName="gvScheduleDetails" runat="server" Width="100%" KeyFieldName="ScheduleId"
                                                Settings-ShowFilterRow="true" CssFilePath="~/App_Themes/Office2003Blue/GridView/styles.css" CssPostfix="Office2003_Blue"
                                                EnableTheming="true" Theme="Office2003Blue" OnHtmlRowCreated="gvScheduleDetails_HtmlRowCreated">
                                                <ClientSideEvents SelectionChanged="function(s, e) { OnGridSelectionChanged(1); }" />
                                                <Settings ShowVerticalScrollBar="true" VerticalScrollableHeight="450" />
                                                <SettingsBehavior ProcessSelectionChangedOnServer="false" />
                                                <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">
                                                </SettingsPager>
                                                <Columns>
                                                    <dxw:GridViewDataColumn Caption="Vehicle Name" FieldName="VehicleDescription" Width="8%"
                                                        VisibleIndex="0">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblVehicleDescription" Text="Vehicle Name"
                                                                Font-Bold="false" runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn Caption="Command Name" FieldName="BoxCmdOutTypeName" Width="10%"
                                                        VisibleIndex="1">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblBoxCmdOutTypeName" Text="Command Name"
                                                                Font-Bold="false" runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblMessage" runat="server" Text='<%# Eval("BoxCmdOutTypeName") %>' Style="word-wrap: break-word;">
                                                            </asp:Label>
                                                            <%-- <asp:ImageButton ID="btnSMSBasedQuery" runat="server" AlternateText="SMS based Query"
                                                            ToolTip='SMS based Query' Style="cursor: not-allowed" Visible='<%# Eval("SMSStatus").ToString() != "0"  ? true : false %>'
                                                            ImageUrl='~/images/mobile.png' />--%>
                                                        </DataItemTemplate>
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn Caption="Command Inputs" FieldName="Inputs" Width="15%"
                                                        VisibleIndex="2">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblInputs" Text="Command Inputs" Font-Bold="false"
                                                                runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblCommandInput" runat="server" Text='<%# Eval("Inputs") %>' Style="word-wrap: break-word;"></asp:Label>
                                                        </DataItemTemplate>
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataDateColumn Caption="Date & Time" FieldName="CreatedDateTime"
                                                        Name="CreatedDateTime" Width="12%" VisibleIndex="3">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label
                                                                ID="lblCreatedDateTimeSort" Text="Date & Time" Font-Bold="false" runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblDriName" runat="server" Text='<%# Eval("CreatedDateTime") %>' Style="word-wrap: break-word;"></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="False" ShowFilterRowMenu="False" />
                                                    </dxw:GridViewDataDateColumn>
                                                    <dxw:GridViewDataColumn Caption="Date & Time" FieldName="CreatedDateTime"
                                                        Name="CreatedDateTimeSort" Width="12%" Visible="false" VisibleIndex="3">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label
                                                                ID="lblCreatedDateTime" Text="Date & Time" Font-Bold="false" runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblDriName" runat="server" Text='<%# Eval("CreatedDateTime") %>' Style="word-wrap: break-word;"></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="false" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataDateColumn Caption="Expires On" FieldName="EffectiveToSort" Width="10%"
                                                        VisibleIndex="4" Visible="false">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblEffectiveToSort" Text="Expires On" Font-Bold="false"
                                                                runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblEffective" runat="server" Text='<%# Eval("RetriesPeriod") %>' Style="word-wrap: break-word;"></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="False" />
                                                    </dxw:GridViewDataDateColumn>
                                                    <dxw:GridViewDataColumn Caption="Expires On" FieldName="RetriesPeriod" Visible="false"
                                                        Width="10%" VisibleIndex="4">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblRetriesPeriod" Text="Expires On" Font-Bold="false"
                                                                runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblEffective" runat="server" Text='<%# Eval("RetriesPeriod") %>' Style="word-wrap: break-word;"></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="false" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataDateColumn Caption="Executed On" FieldName="ExecutionOnSort" Width="10%"
                                                        VisibleIndex="5">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblExecutionOnSort" Text="Executed On" Font-Bold="false"
                                                                runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblDriName" runat="server" Text='<%# Eval("ExecutionOn") %>' Style="word-wrap: break-word;"></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="False" ShowFilterRowMenu="False" />
                                                    </dxw:GridViewDataDateColumn>
                                                    <dxw:GridViewDataColumn Caption="Executed On" FieldName="ExecutionOn" Width="10%"
                                                        Visible="false" VisibleIndex="5">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblExecutionOn" Text="Executed On" Font-Bold="false"
                                                                runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Label ID="lblDriName" runat="server" Text='<%# Eval("ExecutionOn") %>' Style="word-wrap: break-word;"></asp:Label>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="false" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn Caption="Acknowledged" FieldName="Acknowledged"
                                                        Name="CreatedDateTimeSort" Width="5%" VisibleIndex="6" CellStyle-HorizontalAlign="Center">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label
                                                                ID="lblAcknowledged" Text="Acknowledged" Font-Bold="false" runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <img src='<%# Convert.ToString(Eval("Acknowledged")) == "Yes"? "../images/icn-accept.gif"  : "../images/icn-close.gif" %>' alt="" align="top" />
                                                            <%--<asp:Label ID="lblAcknowledged" runat="server" Text='<%# Eval("Acknowledged") %>'></asp:Label>--%>
                                                        </DataItemTemplate>
                                                        <Settings AllowAutoFilter="false" />
                                                    </dxw:GridViewDataColumn>
                                                    <dxw:GridViewDataColumn Caption="Status" FieldName="commandStatus" Width="6%" CellStyle-HorizontalAlign="Center"
                                                        VisibleIndex="7">
                                                        <HeaderCaptionTemplate>
                                                            <asp:Label ID="lblcommandStatus" Text="Status" Font-Bold="false"
                                                                runat="server"></asp:Label>
                                                        </HeaderCaptionTemplate>
                                                    </dxw:GridViewDataColumn>
                                                    <%--<dxw:GridViewDataColumn Caption="Acknowledged Status" FieldName="ACKStatus"
                                                    Name="CreatedDateTimeSort" Width="5%" VisibleIndex="8" CellStyle-HorizontalAlign="Center">
                                                    <HeaderCaptionTemplate>
                                                        <span>
                                                            <img src="../images/icn-date-time.gif" alt="" align="top" />&nbsp;</span><span class="label">&nbsp;<asp:Label
                                                                ID="lblACKStatus" Text="Ack Status" Font-Bold="false" runat="server"></asp:Label></span>
                                                    </HeaderCaptionTemplate>
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblACKStatus" runat="server" Text='<%# Eval("ACKStatus") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <Settings AllowAutoFilter="false" />
                                                </dxw:GridViewDataColumn>--%>
                                                    <dxw:GridViewDataTextColumn Caption="Reschedule" Width="3%" HeaderStyle-HorizontalAlign="Center"
                                                        CellStyle-HorizontalAlign="Center" VisibleIndex="7" Visible="false">
                                                        <HeaderTemplate>
                                                        </HeaderTemplate>
                                                        <DataItemTemplate>
                                                            <asp:LinkButton ID="lbtnReschedule" runat="server" Visible='<%# Eval("commandStatus").ToString()=="Expired"? true : false %>'
                                                                alternatetext="Reschedule" CommandArgument='<%#Eval("ScheduleId")%>' OnClick="lbtnReschedule_Click"><img src="../images/skip.png" alt="" /></asp:LinkButton>
                                                        </DataItemTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="Delete" Width="3%" HeaderStyle-HorizontalAlign="Center"
                                                        CellStyle-HorizontalAlign="Center" VisibleIndex="7" Visible="false">
                                                        <HeaderTemplate>
                                                        </HeaderTemplate>
                                                        <DataItemTemplate>
                                                            <asp:LinkButton ID="lbtnDelete" runat="server" Visible='<%# Eval("commandStatus").ToString()=="Pending"? true : false %>'
                                                                alternatetext="Delete" CommandArgument='<%#Eval("ScheduleId")%>' OnClick="lbtnDelete_click"><img src="../images/delete-icon.gif" alt="" /></asp:LinkButton>
                                                        </DataItemTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                </Columns>
                                                <Settings ShowFilterRow="true" ShowFilterRowMenu="True" />
                                                <SettingsText EmptyDataRow="No Command History found" />
                                            </dxw:ASPxGridView>
                                            <dxw:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvScheduleDetails"
                                                ReportHeader="{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Arial;}}
\viewkind4\uc1\pard\f0\fs20                                                                                      \b\f1\fs28 Command History    \par
\par
\par
}
">
                                                <PageFooter Right="[Page # of Pages #]">
                                                </PageFooter>
                                            </dxw:ASPxGridViewExporter>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </asp:Panel>
                    <%-- </div>--%>
                    <asp:Button ID="btnTest" Text="Test" CssClass="ControlHide" runat="server" />
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="btnTest" />
                    <asp:PostBackTrigger ControlID="btnExport" />
                </Triggers>
            </asp:UpdatePanel>
            <%-- </asp:UpdatePanel>--%>
            <cc1:ModalPopupExtender ID="mpeProgressIndicator" runat="server" PopupControlID="pnlProgress"
                TargetControlID="btnTesting" BackgroundCssClass="modalBackground">
            </cc1:ModalPopupExtender>
            <asp:Button ID="btnTesting" Style="display: none;" runat="server" />
            <%--<asp:UpdateProgress ID="uprDataLoading" runat="server" DynamicLayout="True" AssociatedUpdatePanelID="updDriverDetails">
            <ProgressTemplate>--%>
            <asp:Panel ID="pnlProgress" runat="server" CssClass="processMessage" Style="z-index: 1000;">
                <center>
                <br />
                <img id="imgLoadingpanel" runat="server" 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>
            <%-- </ProgressTemplate>
        </asp:UpdateProgress>--%>
            <%-- Sakthi - 14-Jan-2012--%>
            <script type="text/javascript" language="javascript">
                function selectAll(object) {
                    var checkboxCollection = document.getElementById('ddlVehicle').getElementsByTagName('input');
                    for (var i = 0; i < checkboxCollection.length; i++) {
                        if (checkboxCollection[i].type.toString().toLowerCase() == "checkbox") {
                            checkboxCollection[i].checked = object;
                        }
                    }
                }
                function validateSelectAll() {
                    var checkboxCollection = document.getElementById('ddlVehicle').getElementsByTagName('input');
                    var valid = true;
                    for (var i = 0; i < checkboxCollection.length; i++) {
                        if (checkboxCollection[i].type.toString().toLowerCase() == "checkbox") {
                            if (checkboxCollection[i].checked == false) {
                                valid = false;
                            }
                        }
                    }
                    if (valid == true) {
                        document.getElementById('chkSelectAll').checked = true;
                    }
                    else {
                        document.getElementById('chkSelectAll').checked = false;
                    }
                }
            </script>
            <script type="text/javascript" language="javascript" src="../js/DateValidations.js"></script>
            <script type="text/javascript" language="javascript" src="../js/FormValidations.js"></script>
            <script src="../js/myformvalidations.js" type="text/javascript"></script>
            <script language="javascript" type="text/javascript" src="../js/DriverManagementScript.js"></script>

            <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>
            <script src="../js/bootstrap.js"></script>
        </form>
        <!-- Content Ends Here -->
    </div>
    <uc2:Footer ID="ucFooter" runat="server" />
</body>
</html>
