<%@ page language="C#" autoeventwireup="true" inherits="Forms_DriverGroupAssignment, App_Web_f1guidzd" %>

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

<%--<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.2" Namespace="DevExpress.Web.ASPxGridView"
    TagPrefix="dxgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.2" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dxe" %>--%>

<%@ 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 Driver Group Assignment</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 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" />
    <link id="ieonly" runat="server" rel="stylesheet" type="text/css" href="" />
    <%--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>

    <%--********* 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>
    <%--********* For Bootstrap Implementation *************--%>
    <div class="pageContainer">
        <%--********* End of Bootstrap Implementation *************--%>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="updGrid" runat="server">
                <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 -->
                                <!-- Main Content Starts Here -->
                                <div id="content">
                                    <div class="content-wrap">
                                        <div id="top-content" class="container-fluid head-part">
                                            <div id="heading" class="col-sm-4 col-md-4">
                                                <img class="icon" src="../images/configuration-icon.jpg" alt="" />
                                                <h1>
                                                    <asp:Literal ID="lblConfigurationCaption" runat="server"></asp:Literal></h1>
                                                <asp:LinkButton ID="lnkHomeCaption" runat="server"></asp:LinkButton>
                                                <span>&gt;</span><span><a href="DriverGroupAssignment.aspx"><asp:Label ID="lblDriverAssignment"
                                                    runat="server"> Driver Group Assignment</asp:Label></a></span>
                                            </div>
                                            <div id="" class="col-sm-7 col-md-7 pull-right">
                                                <div class="pull-right btn-wrap">

                                                    <asp:LinkButton ID="BackToConfig" runat="server" CssClass="MultilingualBtn" PostBackUrl="~/Forms/ConfigurationSetup.aspx">
                                                        <span runat="server" class="MultilingualBtnspan">
                                                            <div class="Back">
                                                                <div id="ibtBackToConfig" runat="server" class="MultilingualBtnTextAlign">
                                                                    Back to Configuration
                                                                </div>
                                                            </div>
                                                        </span>
                                                    </asp:LinkButton>
                                                    <%-- <asp:ImageButton ID="ibtBackToConfig" runat="server" ImageUrl="~/images/btn-back-to-configuration.jpg"
                                                            TabIndex="10" PostBackUrl="~/Forms/ConfigurationSetup.aspx" />--%>
                                                </div>
                                            </div>
                                            <div class="clear clearfix">
                                            </div>
                                        </div>
                                        <asp:Panel ID="pnlDriverGroupSelection" runat="server" CssClass="ControlShow">
                                            <div class="form-box col-xs-12 nullpadding">
                                                <h1>
                                                    <span class="icon">
                                                        <img src="../images/group-icon.gif" alt="" /></span><asp:Label ID="lblGroupDriver"
                                                            runat="server"> Group Driver Assignment</asp:Label></h1>

                                                <div class="col-sm-12 MySearchPanelFilter">
                                                    <div class="col-sm-4 controllinebreak nullpadding">
                                                        <div class="col-xs-3 col-sm-4 col-lg-3 nullpadding">
                                                            <asp:Label ID="Label1" runat="server" Font-Bold="true" Text="Driver Group"></asp:Label>
                                                        </div>
                                                        <div class="col-xs-9 col-sm-8 col-lg-4 nullpadding">
                                                            <asp:DropDownList ID="ddlDriverGroups" runat="server" AutoPostBack="true" TabIndex="1" class="form-control"
                                                                AppendDataBoundItems="true" OnSelectedIndexChanged="ddlDriverGroups_SelectedIndexChanged">
                                                            </asp:DropDownList>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                        <div class="clear clearfix">
                                        </div>
                                        <asp:Panel ID="pnlUnAssignedDriverList" runat="server" CssClass="ControlHide">
                                            <div id="grid-dsply">
                                                <div id="top">
                                                    <div class="left-col">
                                                        <span class="icon txt" style="padding-top: 0px">
                                                            <img src="../images/icn-unassigned-users.gif" alt="" />
                                                            <asp:Label ID="lblUnassignedDrivers" runat="server" Text="Unassigned Drivers"></asp:Label></span>
                                                    </div>
                                                </div>
                                                <asp:HiddenField ID="hdnUsersToBeAssigned" runat="server" />
                                                <asp:HiddenField ID="hdnAssignedGroupUser" runat="server" />
                                                <div style="width: 100%; overflow: auto;">
                                                    <div class="table-responsive">
                                                        <dxw:ASPxGridView ID="gvUnAssignedUsers" runat="server" Width="100%" KeyFieldName="UserId"
                                                            CssFilePath="~/App_Themes/Office2003Blue/GridView/styles.css" CssPostfix="Office2003_Blue"
                                                            EnableTheming="true" Theme="Office2003Blue" OnAfterPerformCallback="gvUnAssignedUsers_AfterPerformCallback">
                                                            <%--OnHtmlRowCreated="gvUnAssignedUsers_OnHtmlRowCreated" --%>
                                                            <ClientSideEvents SelectionChanged="function(s, e) { OnGridSelectionChangedGroupAssign(1); }" />
                                                            <%--<Images ImageFolder="~/App_Themes/Office2003Blue/GridView/">
                                                    <CollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                        Width="11px" />
                                                    <ExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                        Width="11px" />
                                                    <DetailCollapsedButton Height="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">
                                                            </SettingsPager>
                                                            <Columns>
                                                                <dxw:GridViewDataColumn FieldName="UserId" Caption="AutoID" VisibleIndex="0" Visible="false">
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="1" Width="50px">
                                                                    <HeaderTemplate>
                                                                        <input type="checkbox" onclick="gvUnAssignedUsers.SelectAllRowsOnPage(this.checked);"
                                                                            style="vertical-align: middle;" title="Select/Unselect all rows on the page"
                                                                            tabindex="1"></input>
                                                                    </HeaderTemplate>
                                                                    <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center" />
                                                                </dxw:GridViewCommandColumn>
                                                                <dxw:GridViewDataColumn FieldName="DriverName" Caption="Driver Name" VisibleIndex="2"
                                                                    Width="200px">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="../images/icn-driver-name.gif" align="top" alt="" /></span> <span class="label">
                                                                                <asp:Label ID="lblDriverName" runat="server"> Driver Name</asp:Label></span>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="True" />
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn FieldName="DisplayName" Caption="Display Name" VisibleIndex="3"
                                                                    Visible="false">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="../images/icn-display-name.gif" align="top" alt="" /></span>
                                                                        <asp:Label ID="lblDisplayName" runat="server"> Display Name</asp:Label>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="True" />
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn FieldName="GroupBelongsTo" Caption="Group" VisibleIndex="4"
                                                                    Width="200px">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="..\Images\groupnew-icon.gif" align="top" alt="" /></span> <span class="label">
                                                                                <asp:Label ID="lblGroup" runat="server">Group</asp:Label></span>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="False" />
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataTextColumn FieldName="ActiveStatus" Caption="Active Status" VisibleIndex="5"
                                                                    HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center" Width="125px">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="../images/icn-active.gif" align="top" alt="" /></span> <span class="label">
                                                                                <asp:Label ID="lblActiveStatus" runat="server"> Active Status</asp:Label></span>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="False" />
                                                                </dxw:GridViewDataTextColumn>
                                                            </Columns>
                                                            <SettingsText EmptyDataRow="No Unassigned Users found" />
                                                            <Settings ShowFilterRow="true" ShowFilterRowMenu="True" />
                                                        </dxw:ASPxGridView>
                                                    </div>
                                                </div>
                                                <div class="form-box">
                                                    <div class="row rowSpace">
                                                        <div class="col-sm-6 col-md-8"></div>
                                                        <div class="col-sm-6 col-md-4">
                                                            <div class="form-groupAlign pull-right">
                                                                <asp:LinkButton ID="btnAssignDrivers" runat="server" CssClass="MultilingualBtn" OnClick="AssignDrivers"
                                                                    TabIndex="4" OnClientClick="ShowPopUp();">
                                                                    <span runat="server" class="MultilingualBtnspan">
                                                                        <div class="AssignUsers">
                                                                            <div id="AssignDriver" runat="server" class="MultilingualBtnTextAlign">
                                                                                Assign
                                                                            </div>
                                                                        </div>
                                                                    </span>
                                                                </asp:LinkButton>
                                                                <%--<asp:LinkButton ID="btnAssignDrivers" runat="server" class="btn" OnClick="AssignDrivers"
                                                                TabIndex="4" Width="64px"><span class="icon"><img src="../images/icn-user-assignment.gif" alt="" /></span><span>Assign</span></asp:LinkButton>--%>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                        </asp:Panel>
                                        <div class="clear clearfix">
                                        </div>
                                        <asp:Panel ID="pnlAssignedDriverList" runat="server" CssClass="ControlHide">
                                            <div id="grid-dsply">
                                                <div id="top">
                                                    <div class="left-col">
                                                        <span class="icon txt" style="padding-top: 0px">
                                                            <img src="../images/icn-user-assignment.gif" alt="" />
                                                            <asp:Label ID="lblAssignDrivers" runat="server" Text="Assigned Drivers"></asp:Label></span>
                                                    </div>
                                                </div>
                                                <asp:HiddenField ID="hdnUsersToBeUnassinged" runat="server" />
                                                <div style="width: 100%; overflow: auto;">
                                                    <div class="table-responsive">
                                                        <dxw:ASPxGridView ID="gvAssignedUsers" runat="server" Width="100%" KeyFieldName="UserId"
                                                            CssFilePath="~/App_Themes/Office2003Blue/GridView/styles.css" CssPostfix="Office2003_Blue"
                                                            EnableTheming="true" Theme="Office2003Blue" OnAfterPerformCallback="gvAssignedUsers_AfterPerformCallback">
                                                            <ClientSideEvents SelectionChanged="function(s, e) { OnGridSelectionChangedGroupAssign(2); }" />
                                                            <%--<Images ImageFolder="~/App_Themes/Office2003Blue/GridView/">
                                                    <CollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                        Width="11px" />
                                                    <ExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                        Width="11px" />
                                                    <DetailCollapsedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvCollapsedButton.png"
                                                        Width="11px" />
                                                    <DetailExpandedButton Height="12px" Url="~/App_Themes/Office2003Blue/GridView/gvExpandedButton.png"
                                                        Width="11px" />
                                                </Images>--%>
                                                            <Styles CssFilePath="~/App_Themes/Office2003Blue/GridView/grid.css" AlternatingRow-Enabled="True"
                                                                CssPostfix="Office2003_Blue">
                                                                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                                </Header>
                                                                <LoadingPanel ImageSpacing="10px">
                                                                </LoadingPanel>
                                                                <PagerBottomPanel CssClass="PageFooter">
                                                                </PagerBottomPanel>
                                                                <PagerTopPanel CssClass="PageFooter">
                                                                </PagerTopPanel>
                                                            </Styles>
                                                            <SettingsPager PrevPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pPrev.gif"
                                                                PrevPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pPrevDisabled.gif"
                                                                NextPageButton-Image-UrlDisabled="../App_Themes/Office2003Blue/GridView/pNextDisabled.gif"
                                                                NextPageButton-Image-Url="../App_Themes/Office2003Blue/GridView/pNext.gif" AlwaysShowPager="true">
                                                            </SettingsPager>
                                                            <Columns>
                                                                <dxw:GridViewDataColumn FieldName="UserId" Caption="AutoID" VisibleIndex="0" Visible="false">
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="1" Width="50px">
                                                                    <HeaderTemplate>
                                                                        <input type="checkbox" onclick="gvAssignedUsers.SelectAllRowsOnPage(this.checked);"
                                                                            style="vertical-align: middle;" title="Select/Unselect all rows on the page"
                                                                            tabindex="5"></input>
                                                                    </HeaderTemplate>
                                                                    <HeaderStyle Paddings-PaddingTop="1" Paddings-PaddingBottom="1" HorizontalAlign="Center" />
                                                                </dxw:GridViewCommandColumn>
                                                                <dxw:GridViewDataColumn FieldName="DriverName" Caption="Driver Name" VisibleIndex="2"
                                                                    Width="200px">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="../images/icn-driver-name.gif" align="top" alt="" /></span> <span class="label">
                                                                                <asp:Label ID="lblDriverName" runat="server">Driver Name</asp:Label></span>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="True" />
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn FieldName="DisplayName" Caption="Display Name" VisibleIndex="3"
                                                                    Visible="false">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="../images/icn-display-name.gif" align="top" alt="" /></span> <span class="label">
                                                                                <asp:Label ID="lblDisplayName" runat="server">Display Name</asp:Label>
                                                                            </span>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="True" />
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataColumn FieldName="GroupBelongsTo" Caption="Group" VisibleIndex="4"
                                                                    Width="200px">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="..\Images\groupnew-icon.gif" align="top" alt="" /></span> <span class="label">
                                                                                <asp:Label ID="lblGroup" runat="server">Group</asp:Label></span>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="False" />
                                                                </dxw:GridViewDataColumn>
                                                                <dxw:GridViewDataTextColumn FieldName="ActiveStatus" Caption="Active Status" VisibleIndex="5"
                                                                    HeaderStyle-HorizontalAlign="Center" CellStyle-HorizontalAlign="Center" Width="125px">
                                                                    <HeaderCaptionTemplate>
                                                                        <span class="icon">
                                                                            <img src="..\Images\icn-active-status.gif" align="top" alt="" /></span> <span class="label">
                                                                                <asp:Label ID="lblActiveStatus" runat="server">Active Status</asp:Label></span>
                                                                    </HeaderCaptionTemplate>
                                                                    <Settings AllowAutoFilter="False" />
                                                                </dxw:GridViewDataTextColumn>
                                                            </Columns>
                                                            <Settings ShowFilterRow="true" ShowFilterRowMenu="True" />
                                                            <SettingsText EmptyDataRow=" No Assigned Drivers found" />
                                                        </dxw:ASPxGridView>
                                                    </div>
                                                </div>
                                                <div class="form-box">
                                                    <div class="row rowSpace">
                                                        <div class="col-sm-6 col-md-8"></div>
                                                        <div class="col-sm-6 col-md-4">
                                                            <div class="form-groupAlign pull-right">
                                                                <asp:LinkButton ID="btnUnassignDrivers" runat="server" CssClass="MultilingualBtn"
                                                                    OnClick="UnassignDrivers" TabIndex="7" OnClientClick="ShowPopUp();">
                                                                    <span runat="server" class="MultilingualBtnspan">
                                                                        <div class="UnassignUsers">
                                                                            <div id="Unassign" runat="server" class="MultilingualBtnTextAlign">
                                                                                UnAssign
                                                                            </div>
                                                                        </div>
                                                                    </span>
                                                                </asp:LinkButton>
                                                                <%--<asp:LinkButton ID="btnUnassignDrivers" runat="server" class="btn" OnClick="UnassignDrivers"
                                                                TabIndex="7" Width="75px"><span class="icon"><img src="../images/icn-unassigned-users.gif" alt="" /></span><span>Unassign</span></asp:LinkButton>--%>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </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>
                </ContentTemplate>
            </asp:UpdatePanel>
            <cc1:ModalPopupExtender ID="mpeProgressIndicator" runat="server" PopupControlID="pnlProgress"
                TargetControlID="btnTesting">
            </cc1:ModalPopupExtender>
            <asp:Button ID="btnTesting" Style="display: none;" runat="server" />
            <%-- <asp:UpdateProgress ID="uprDataLoading" runat="server" DynamicLayout="True" AssociatedUpdatePanelID="updVhDetails">
            <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>

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

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

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