<%@ control language="VB" autoeventwireup="false" inherits="RCC_O365_CC_GroupActions, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>

<%--Search Option--%>


<div class="row Div_OpsRow" id="Div_OpsRow" runat="server">
    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h3>
                    <%= Resources.Content.GN00001320%>                                                                                                                                 
                </h3>
            </div>
            <div class="body">
                <div class="clearfix">
                    <asp:Button ID="Btn_ResetTriesCount" runat="server" Text="<%$ Resources:Content,ResetTriesCount%>" class="btn btn-primary waves-effect btnAction" /> 
                    <asp:Button ID="Btn_RemoveCompletedCancelledJobs" runat="server" Text="<%$ Resources:Content,clearJobs%>" class="btn btn-primary waves-effect btnAction" />
                    <asp:Button ID="btnCancelSelected" runat="server" Text="<%$ Resources:Content,AB0006%>"
                                                    class="btn btn-primary waves-effect btnAction" Custom1="Custom" Style="display: none" />
                </div>
            </div>
        </div>
    </div>
</div>

<asp:Panel ID="Pnl_Filter" runat="server" DefaultButton="Btn_Search">
    <div class="panel-group search-panel" id="AS_Search" role="tablist" aria-multiselectable="true">
        <div class="card">

            <div class="header" role="button" data-toggle="collapse" data-parent="#AS_Search" href="#<%= CSB_Search.ClientID%>" aria-expanded="true" aria-controls="SH_Search">
                <h3>
                    <%= Resources.Content.GN0000395%>
                </h3>
            </div>
            <div id="CSB_Search" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_Search" aria-expanded="false">

                <div class="row">

                    <div class="col-md-3 col-sm-6 col-xs-12" id="td_ddlOwner" runat="server">
                        <div class="form-group form-float">
                            <asp:DropDownList ID="DDL_Owner" runat="server" onchange="setOwnerCookie(this)" />
                        </div>
                    </div>

                    <div class="col-md-3 col-sm-6 col-xs-12">
                        <div class="form-group form-float">
                            <%--<asp:Label ID="Label2" runat="server" EnableViewState="false" Text="Action Type"></asp:Label>--%>
                            <asp:DropDownList ID="DDL_ActionType" runat="server" />
                        </div>
                    </div>

                    <div class="col-md-3 col-sm-6 col-xs-12">
                        <div class="form-group form-float">
                            <asp:DropDownList ID="DDL_Status" runat="server" />
                            <%--<asp:Label ID="Label5" runat="server" EnableViewState="false" Text="<%$ Resources:Content,String385%>"></asp:Label>--%>
                        </div>
                    </div>

                    <div class="col-md-3 col-sm-6 col-xs-12" id="Td_ClientId" runat="server">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <asp:TextBox ID="TxBx_ClientId" runat="server"></asp:TextBox>
                                <asp:Label ID="Label1" runat="server" class="form-label" EnableViewState="false" Text="<%$ Resources:Content,GN0000715%>"></asp:Label>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-3 col-sm-6 col-xs-12">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <asp:TextBox ID="TxBx_Text" runat="server"></asp:TextBox>
                                <asp:Label ID="Label4" runat="server" CssClass="form-label" EnableViewState="false" Text="<%$ Resources:Content,Parameters%>"></asp:Label>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group form-float">
                            <asp:Button ID="Btn_Search" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000391%>" CausesValidation="false" />&nbsp;
                                    <asp:Button ID="Btn_ClearSearch" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,String289%>" CausesValidation="false" Visible="false" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Panel>


