<%@ page language="C#" autoeventwireup="true" inherits="Forms_DriverIncentiveScreen, App_Web_tixsvc3u" %>

<%@ 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="dxw" %>
<%@ 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" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <meta http-equiv="Page-Enter" content="blendTrans(Duration=0)" />
    <meta http-equiv="Page-Exit" content="blendTrans(Duration=0)" />
    <title>tSense-IoT Driver Incentive Master</title>
    <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 rel="SHORTCUT ICON" href="../images/favicon.ico" />
    <style type="text/css">
        </style>
    <link id="ieonly" runat="server" rel="stylesheet" type="text/css" href="" />
    <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" />
    <%--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" />

    <script src="../js/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script language="JavaScript1.2" type="text/javascript" src="../js/myformvalidations.js"></script>
    <%--********* 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/wow.min.js"></script>
</head>
<body>
    <div id="container">
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel runat="server" ID="updDriverDetails" UpdateMode="Conditional">
                <ContentTemplate>
                    <!-- Header Starts Here -->
                    <uc1:Header ID="ucHeader" runat="server" />
                    <!-- Nav Ends Here -->
                    <!-- Content Starts Here -->
                    <div id="outer">
                        <div id="inner">
                            <div id="float-wrap">
                                <!-- Main Content Starts Here -->
                                <div id="content">
                                    <div class="content-wrap">
                                        <div id="top-content">
                                            <div id="heading">
                                                <img class="icon" src="../images/configuration-icon.jpg" alt="" />
                                                <h1>
                                                    <asp:Literal ID="lblConfigurationSetupCaption" Text="Configuration" runat="server"></asp:Literal>
                                                </h1>
                                                <asp:LinkButton ID="lnkHomeCaption" runat="server"></asp:LinkButton><span>&gt;</span><span><a
                                                    href="DriverIncentiveScreen.aspx"><asp:Label ID="lblMngDriver" Text="Manage Incentives"
                                                        runat="server"></asp:Label></a></span>
                                            </div>
                                            <div id="control-box">
                                                <table border="0" cellpadding="0" cellspacing="0" class="btnAlign">
                                                    <tr>
                                                        <td>
                                                            <div>
                                                                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                                    <tr height="20px">
                                                                        <td></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            <%-- <asp:LinkButton ID="ibtnBackToIncentives" runat="server" PostBackUrl="~/Forms/DriverIncentiveConfiguration.aspx" 
                                                                                CssClass="btn" Width="135px"><span>Driver Incentives Settings</span></asp:LinkButton>--%>
                                                                            <asp:ImageButton ID="ibtnBackToIncentives1" runat="server" PostBackUrl="~/Forms/DriverIncentiveConfiguration.aspx"
                                                                                ImageUrl="~/images/manage-incentive-settings.png" Visible="false" />
                                                                            <asp:LinkButton ID="ibtnBackToIncentives" runat="server" CausesValidation="true"
                                                                                CssClass="MultilingualBtn" PostBackUrl="~/Forms/DriverIncentiveConfiguration.aspx">
                                                                                <span runat="server" class="MultilingualBtnspan">
                                                                                    <div class="ManageIncentiveSettings">
                                                                                        <div id="ManageIncentiveSettingsDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                                            Manage Incentive Settings
                                                                                        </div>
                                                                                    </div>
                                                                                </span>
                                                                            </asp:LinkButton>&nbsp;
                                                                        </td>
                                                                        <td>
                                                                            <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" CausesValidation="true" CssClass="MultilingualBtn"
                                                                                PostBackUrl="~/Forms/ConfigurationSetup.aspx">
                                                                                <span runat="server" class="MultilingualBtnspan">
                                                                                    <div class="Back">
                                                                                        <div id="BackDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                                            Back to Configuration
                                                                                        </div>
                                                                                    </div>
                                                                                </span>
                                                                            </asp:LinkButton>&nbsp;&nbsp;
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                            <div class="clear clearfix">
                                            </div>
                                        </div>
                                        <div class="clear clearfix">
                                        </div>
                                        <asp:Panel ID="pnlDriverBattaInputDetails" runat="server">
                                            <div class="form-box">
                                                <h1 id="spnName" runat="server">
                                                    <span class="icon">
                                                        <img src="../images/driver-scheduling-caption.png" alt="" /></span><asp:Label ID="lblCapDriverSchedule"
                                                            Text="Driver Schedule Details" runat="server"></asp:Label></h1>
                                                <table cellspacing="5px" border="0" class="form-tbl" width="90%">
                                                    <tr id="trInputs" runat="server">
                                                        <td></td>
                                                        <td>
                                                            <%-- <img src="../images/icn-driver-name.gif" alt="Driver Name" />--%>
                                                            <asp:Label ID="lblDriverName" runat="server" Text="Driver Name" CssClass="label"></asp:Label>
                                                            <asp:Label ID="Label4" runat="server" ForeColor="Red">*</asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:DropDownList ID="ddlDriverName" runat="server" Width="90px">
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td>&nbsp;
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="lblReptype" runat="server" Text="Interval"></asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:DropDownList ID="ddlRepType" runat="server" Width="95px" onchange="Intervals();">
                                                                <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>
                                                        </td>
                                                        <td></td>
                                                        <td>
                                                            <asp:CheckBox ID="chkConsolidated" runat="server" Text="Consolidated" Checked="false" />
                                                        </td>
                                                        <td></td>
                                                        <td>
                                                            <%-- <img src="../images/calendar-icon.gif" alt="From" />--%>
                                                            <asp:Label ID="lblFromDate" runat="server" Text="From" CssClass="label"></asp:Label>
                                                            <asp:Label ID="Label15" runat="server" ForeColor="Red">*</asp:Label>
                                                        </td>
                                                        <td style="direction: ltr">
                                                            <asp:TextBox ID="txtFromDate" runat="server" onkeypress="return false" onpaste="return false"
                                                                CssClass="date"></asp:TextBox>
                                                            <cc1:CalendarExtender ID="calFromdate" runat="server" CssClass="cal_Theme1" TargetControlID="txtFromDate"
                                                                Format="dd/MM/yyyy" OnClientDateSelectionChanged="checkDate">
                                                            </cc1:CalendarExtender>
                                                        </td>
                                                        <td></td>
                                                        <td>
                                                            <%-- <img src="../images/calendar-icon.gif" alt="To" />--%>
                                                            <asp:Label ID="lblToDate" runat="server" CssClass="label" Text="To"></asp:Label>
                                                            <asp:Label ID="Label9" runat="server" ForeColor="Red">*</asp:Label>
                                                        </td>
                                                        <td style="direction: ltr">
                                                            <asp:TextBox ID="txtToDate" runat="server" onkeypress="return false" onpaste="return false"
                                                                TabIndex="12" CssClass="date"></asp:TextBox>
                                                            <cc1:CalendarExtender ID="calTodate" runat="server" CssClass="cal_Theme1" TargetControlID="txtToDate"
                                                                Format="dd/MM/yyyy" OnClientDateSelectionChanged="checkDate">
                                                            </cc1:CalendarExtender>
                                                        </td>
                                                        <td>
                                                            <asp:ImageButton ID="btnView1" runat="server" OnClientClick="return ValidateDriverSchedule();"
                                                                OnClick="btnView_Click" ImageUrl="~/images/btn-view-schedules.png" Visible="false" />
                                                            <asp:LinkButton ID="btnView" runat="server" CausesValidation="true" CssClass="MultilingualBtn"
                                                                OnClientClick="return ValidateDriverSchedule();" OnClick="btnView_Click">
                                                                <span runat="server" class="MultilingualBtnspan">
                                                                    <div class="ViewSchedule">
                                                                        <div id="ViewScheduleDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                            View Incentives
                                                                        </div>
                                                                    </div>
                                                                </span>
                                                            </asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                    <tr id="trAmtIssued" runat="server">
                                                        <td></td>
                                                        <%-- <td id="tdIsPartial" runat="server" visible="false">
                                                        <asp:CheckBox ID="chkAmtIssued" runat="server" Text="Partial Settlement" Checked="false"
                                                            onclick="PartialAmt();" />
                                                    </td>
                                                    <td id="tdParial" runat="server" style="display: none;">
                                                        <asp:TextBox ID="txtPartialAMT" runat="server" CssClass="date" onkeypress="return chkDecNums(event,this);"
                                                            MaxLength="7" onblur="return CheckTotAmt();"></asp:TextBox>
                                                    </td>--%>
                                                        <td colspan="15" style="text-align: right;">
                                                            <asp:ImageButton ID="btnAmtIssued1" runat="server" OnClientClick="return Confirm();"
                                                                OnClick="btnAmtIssued_Click" ImageUrl="~/images/amount-issued.png" Visible="false" />
                                                            <asp:LinkButton ID="btnAmtIssued" runat="server" CausesValidation="true" CssClass="MultilingualBtn"
                                                                OnClientClick="return Confirm();" OnClick="btnAmtIssued_Click">
                                                                <span runat="server" class="MultilingualBtnspan">
                                                                    <div class="AmountIssued">
                                                                        <div id="AmountIssuedDiv" runat="server" class="MultilingualBtnTextAlign">
                                                                            Amount Issued
                                                                        </div>
                                                                    </div>
                                                                </span>
                                                            </asp:LinkButton>
                                                            &nbsp;
                                                        <asp:ImageButton ID="ImageButton" runat="server" OnClick="btnView_Click" ImageUrl="~/images/btn-view-schedules.png"
                                                            Visible="false" />
                                                            <asp:LinkButton ID="ImageButton2" runat="server" CausesValidation="true" CssClass="MultilingualBtn"
                                                                OnClick="btnView_Click">
                                                                <span runat="server" class="MultilingualBtnspan">
                                                                    <div class="ViewSchedule">
                                                                        <div id="ViewScheduleDiv1" runat="server" class="MultilingualBtnTextAlign">
                                                                            View Schedule
                                                                        </div>
                                                                    </div>
                                                                </span>
                                                            </asp:LinkButton>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <div class="clear clearfix">
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                    <div class="clear clearfix">
                                    </div>
                                    <asp:Panel ID="pnlDriverBattaDetailsList" runat="server">
                                        <div class="form-box">
                                            <h1>
                                                <span class="icon">
                                                    <img src="../images/driver-incentive-details.png" alt="" /></span><asp:Label ID="lblCapDrvBattaDetails"
                                                        runat="server" Text="Driver Incentive Details"></asp:Label></h1>
                                        </div>
                                        <div id="grid-dsply">
                                            <dxw:ASPxGridView ID="gvdrivers" runat="server" Width="100%" Settings-ShowFilterRow="false"
                                                KeyFieldName="DriverId" EnableTheming="true" Theme="Office2003Blue"
                                                CssFilePath="~/App_Themes/Office2003Blue/GridView/styles.css" CssPostfix="Office2003_Blue"
                                                OnHtmlRowCreated="gvdrivers_HtmlRowCreated" OnAfterPerformCallback="gvdrivers_AfterPerformCallback">
                                                <%-- <ClientSideEvents SelectionChanged="function(s, e) { OnGridSelectionChanged(1); }" />
                                          <Settings ShowVerticalScrollBar="true" VerticalScrollableHeight="50" />--%>
                                                <SettingsBehavior ProcessSelectionChangedOnServer="false" />
                                                <%--<Images ImageFolder="~/App_Themes/Office2003Blue/GridView/">
                                                <CollapsedButton Height="12px" Url="~/App_Themes/Office2  003 Blue/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="10">
                                                </SettingsPager>
                                                <Columns>
                                                    <dxw:GridViewDataTextColumn Caption="DriverName" FieldName="DisplayName" Width="25%">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-driver-name.gif" alt="" align="top" />&nbsp;
                                                            <asp:Label ID="lblDisplayName" runat="server" Text="Driver Name"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="VehicleName" FieldName="VehicleName" Width="25%">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-vehicle-name.gif" alt="" align="middle" />&nbsp;
                                                            <asp:Label ID="lblVehicleName" runat="server" Text="Vehicle Name"></asp:Label>
                                                            </span>
                                                        </HeaderCaptionTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="From Time" FieldName="FromTime" Width="10%">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-time.gif" alt="" align="middle" />&nbsp;
                                                            <asp:Label ID="lblFromTime" runat="server" Text="From Time"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="To Time" FieldName="ToTime" Width="10%">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-time.gif" alt="" align="top" />&nbsp;<asp:Label ID="lblToTime"
                                                                    runat="server" Text="To Time"></asp:Label>
                                                            </span>
                                                        </HeaderCaptionTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="NoOfTrips" FieldName="NoOfTrips" Width="10%"
                                                        HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-tripmode.gif" alt="" align="middle" />&nbsp;<asp:Label ID="lblNoOfTrips"
                                                                    runat="server" Text="NoOfTrips"></asp:Label>
                                                            </span>
                                                        </HeaderCaptionTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="Type" Width="10%">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-license-expireson.gif" alt="" align="top" />&nbsp;<asp:Label
                                                                    ID="lblType" runat="server" Text="Type"></asp:Label></span>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:DropDownList ID="ddlReportType" runat="server" Width="100%">
                                                                <asp:ListItem Selected="True">PDF</asp:ListItem>
                                                                <asp:ListItem>Excel</asp:ListItem>
                                                                <asp:ListItem>Word</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </DataItemTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="Status" Width="5%" HeaderStyle-HorizontalAlign="Center"
                                                        CellStyle-HorizontalAlign="Center">
                                                        <HeaderCaptionTemplate>
                                                            <span>
                                                                <img src="../images/icn-status.gif" alt="Settlement" title="Settlement Status" align="top" /></span>
                                                        </HeaderCaptionTemplate>
                                                        <DataItemTemplate>
                                                            <asp:Image ID="imgStatus" runat="server" ImageUrl="~/images/icn-accept.gif" Visible='<%# Convert.ToBoolean(Eval("AmtIssued").ToString())%>'
                                                                title="Amount Issued" />
                                                        </DataItemTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                    <dxw:GridViewDataTextColumn Caption="TripSheet" Width="5%" Name="TripSheet" HeaderStyle-HorizontalAlign="Center"
                                                        CellStyle-HorizontalAlign="Center">
                                                        <HeaderTemplate>
                                                        </HeaderTemplate>
                                                        <DataItemTemplate>
                                                            <asp:LinkButton ID="lbtnTripSheet" runat="server" ImageAlign="Middle" CommandArgument='<%#Eval("DriverId")+","+Eval("StartDate")+","+Eval("Enddate")+","+Eval("VehicleId")+","+Eval("AmtIssued") %>'
                                                                OnClick="lbtnTripSheet_click"><img src="../images/icn-tripsheets.gif" alt="TripSheet" title="Click here to Generate TripSheet" /></asp:LinkButton>
                                                        </DataItemTemplate>
                                                    </dxw:GridViewDataTextColumn>
                                                </Columns>
                                                <%-- <ClientSideEvents ColumnSorting="function(s, e) {document.getElementById('btnTest').click();}"
                                                EndCallback="" />--%>
                                                <Settings ShowFilterRowMenu="false" />
                                            </dxw:ASPxGridView>
                                        </div>
                                    </asp:Panel>
                                    <div id="divPDF" runat="server" visible="false">
                                        <iframe id="PDFframe" runat="server" style="height: 400px; width: 100%; overflow: auto;"
                                            frameborder="0" scrolling="auto"></iframe>
                                    </div>
                                </div>
                            </div>
                            <!-- Main Content Ends Here -->
                            <div id="left">
                            </div>
                            <div class="clear clearfix">
                            </div>
                        </div>
                        <div id="right">
                        </div>
                        <div class="clear clearfix">
                        </div>
                    </div>
                    <%-- </div>--%>
                    <asp:Button ID="btnTest" Text="Test" CssClass="ControlHide" runat="server" />
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="btnTest" />
                    <asp:PostBackTrigger ControlID="gvdrivers" />
                </Triggers>
            </asp:UpdatePanel>
            <cc1:ModalPopupExtender ID="mpeMapProgressIndicator" runat="server" PopupControlID="pnlProgress"
                TargetControlID="btnTesting">
            </cc1:ModalPopupExtender>
            <%--  <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="imgLoad" 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>--%>
            <asp:HiddenField ID="hdnTotAmt" runat="server" />
            <asp:Button ID="btnTesting" Text="Test" CssClass="ControlHide" runat="server" />
            <script type="text/javascript" src="../js/GridCheckBoxMaintaining.js"></script>

            <script language="javascript" type="text/javascript" src="../js/DriverManagementScript.js"></script>

            <script language="javascript" type="text/javascript" src="../js/myformvalidations.js"></script>

            <script language="javascript" type="text/javascript" src="../js/CommonFuncitonsInHeader.js"></script>

            <asp:HiddenField ID="hdnReportOption" runat="server" />
        </form>
        <!-- Content Ends Here -->
    </div>
    <uc2:Footer ID="ucFooter" runat="server" />

    <script type="text/javascript" language="javascript">
        function CheckTotAmt() {

            if ((document.getElementById('txtPartialAMT').value == "") || (parseFloat(document.getElementById('txtPartialAMT').value) > parseFloat(document.getElementById('hdnTotAmt').value))) {
                alert("Please enter the amount less than or equal to total amount.");
                document.getElementById('txtPartialAMT').style.backgroundColor = 'lightyellow';
                document.getElementById('txtPartialAMT').focus();
                return false;
            }
            else {
                document.getElementById('txtPartialAMT').style.backgroundColor = 'white';
                return true;
            }

        }
        function CheckTotAmt1() {
            if (document.getElementById('chkAmtIssued').checked) {
                if ((document.getElementById('txtPartialAMT').value == "") || (parseFloat(document.getElementById('txtPartialAMT').value) > parseFloat(document.getElementById('hdnTotAmt').value))) {
                    alert("Please enter the amount less than or equal to total amount.");
                    document.getElementById('txtPartialAMT').style.backgroundColor = 'lightyellow';
                    document.getElementById('txtPartialAMT').focus();
                    return false;
                }
                else {
                    document.getElementById('txtPartialAMT').style.backgroundColor = 'white';
                    confirm('Are you sure you want to settle the Amount?');
                    return true;
                }
            }
            else {
                confirm('Are you sure you want to settle the Amount?');
                return true;
            }
        }
        function PartialAmt() {
            var isAmt = document.getElementById('chkAmtIssued').checked;
            document.getElementById('txtPartialAMT').value = "";
            if (isAmt) {
                document.getElementById('tdParial').style.display = "block";
            }
            else {
                document.getElementById('tdParial').style.display = "none";
            }
        }
        function ReportOption(control, RowNo, AssignmentId) {
            document.getElementById('hdnReportOption').value = document.getElementById(control).value + "," + RowNo + "," + AssignmentId;
        }
        function Intervals() {
            var interval = document.getElementById('ddlRepType').value;
            var day = new Date().getDay == "0" ? 0 : 1;
            if (interval == "1") {
                document.getElementById('txtFromDate').value = "";
                document.getElementById('txtToDate').value = "";
                document.getElementById('txtFromDate').disabled = false;
                document.getElementById('txtToDate').disabled = false;
            }
            else if (interval == "2") {
                var val = "";
                str = "";
                var str = String((new Date().getDate() - new Date().getDay()) + day + "/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear()).split('/');
                for (var i = 0; i < str.length; i++) {
                    if (str[i].length < 2) {
                        val = val + "0" + str[i] + "/";
                    }
                    else {
                        if (i == 2)
                            val = val + str[i];
                        else {
                            if (i == 0)
                                if (parseInt(str[i]) < 0) {
                                    val = new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate() + parseInt(str[i]) + "/" + (new Date().getMonth() >= 10 ? new Date().getMonth() : "0" + new Date().getMonth()) + "/" + new Date().getFullYear();
                                    break;
                                }
                            val = val + str[i] + "/";
                        }
                    }
                }
                document.getElementById('txtFromDate').value = val;
                str = "";
                val = "";
                str = String((new Date().getDate()) + "/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear()).split('/');
                for (var i = 0; i < str.length; i++) {
                    if (str[i].length < 2) {
                        val = val + "0" + str[i] + "/";
                    }
                    else {
                        if (i == 2)
                            val = val + str[i];
                        else {
                            if (i == 0)
                                if (parseInt(str[i]) < 0) {
                                    val = new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate() + parseInt(str[i]) + "/" + (new Date().getMonth() >= 10 ? new Date().getMonth() : "0" + new Date().getMonth()) + "/" + new Date().getFullYear();
                                    break;
                                }
                            val = val + str[i] + "/";
                        }
                    }
                }
                document.getElementById('txtToDate').value = val;
                document.getElementById('txtFromDate').disabled = true;
                document.getElementById('txtToDate').disabled = true;
            }
            else if (interval == "3") {
                var d = (new Date().getDate() - (new Date().getDate() + 7));
                var val = "";
                var isNegative = 0;
                str = "";
                str = String((new Date().getDate() - (new Date().getDay() + 7)) + day + "/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear()).split('/');
                for (var i = 0; i < str.length; i++) {
                    if (str[i].length < 2) {
                        val = val + "0" + str[i] + "/";
                    }
                    else {
                        if (i == 2)
                            val = val + str[i];
                        else {
                            if (i == 0)
                                if (parseInt(str[i]) < 0) {
                                    val = new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate() + parseInt(str[i]) + "/" + (new Date().getMonth() >= 10 ? new Date().getMonth() : "0" + new Date().getMonth()) + "/" + new Date().getFullYear();
                                    break;
                                }
                            val = val + str[i] + "/";
                        }
                    }
                }
                document.getElementById('txtFromDate').value = val;
                str = "";
                val = "";
                str = String((new Date().getDate() - new Date().getDay()) + "/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear()).split('/');

                if (str[0] < 7 && str[1] == 1) {
                    var modifieddate = String(document.getElementById('txtFromDate').value).split('/');
                    for (var i = 0; i < modifieddate.length; i++) {
                        if (i == 0) {
                            val = val + modifieddate[i] + "/";
                        }
                        else if (i == 1) {
                            val = val + "12/";
                        }
                        else if (i == 2) {
                            val = val + (parseInt(modifieddate[i]) - 1);
                        }
                    }
                    document.getElementById('txtFromDate').value = val;
                    val = "";
                }

                for (var i = 0; i < str.length; i++) {
                    if (str[i].length < 2) {
                        val = val + "0" + str[i] + "/";
                    }
                    else {
                        if (i == 2)
                            val = val + str[i];
                        else {
                            if (i == 0)
                                if (parseInt(str[i]) < 0) {
                                    val = new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate() + parseInt(str[i]) + "/" + (new Date().getMonth() >= 10 ? new Date().getMonth() : "0" + new Date().getMonth()) + "/" + new Date().getFullYear();
                                    break;
                                }
                            val = val + str[i] + "/";
                        }
                    }
                }

                document.getElementById('txtToDate').value = val;
                document.getElementById('txtFromDate').disabled = true;
                document.getElementById('txtToDate').disabled = true;
            }
            else if (interval == "4") {
                //                document.getElementById('txtFromDate').value = "01/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear();
                //                var d = new Date().getDate().toString().length > 1 ? new Date().getDate() : "0" + new Date().getDate();
                //                document.getElementById('txtToDate').value = d + "/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear();
                //                document.getElementById('txtFromDate').disabled = true;
                //                document.getElementById('txtToDate').disabled = true;
                var month = new Date().getMonth().length > 1 ? (new Date().getMonth() + 1) : "0" + (new Date().getMonth() + 1);
                document.getElementById('txtFromDate').value = "01/" + month + "/" + new Date().getFullYear();
                var d = new Date().getDate().toString().length > 1 ? new Date().getDate() : "0" + new Date().getDate();
                document.getElementById('txtToDate').value = d + "/" + month + "/" + new Date().getFullYear();
                document.getElementById('txtFromDate').disabled = true;
                document.getElementById('txtToDate').disabled = true;
            }
            else if (interval == "5") {
                //                document.getElementById('txtFromDate').value = "01/" + (new Date().getMonth()) + "/" + new Date().getFullYear();
                //                document.getElementById('txtToDate').value = new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate() + "/" + (new Date().getMonth()) + "/" + new Date().getFullYear();
                //                document.getElementById('txtFromDate').disabled = true;
                //                document.getElementById('txtToDate').disabled = true;
                var lastmonth = new Date().getMonth() == '0' ? '12' : new Date().getMonth();
                var lastyear = new Date().getMonth() == '0' ? (parseInt(new Date().getFullYear()) - 1) : new Date().getFullYear();
                document.getElementById('txtFromDate').value = "01/" + lastmonth + "/" + lastyear;
                document.getElementById('txtToDate').value = new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate() + "/" + lastmonth + "/" + lastyear;

                document.getElementById('txtFromDate').disabled = true;
                document.getElementById('txtToDate').disabled = true;

            }
        }
        function Confirm() {

            return confirm('The settlement amount is ' + document.getElementById('hdnTotAmt').value + '.Do you want to issue?');
        }
    </script>

</body>
</html>
