Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

BestCustomersByNumberOfOrders.cshtml

@model CustomerReportsSearchModel
@using Nop.Services.Orders;

@{
    //page title
    ViewBag.PageTitle = T("Admin.Reports.Customers.BestBy.BestByNumberOfOrders").Text;
    //active menu item (system name)
    NopHtml.SetActiveMenuItemSystemName("Customers by number of orders");
}

@{
    const string hideSearchBlockAttributeName = "CustomersBestByNumberOfOrdersPage.HideSearchBlock";
    var hideSearchBlock = await genericAttributeService.GetAttributeAsync<bool>(await workContext.GetCurrentCustomerAsync(), hideSearchBlockAttributeName);
}

<div class="content-header clearfix">
    <h1 class="float-left">
        @T("Admin.Reports.Customers.BestBy.BestByNumberOfOrders")
    </h1>
</div>

<section class="content">
    <div class="container-fluid">
    <div class="form-horizontal">
        <div class="cards-group">
            <div class="card card-default card-search">
                <div class="card-body">
                    <div class="row search-row @(!hideSearchBlock ? "opened" : "")" data-hideAttribute="@hideSearchBlockAttributeName">
                        <div class="search-text">@T("Admin.Common.Search")</div>
                        <div class="icon-search"><i class="fas fa-magnifying-glass" aria-hidden="true"></i></div>
                        <div class="icon-collapse"><i class="far fa-angle-@(!hideSearchBlock ? "up" : "down")" aria-hidden="true"></i></div>
                    </div>

                    <div class="search-body @(hideSearchBlock ? "closed" : "")">

                        <div class="row">
                            <div class="col-md-5">
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByNumberOfOrders.StartDate" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-editor asp-for="BestCustomersByNumberOfOrders.StartDate" />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByNumberOfOrders.EndDate" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-editor asp-for="BestCustomersByNumberOfOrders.EndDate" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-7">
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByNumberOfOrders.OrderStatusId" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-select asp-for="BestCustomersByNumberOfOrders.OrderStatusId" asp-items="Model.BestCustomersByNumberOfOrders.AvailableOrderStatuses" />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByNumberOfOrders.PaymentStatusId" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-select asp-for="BestCustomersByNumberOfOrders.PaymentStatusId" asp-items="Model.BestCustomersByNumberOfOrders.AvailablePaymentStatuses" />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-md-4">
                                        <nop-label asp-for="BestCustomersByNumberOfOrders.ShippingStatusId" />
                                    </div>
                                    <div class="col-md-8">
                                        <nop-select asp-for="BestCustomersByNumberOfOrders.ShippingStatusId" asp-items="Model.BestCustomersByNumberOfOrders.AvailableShippingStatuses" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="text-center col-12">
                                <button type="button" id="search-best-customers-numberoforders-grid" class="btn btn-primary btn-search">
                                    <i class="fas fa-chart-line"></i>
                                    @T("Admin.Reports.Customers.RunReport")
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="card card-default">
                <div class="card-body">
                    <nop-doc-reference asp-string-resource="@T("Admin.Documentation.Reference.Reports", Docs.Reports + Utm.OnAdmin)" />

                    @await Html.PartialAsync("Table", new DataTablesModel
                    {
                        Name = "best-customers-numberoforders-grid",
                        UrlRead = new DataUrl("ReportBestCustomersByNumberOfOrdersList", "Report", null),
                        SearchButtonId = "search-best-customers-numberoforders-grid",
                        Length = Model.BestCustomersByNumberOfOrders.PageSize,
                        LengthMenu = Model.BestCustomersByNumberOfOrders.AvailablePageSizes,
                        Filters = new List<FilterParameter>
                        {
                            new FilterParameter(nameof(Model.BestCustomersByNumberOfOrders.OrderBy), (int)OrderByEnum.OrderByQuantity),
                            new FilterParameter(nameof(Model.BestCustomersByNumberOfOrders.StartDate), nameof(CustomerReportsSearchModel.BestCustomersByNumberOfOrders)),
                            new FilterParameter(nameof(Model.BestCustomersByNumberOfOrders.EndDate), nameof(CustomerReportsSearchModel.BestCustomersByNumberOfOrders)),
                            new FilterParameter(nameof(Model.BestCustomersByNumberOfOrders.OrderStatusId), nameof(CustomerReportsSearchModel.BestCustomersByNumberOfOrders)),
                            new FilterParameter(nameof(Model.BestCustomersByNumberOfOrders.PaymentStatusId), nameof(CustomerReportsSearchModel.BestCustomersByNumberOfOrders)),
                            new FilterParameter(nameof(Model.BestCustomersByNumberOfOrders.ShippingStatusId), nameof(CustomerReportsSearchModel.BestCustomersByNumberOfOrders))
                        },
                        ColumnCollection = new List<ColumnProperty>
                        {
                            new ColumnProperty(nameof(BestCustomersReportModel.CustomerName))
                            {
                                Title = T("Admin.Reports.Customers.BestBy.Fields.Customer").Text
                            },
                            new ColumnProperty(nameof(BestCustomersReportModel.OrderTotal))
                            {
                                Title = T("Admin.Reports.Customers.BestBy.Fields.OrderTotal").Text
                            },
                            new ColumnProperty(nameof(BestCustomersReportModel.OrderCount))
                            {
                                Title = T("Admin.Reports.Customers.BestBy.Fields.OrderCount").Text
                            },
                            new ColumnProperty(nameof(BestCustomersReportModel.CustomerId))
                            {
                                Title = T("Admin.Common.View").Text,
                                Width = "100",
                                ClassName =  NopColumnClassDefaults.Button,
                                Render = new RenderButtonView(new DataUrl("~/Admin/Customer/Edit/"))
                            }
                        }
                    })
                </div>
            </div>
        </div>
    </div>
</div>
</section>