<div class="row">
    <div class="col-xs-12">

        <asp:GridView CssClass="table table-bordered table-striped table-hover" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
            ID="GV_GroupActions" AllowPaging="True" AllowSorting="true" runat="server" AutoGenerateColumns="false">
            <Columns>
                <asp:TemplateField HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1" HeaderText='<%$ Resources:Content,GN0000370 %>'>
                    <HeaderTemplate>
                        <asp:CheckBox class="option-menu" ID="ChkBx_All" runat="server" Text=" " onclick="SetCheckedHeader(this.checked, this,'All');" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HiddenField ID="HF_JobId" runat="server" />
                        <asp:CheckBox class="option-menu" ID="ChkBx_Item" runat="server" Text=" " onclick="SetCheckedHeader(this.checked, this,'1');" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText='<%$ Resources:Content,String385%>' HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                    <ItemTemplate>
                        <asp:LinkButton ID="LB_Status" CommandName="statusload" runat="server"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText='<%$ Resources:Content,DGN1110209%>' HeaderStyle-CssClass="col-xs-2 break-word-all" ItemStyle-CssClass="col-xs-2 break-word-all">
                    <ItemTemplate>
                        <div id="Div_Command" runat="server">
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField SortExpression="TimeStampEntered"
                    HeaderText='<%$ Resources:Content,DGN1110210%>' HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                    <ItemTemplate>
                        <div id="Div_TimeCreated" runat="server">
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField SortExpression="TriesCount" HeaderText="<%$ Resources:Content,GN0000813%>"
                    HeaderStyle-CssClass="col-xs-1 hidden-xs" ItemStyle-CssClass="col-xs-1 hidden-xs">
                    <ItemTemplate>
                        <div id="Div_Tries" runat="server"></div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField SortExpression="LastTryTimeStamp"
                    HeaderText="<%$ Resources:Content,DGN1110212%>" HeaderStyle-CssClass="col-xs-1 hidden-xs" ItemStyle-CssClass="col-xs-1 hidden-xs">
                    <ItemTemplate>
                        <div id="Div_LastTry" runat="server">
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText='<%$ Resources:Content,FAM00133%>'
                    HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                    <ItemTemplate>
                        <asp:Label ID="Lb_EntityType" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField SortExpression="CustomerId" HeaderText='<%$ Resources:Content,GN0000850%>'
                    HeaderStyle-CssClass="col-xs-1 hidden-xs break-word-all" ItemStyle-CssClass="col-xs-1 hidden-xs break-word-all">
                    <ItemTemplate>
                        <asp:HyperLink ID="LB_ClientID" runat="server" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tooltip on top"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField SortExpression="OwnerName" HeaderText='<%$ Resources:Content,SPT002811%>'
                    HeaderStyle-CssClass="col-xs-1 hidden-xs break-word-all" ItemStyle-CssClass="col-xs-1 hidden-xs break-word-all">
                    <ItemTemplate>
                        <asp:HyperLink ID="Lb_Owner" runat="server" CommandName="Owner"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText='<%$ Resources:Content,GN0000839%>'
                    HeaderStyle-CssClass="col-xs-1 break-word-all" ItemStyle-CssClass="col-xs-1 break-word-all">
                    <ItemTemplate>
                        <asp:Label ID="Lbl_AddedBy" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000275%>" HeaderStyle-CssClass="col-xs-1" ItemStyle-CssClass="col-xs-1">
                    <ItemTemplate>
                        <asp:LinkButton class="btn btn-primary waves-effect btnAction" ID="LB_Run" runat="server" Text='<%$ Resources:Content,DGN1110045%>'></asp:LinkButton>
                        <asp:LinkButton class="btn btn-primary waves-effect btnAction" ID="LB_Cancel" runat="server" CommandName="CancelJob" Text='<%$ Resources:Content,GN0000572%>'></asp:LinkButton>
                        <asp:LinkButton class="btn btn-primary waves-effect" ID="LB_JobDetail" runat="server" CommandName="JobDetail" Text='<%$ Resources:Content,Detail%>'></asp:LinkButton>
                        <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,FAM00185%>"
                            TargetControlID="LB_Cancel" runat="server">
                        </EM:ConfirmButtonExtender>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerTemplate>
                <EM:Pager ID="Pager1" runat="server" />
            </PagerTemplate>
        </asp:GridView>

    </div>
</div>

