<%@ page title="" language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="RCC_O365_MonthlyResellerReport, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="System.Web.UI" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Content" 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_ExportToExcel" class="btn btn-primary waves-effect" runat="server"
                        Text='<%$ Resources:Content,Ex001 %>' />
                </div>
            </div>
        </div>
    </div>
    <br />
    <asp:Panel ID="Pnl_Filter" runat="server" CssClass="col-xs-12" DefaultButton="Btn_Filter">
        <div class="row">
            <div class="panel-group search-panel" id="AS_SearchFilter" role="tablist" aria-multiselectable="true">
                <div class="col-xs-12" role="tab" id="SH_SearchFilter">
                    <div class="card">
                        <div class="header" role="button" data-toggle="collapse" data-parent="#AS_SearchFilter" href="#<%= CSB_SearchFilter.ClientID%>" aria-expanded="true" aria-controls="SH_SearchFilter">
                            <h3>
                                <%= Resources.Content.GN0000395%>
                            </h3>
                        </div>
                        <div id="CSB_SearchFilter" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_SearchFilter" aria-expanded="false">

                            <div class="row">
                                <div class="col-md-3 col-sm-6 col-xs-12" id="td_DDL_Owner" runat="server">
                                    <div class="form-group form-float">
                                        <asp:DropDownList ID="DDL_Owner" runat="server" onchange="setOwnerCookie(this)"></asp:DropDownList>
                                    </div>
                                </div>
                                <div class="col-md-3 col-sm-6 col-xs-12">
                                    <div class="form-group form-float">
                                        <asp:DropDownList ID="DDL_MonthFilter" runat="server"></asp:DropDownList>
                                    </div>
                                </div>
                                <div class="col-md-3 col-sm-6 col-xs-12">
                                    <div class="form-group form-float">
                                        <asp:DropDownList ID="DDL_YearFilter" runat="server"></asp:DropDownList>
                                    </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_TenantName" MaxLength="200" runat="server"></asp:TextBox>
                                            <asp:Label ID="Ltrl_TenantName" runat="server" class="form-label" Text='<%$ Resources:Content,TenantName %>'></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_CustomerId" MaxLength="255" runat="server"></asp:TextBox>
                                            <asp:Label ID="Label1" runat="server" class="form-label" 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_CustomerName" MaxLength="255" runat="server"></asp:TextBox>
                                            <asp:Label ID="Ltrl_CustomerName" runat="server" class="form-label" Text="<%$ Resources:Content,GN0000268%>"></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_SubscriptionName" MaxLength="255" runat="server"></asp:TextBox>
                                            <asp:Label ID="Ltrl_DGN1110287" runat="server" class="form-label" Text='<%$ Resources:Content,DGN1110287%>'></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_MSOfferIdFilter" MaxLength="255" runat="server"></asp:TextBox>
                                            <asp:Label ID="Label2" runat="server" class="form-label" Text='<%$ Resources:Content,strMSOfferId%>'></asp:Label>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xs-12">
                                    <div class="form-group form-float">
                                        <asp:Button ID="Btn_Filter" class="btn btn-primary waves-effect" runat="server" Text='<%$ Resources:Content,GN0000395 %>' />
                                        <asp:Button ID="Btn_Clear" Visible="false" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,String289 %>" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <br />
    <br />
    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h2>
                    <%= Resources.Content.MonthlyResellerReport%>                                                                                                                                 
                </h2>
            </div>
            <div class="body">
                <EM:TabContainer ID="TbCntr_O365UsageReport" runat="server" OnClientActiveTabChanged="loadTabPanel">
                    <EM:TabPanel ID="Tab_ReportSummary" runat="server" HeaderText="<%$ Resources:Content,GN0000835%>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent0" runat="server">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <asp:GridView EmptyDataText='<%$ Resources:Content, GN00001375 %>' AllowSorting="true"
                                            ID="GV_ReportSummary" runat="server" CssClass="table table-bordered table-striped table-hover"
                                            AutoGenerateColumns="false" AllowPaging="true">
                                            <Columns>
                                                <asp:TemplateField HeaderText="<%$ Resources:Content,DGN1110287%>" HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5"
                                                    SortExpression="O365SubscriptionName" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Ltr_SubscriptionName" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2" HeaderStyle-HorizontalAlign="Center"
                                                    HeaderText='<%$ Resources:Content, LicenseQuantity %>'>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Ltr_LicenseQuantity" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText='<%$ Resources:Content, PriceforReseller %>'
                                                    HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Ltr_PriceforReseller" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="<%$ Resources:Content, GN000114 %>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Ltr_Total" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <%--PagerTemplate Start--%>
                                            <PagerTemplate>
                                                <EM:Pager ID="Pager1" runat="server" />
                                            </PagerTemplate>
                                            <%--PagerTemplate End--%>
                                        </asp:GridView>
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                    <EM:TabPanel ID="Tab_ReportDetails" runat="server" HeaderText="<%$ Resources:Content, strDetails%>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="clearfix">
                                            <div class="double-scroll-wrapper1">
                                                <div>
                                                </div>
                                            </div>
                                            <div class="double-scroll-wrapper2">
                                                <asp:GridView ID="GV_DetailReport" CssClass="table table-bordered table-striped table-hover table-layout-fixed"
                                                    AllowSorting="true" AllowPaging="true" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server"
                                                    AutoGenerateColumns="False" Style="Width:2400px;">

                                                    <Columns>
                                                        <asp:TemplateField SortExpression="CustomerName" HeaderText='<%$ Resources:Content,GN0000850%>'
                                                            HeaderStyle-Width="150px">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="LB_Customer" runat="server" Text='<%#Eval("CustomerID") & " " & Eval("CustomerName")%>' href='<%# ResolveUrl("~/RCC/Clients/ClientDetail.aspx?CID=" + Eval("CustomerId").ToString())%>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="CustomerCompany"
                                                            HeaderText='<%$ Resources:Content,GN00001077%>' HeaderStyle-Width="150px">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_CustCompanyName" runat="server" Text='<%#Eval("CustomerCompany")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="Owner" HeaderText='<%$ Resources:Content, SPT002811 %>'
                                                            HeaderStyle-Width="150px">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_Owner" runat="server" Text='<%#Eval("Owner")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="TenantName" HeaderText='<%$ Resources:Content, TenantName %>'
                                                            HeaderStyle-Width="150px">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="LB_Tenant" runat="server" Text='<%#Eval("TenantName")%>' href='<%# ResolveUrl("~/RCC/O365/TenantDetail.aspx?TId=" + Eval("TenantId").ToString())%>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="StartDate"
                                                            HeaderText='<%$ Resources:Content,GN00001547%>' HeaderStyle-Width="150px">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_StartDate" runat="server" Text='<%# Eval("StartDate")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="SuspendDate"
                                                            HeaderText='<%$ Resources:Content,strSuspendDate%>' HeaderStyle-Width="150px">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_SuspendDate" runat="server" Text='<%#Eval("SuspendDate")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="O365SubscriptionId"
                                                            HeaderText='<%$ Resources:Content, SubscriptionId %>' HeaderStyle-Width="250px">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="LB_O365SubscriptionId" runat="server" Text='<%#Eval("O365SubscriptionId")%>'
                                                                    href='<%# ResolveUrl("~/RCC/O365/O365Sub.aspx?SubId=" + Eval("ServiceHostingId").ToString())%>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="O365SubscriptionName"
                                                            HeaderText='<%$ Resources:Content, DGN1110287 %>' HeaderStyle-Width="250px">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="LB_SubscriptionName" runat="server" Text='<%#Eval("O365SubscriptionName")%>'
                                                                    href='<%# ResolveUrl("~/RCC/O365/O365Sub.aspx?SubId=" + Eval("ServiceHostingId").ToString())%>'></asp:HyperLink>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="MSOfferId"
                                                            HeaderText='<%$ Resources:Content, strMSOfferId %>' HeaderStyle-Width="250px">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_MSOfferId" runat="server" Text='<%#Eval("MSOfferId")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="Quantity"
                                                            HeaderText='<%$ Resources:Content, String35 %>' HeaderStyle-Width="100px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_Quantity" runat="server" Text='<%#Eval("Quantity")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="ProviderCost"
                                                            HeaderText='<%$ Resources:Content, ProviderCost %>' HeaderStyle-Width="150px" ItemStyle-HorizontalAlign="center">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_ProviderCost" runat="server" Text='<%# Eval("ProviderCost")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText='<%$ Resources:Content, ProviderTotal %>' 
                                                            HeaderStyle-Width="150px" ItemStyle-HorizontalAlign="center">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_ProviderTotal" runat="server"></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField SortExpression="ResellerCost"
                                                            HeaderText='<%$ Resources:Content, ResellerCost %>' HeaderStyle-Width="150px" ItemStyle-HorizontalAlign="center">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_ResellerCost" runat="server" Text='<%# Eval("ResellerCost")%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText='<%$ Resources:Content, ResellerTotal %>' 
                                                            HeaderStyle-Width="150px" ItemStyle-HorizontalAlign="center">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LB_ResellerTotal" runat="server"></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>                                                        
                                                    </Columns>
                                                    <%--PagerTemplate Start--%>
                                                    <PagerTemplate>
                                                        <EM:Pager ID="Pager2" runat="server" />
                                                    </PagerTemplate>
                                                    <%--PagerTemplate End--%>
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>
                </EM:TabContainer>
            </div>
        </div>
    </div>
</asp:Content>
