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



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

<%@ Register TagPrefix="cc1" Namespace="System.Web.UI" Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" %>
<asp:Content ID="Content5" ContentPlaceHolderID="CPH_Content" runat="Server">

    <div class="col-xs-12">
        <div class="card">
            <div class="body">

                <ajax:TabContainer ID="TC_PriceReport" runat="server" OnClientActiveTabChanged="loadTabPanel">

                    <ajax:TabPanel ID="Tab_TenantPriceReport" runat="server" HeaderText="<%$ Resources:Content,strTenantPriceReport %>">

                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent0" runat="server">
                                <asp:Panel ID="Pnl_Listing" runat="server" DefaultButton="Btn_ApplyFilter_Tenant">
                                    <%--Operations Box--%>
                                    <div class="row">
                                        <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_ExportTenantReportToExcel" class="btn btn-primary waves-effect" runat="server"
                                                            Text='<%$ Resources:Content,Ex001 %>' />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <%--Search box--%>
                                    <asp:Panel ID="Pnl_Filters" runat="server" CssClass="row" DefaultButton="Btn_ApplyFilter_Tenant">
                                        <div class="panel-group search-panel" id="SPH_TenantReport" role="tablist" aria-multiselectable="true">
                                            <div class="col-xs-12" role="tab" id="SPT_TenantReport">
                                                <div class="card">
                                                    <div class="header" role="button" data-toggle="collapse" data-parent="#SPH_TenantReport" href="#<%= SPB_TenantReport.ClientID%>" aria-expanded="true" aria-controls="SPT_TenantReport">
                                                        <h3>
                                                            <%= Resources.Content.GN0000395%>
                                                        </h3>
                                                    </div>
                                                    <div id="SPB_TenantReport" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_O365Accounts" aria-expanded="false">
                                                        <div class="row">

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="TD_CSPProfiles" runat="server">
                                                                <div class="form-group form-float">
                                                                    <asp:DropDownList ID="Ddl_TenantCSPProfiles" 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_Tenants" 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_Search_Tenant_Offer" runat="server" MaxLength="100"></asp:TextBox>
                                                                        <asp:Label ID="Ltrl_Search_Offer" class="form-label" runat="server" Text="<%$ Resources:Content,strOfferName %>"></asp:Label>
                                                                    </div>

                                                                </div>
                                                            </div>
                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <asp:Button ID="Btn_ApplyFilter_Tenant" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000391%>" />
                                                                    <asp:Button ID="Btn_ClearFilter_Tenant" Visible="false" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,String289 %>" />

                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>

                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:GridView ID="GV_TenantOffersReport" CssClass="table table-bordered table-striped table-hover" AllowSorting="true" AllowPaging="true"
                                                EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <%--Tenant Name, Offer name, Offer Id, Status, Price--%>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-2" HeaderText="<%$ Resources:Content,strTenant %>" SortExpression="TenantName">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="HL_Tenant" runat="server" NavigateUrl='<%# String.Format("/RCC/O365/O365Sub.aspx?SubId={0}", Eval("ServiceHostingID"))  %>' Text='<%# Eval("TenantName") %>'></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-3" HeaderText="<%$ Resources:Content,strOfferAddons %>" SortExpression="CustomOfferName">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_Offer" runat="server" Text='<%# Eval("CustomOfferName") %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-4" HeaderText="<%$ Resources:Content,strOfferID %>" SortExpression="MSOfferId">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_OfferId" runat="server" Text='<%# Eval("MSOfferId") %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-1" HeaderText="<%$ Resources:Content,Status %>" SortExpression="MSStatus">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_Status" runat="server" Text='<%# GetOfferStatusString(Eval("MSStatus")) %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-2" HeaderText="<%$ Resources:Content,StrPrice %>" SortExpression="UnitPrice">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_Price" runat="server" Text='<%# String.Format("{0} {1} / {2}", Eval("CurrencySymbol"), Eval("DiscountedPrice"), Eval("CycleName")) %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <%--PagerTemplate Start--%>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager1" runat="server" />
                                                </PagerTemplate>
                                                <%--PagerTemplate End--%>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </asp:Panel>
                        </ContentTemplate>
                    </ajax:TabPanel>
                
                    
                    <ajax:TabPanel ID="Tab_PackagePriceReport" runat="server" HeaderText="<%$ Resources:Content,strPackagePriceReport %>">

                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent1" runat="server" visible="false">
                                <asp:Panel ID="Panel1" runat="server" DefaultButton="Btn_ApplyFilter_Package">
                                    <%--Operations Box--%>
                                    <div class="row">
                                        <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_ExportPackageReportToExcel" class="btn btn-primary waves-effect" runat="server"
                                                            Text='<%$ Resources:Content,Ex001 %>' />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <%--Search box--%>
                                    <asp:Panel ID="Pnl_Filters_Package" runat="server" CssClass="row" DefaultButton="Btn_ApplyFilter_Package">
                                        <div class="panel-group search-panel" id="SPH_PackageReport" role="tablist" aria-multiselectable="true">
                                            <div class="col-xs-12" role="tab" id="SPT_PackageReport">
                                                <div class="card">
                                                    <div class="header" role="button" data-toggle="collapse" data-parent="#SPH_PackageReport" href="#<%= SPB_PackageReport.ClientID%>" aria-expanded="true" aria-controls="SPT_PackageReport">
                                                        <h3>
                                                            <%= Resources.Content.GN0000395%>
                                                        </h3>
                                                    </div>
                                                    <div id="SPB_PackageReport" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_O365Accounts" aria-expanded="false">
                                                        <div class="row">

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="TD_PackageCSPProfiles" runat="server">
                                                                <div class="form-group form-float">
                                                                    <asp:DropDownList ID="Ddl_PackageCSPProfiles" runat="server">
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="TD_SearchPacakges" runat="server">
                                                                <div class="form-group form-float">
                                                                    <asp:DropDownList ID="DDL_Packages" 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_Search_Package_Offer" runat="server" MaxLength="100"></asp:TextBox>
                                                                        <asp:Label ID="Label1" class="form-label" runat="server" Text="<%$ Resources:Content,strOfferName %>"></asp:Label>
                                                                    </div>

                                                                </div>
                                                            </div>
                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <asp:Button ID="Btn_ApplyFilter_Package" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN0000391%>" />
                                                                    <asp:Button ID="Btn_ClearFilter_Package" Visible="false" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,String289 %>" />

                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>

                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:GridView ID="GV_PackageOffersReport" CssClass="table table-bordered table-striped table-hover" AllowSorting="true" AllowPaging="true"
                                                EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server" AutoGenerateColumns="False">
                                                <Columns>
                                                    <%--Package Name, Offer name, Offer Id, Status, Price--%>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-2" HeaderText="<%$ Resources:Content,PackageName %>" SortExpression="PackageName">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="HL_Package" runat="server" Text='<%# Eval("PackageName") %>' NavigateUrl='<%# GetPacakgeEditUrl(Eval("PackageId"),Eval("ResellerPackage")) %>' Enabled='<%# Not (IsLoggedInAsReseller AndAlso IsCommissionReseller) %>'></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-3" HeaderText="<%$ Resources:Content,strOfferAddons %>" SortExpression="CustomOfferName">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_Offer" runat="server" Text='<%# Eval("CustomOfferName") %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-4" HeaderText="<%$ Resources:Content,strOfferID %>" SortExpression="MSOfferId">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_OfferId" runat="server" Text='<%# Eval("MSOfferId") %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-2" HeaderText="<%$ Resources:Content,Lync318 %>" SortExpression="UnitCost">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_Price" runat="server" Text='<%# String.Format("{0} {1} / {2}", Eval("CurrencySymbol"), Eval("UnitCost"), Eval("CycleName")) %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderStyle-CssClass="col-xs-2" HeaderText="<%$ Resources:Content,StrPrice %>" SortExpression="UnitPrice">
                                                        <ItemTemplate>
                                                            <asp:Literal ID="Ltrl_Price" runat="server" Text='<%# String.Format("{0} {1} / {2}", Eval("CurrencySymbol"), Eval("UnitPrice"), Eval("CycleName")) %>'></asp:Literal>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <%--PagerTemplate Start--%>
                                                <PagerTemplate>
                                                    <UC:Pager ID="Pager1" runat="server" />
                                                </PagerTemplate>
                                                <%--PagerTemplate End--%>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </asp:Panel>
                        </ContentTemplate>
                    </ajax:TabPanel>
                

                </ajax:TabContainer>

            </div>
        </div>
    </div>
</asp:Content>