<asp:Button ID="Btn_QDummy" runat="server" Style="display: none" Text='<%$ Resources:Content,GN0000575%>' />
<asp:Panel ID="Pnl_QDetail" CssClass="width-modal-popup-auto" Style="display: none;" runat="server">

    <div class="col-xs-12">
        <div class="card">
            <div class="header container-fluid">
                <span>
                    <button type="button" class="close" onclick="$find('<%=MPE_Acc.ClientID%>').hide();">&times;</button>
                </span>
            </div>
            <div class="body">
                <div class="row">
                    <div class="col-xs-12">
                        <asp:GridView ID="GV_QLogs" runat="server" CssClass="table table-hover table-listing table-responsive table-bordered" AutoGenerateColumns="false"
                            EmptyDataText="<%$ Resources:Content,GN00001375%>">
                            <Columns>
                                <asp:TemplateField HeaderText='<%$ Resources:Content,Dev676%>' HeaderStyle-CssClass="col-xs-3">
                                    <ItemTemplate>
                                        <%--<div style="padding-top: 10px; padding-left: 10px; width: 600px; display: block">--%>
                                        <asp:Label ID="Ltrl_try" runat="server" Text="<%$ Resources:Content,SMI0372%>" CssClass="font-color-00D5FF" />
                                        <asp:Label runat="server" ID="LblTries" Text='<%# Convert.ToInt32(DataBinder.Eval(Container, "DataItemIndex")) + 1 %>'
                                            ForeColor="#00D5FF">
                                        </asp:Label>
                                        &nbsp;
                        <asp:Label ID="Ltrl_date" runat="server" Text="<%$ Resources:Content,SMI0373%>" CssClass="font-color-00D5FF" />
                                        <asp:Label runat="server" ID="LblDate" ForeColor="#00D5FF"></asp:Label>
                                        <%--Text='<%# DataBinder.Eval(Container,"TimeStamp") %>'--%>
                                        <%--</div>--%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText='<%$ Resources:Content,Dev675%>' HeaderStyle-CssClass="col-xs-9">
                                    <ItemTemplate>
                                        <div runat="server" id="AccordianMesg">
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>

                        </asp:GridView>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-12">
                        <asp:Button class="btn btn-primary waves-effect" ID="BtnAccClose" runat="server" Text='<%$ Resources:Content,GN000150%>' />
                    </div>
                </div>
            </div>
        </div>
    </div>

</asp:Panel>
<EM:ModalPopupExtender runat="server" ID="MPE_Acc" BackgroundCssClass="modalBackground"
    DropShadow="false" CancelControlID="BtnAccClose" PopupControlID="Pnl_QDetail"
    TargetControlID="Btn_QDummy" />


<asp:Button ID="Btn_JDDummy" runat="server" Style="display: none" Text='<%$ Resources:Content,JobDetails%>' />
<asp:Panel ID="Pnl_JobDetail" CssClass="width-modal-popup-auto" Style="display: none;" runat="server">

    <div class="col-xs-12">
        <div class="card">
            <div class="header container-fluid">
                <span>
                    <button type="button" class="close" onclick="$find('<%=MPE_JD.ClientID%>').hide();">&times;</button>
                </span>
            </div>
            <div class="body">
                <div class="row">
                    <div class="col-xs-2 col-xs-12">
                        <b><asp:Label ID="Lbl_JobLabel" runat="server" Text='<%$ Resources:Content,JobDetails%>'></asp:Label>:</b>
                    </div>
                    <div class="col-xs-10 col-xs-12">
                        <pre><div ID="Lbl_JobDetail" runat="server" ></div></pre>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <asp:Button class="btn btn-primary waves-effect" ID="Btn_CloseJobDetail" runat="server" Text='<%$ Resources:Content,GN000150%>' />
                    </div>
                </div>
            </div>
        </div>
    </div>

</asp:Panel>
<EM:ModalPopupExtender runat="server" ID="MPE_JD" BackgroundCssClass="modalBackground"
    DropShadow="false" CancelControlID="Btn_CloseJobDetail" PopupControlID="Pnl_JobDetail"
    TargetControlID="Btn_JDDummy" />