Class StatisticsService

Class StatisticsService

Provides the statistic data for the dashboard.

StatisticsService implements StatisticsServiceInterface
Package: Statistics
Category: System
Located at Services/Core/Statistic/StatisticsService.inc.php

Methods summary

public __construct( CI_DB_query_builder $db, StatisticsService::$xtcPrice $xtcPrice )
public getUsersOnline( void ) : integer

Gets the amount of users who are currently online.

public getVisitorsStatisticsDataLastWeek( void ) : array

Get visitors data for the last week.

public getVisitorsStatisticsDataLastTwoWeeks( void ) : array

Get visitors data for the last two weeks.

public getVisitorsStatisticsDataLastMonth( void ) : array

Get visitors data for the last month.

public getVisitorsStatisticsDataLastThreeMonth( void ) : array

Get visitors data for the last three months.

public getVisitorsStatisticsDataLastSixMonth( void ) : array

Get visitors data for the last six months.

public getVisitorsStatisticsDataLastYear( void ) : array

Get visitors data for the last six months.

protected _getVisitorsFromDayIntervalHelper( integer $fromInterval ) : array

Helper function to fetch visitors data of a month time span.

protected _getVisitorsFromCurrentDayHelper( void ) : array

Helper function to fetch visitors data of the current month.

protected _getVisitorsFromMonthIntervalHelper( integer $fromInterval ) : array

Helper function to fetch visitors data of a month time span.

protected _getVisitorsFromCurrentMonthHelper( void ) : array

Helper function to fetch visitors data of the current month.

public getVisitorsToday( void ) : integer

Gets the amount of visitors of the current date.

public getVisitorsLastWeek( void ) : integer

Gets the amount of visitors of the last week

public getVisitorsLastTwoWeeks( void ) : integer

Gets the amount of visitors of the last two week

public getVisitorsLastMonth( void ) : integer

Gets the amount of visitors of the last month

public getVisitorsLastThreeMonths( void ) : integer

Gets the amount of visitors of the last three months

public getVisitorsLastSixMonths( void ) : integer

Gets the amount of visitors of the last six months

public getVisitorsLastYear( void ) : integer

Gets the amount of visitors of the last year

public getNewCustomersStatisticsDataLastWeek( void ) : array

Get new customer data of the last week.

public getNewCustomersStatisticsDataLastTwoWeeks( void ) : array

Get new customer data of the last two weeks.

public getNewCustomersStatisticsDataLastMonth( void ) : array

Get new customer data of the last month.

public getNewCustomersStatisticsDataLastThreeMonth( void ) : array

Get new customer data of the last three months.

public getNewCustomersStatisticsDataLastSixMonth( void ) : array

Get new customer data of the last six months.

public getNewCustomersStatisticsDataLastYear( void ) : array

Get new customer data of the last year.

protected _getNewCustomersFromDayIntervalHelper( integer $fromInterval ) : array

Helper function to fetch new customer data of a day time span.

protected _getNewCustomersFromCurrentDayHelper( void ) : array

Helper function to fetch new customer data of the current day.

protected _getNewCustomersFromMonthIntervalHelper( integer $fromInterval ) : array

Helper function to fetch new customer data of a month time span.

protected _getNewCustomersFromCurrentMonthHelper( void ) : array

Helper function to fetch new customer data of the current month.

public getNewCustomersToday( void ) : integer

Gets the amount of new customers of the current date

public getNewCustomersLastWeek( void ) : integer

Gets the amount of new customers of the last week

public getNewCustomersLastTwoWeeks( void ) : integer

Gets the amount of new customers of the last two week

public getNewCustomersLastMonth( void ) : integer

Gets the amount of new customers of the last month

public getNewCustomersLastThreeMonths( void ) : integer

Gets the amount of new customers of the last three months

public getNewCustomersLastSixMonths( void ) : integer

Gets the amount of new customers of the last six months

public getNewCustomersLastYear( void ) : integer

Gets the amount of new customers of the last year

public getOrdersStatisticsDataLastWeek( void ) : array

Get orders data for the last week.

public getOrdersStatisticsDataLastTwoWeek( void ) : array

Get orders data for the last two weeks.

public getOrdersStatisticsDataLastMonth( void ) : array

Get orders data for the last month.

public getOrderStatisticsDataLastThreeMonth( void ) : array

Get order data for the last three months.

public getOrderStatisticsDataLastSixMonth( void ) : array

Get order data for the last six months.

public getOrderStatisticsDataLastYear( void ) : array

Get order data for the last year.

protected _getOrdersFromDayIntervalHelper( integer $fromInterval ) : array

Helper function to fetch order data of a month time span.

protected _getOrdersFromCurrentDayHelper( void ) : array

Helper function to fetch order data of the current month.

protected _getOrdersFromMonthIntervalHelper( integer $fromInterval ) : array

Helper function to fetch order data of a month time span.

protected _getOrdersFromCurrentMonthHelper( void ) : array

Helper function to fetch order data of the current month.

public getOrdersCountToday( void ) : integer

Gets the orders count of today

public getOrdersCountLastWeek( void ) : integer

Gets the orders count of the last week

public getOrdersCountLastTwoWeeks( void ) : integer

Gets the orders count of the last two weeks

public getOrdersCountLastMonth( void ) : integer

Gets the orders count of the last month

public getOrdersCountLastThreeMonths( void ) : integer

Gets the orders count of the last three months

public getOrdersCountLastSixMonths( void ) : integer

Gets the orders count of the last six months

public getOrdersCountLastYear( void ) : integer

Gets the orders count of the last year

public getConversionRateToday( void ) : string

Gets the conversion rate of today as a formatted number (i.e.: 0,27)

public getConversionRateLastWeek( void ) : string

Gets the conversion rate of the last week as a formatted number (i.e.: 0,27)

public getConversionRateLastTwoWeeks( void ) : string

Gets the conversion rate of the last two weeks as a formatted number (i.e.: 0,27)

public getConversionRateLastMonth( void ) : string

Gets the conversion rate of the last month as a formatted number (i.e.: 0,27)

public getConversionRateLastThreeMonths( void ) : string

Gets the conversion rate of the last three months as a formatted number (i.e.: 0,27)

public getConversionRateLastSixMonths( void ) : string

Gets the conversion rate of the last six months as a formatted number (i.e.: 0,27)

public getConversionRateLastYear( void ) : string

Gets the conversion rate of the last year as a formatted number (i.e.: 0,27)

protected _calculateConversionRate( integer $p_ordersCount, integer $p_visitorsCount ) : float

Calculates the conversion rate

protected _getConversionRate( integer $p_ordersCount, integer $p_visitorsCount ) : string

Returns the conversion rate as a formatted number (i.e.: 0,27)

public getSalesToday( void ) : string

Gets the amount of sales of the current date

public getSalesLastWeek( void ) : string

Gets the amount of sales of the last week

public getSalesLastTwoWeeks( void ) : string

Gets the amount of sales of the last two week

public getSalesLastMonth( void ) : string

Gets the amount of sales of the last month

public getSalesLastThreeMonths( void ) : string

Gets the amount of sales of the last three months

public getSalesLastSixMonths( void ) : string

Gets the amount of sales of the last six months

public getSalesLastYear( void ) : string

Gets the amount of sales of the last year

public getSalesStatisticsDataLastWeek( void ) : array

Get sales data for the last week.

public getSalesStatisticsDataLastTwoWeeks( void ) : array

Get sales data for the last two weeks.

public getSalesStatisticsDataLastMonth( void ) : array

Get sales data for the last month.

public getSalesStatisticsDataLastThreeMonth( void ) : array

Get sales data for the last three month.

public getSalesStatisticsDataLastSixMonth( void ) : array

Get sales data for the last six month.

public getSalesStatisticsDataLastYear( void ) : array

Get sales data for the last year.

protected _getSalesFromDayIntervalHelper( integer $fromInterval ) : array

Helper function to fetch sales data of a day time span.

protected _getSalesFromCurrentDayHelper( void ) : array

Helper function to fetch sales data of the current day.

protected _getSalesFromMonthIntervalHelper( integer $fromInterval ) : array

Helper function to fetch sales data of a month time span.

protected _getSalesFromCurrentMonthHelper( void ) : array

Helper function to fetch sales data of the current month.

protected _getSalesToday( void ) : float

Get Sales Today

protected _getSalesLastWeek( void ) : float

Get Sales Last Week

protected _getSalesLastTwoWeeks( void ) : float

Get Sales Last Two Weeks

protected _getSalesLastMonth( void ) : float

Get Sales Last Month

protected _getSalesLastThreeMonths( void ) : float

Get Sales Last Three Months

protected _getSalesLastSixMonths( void ) : float

Get Sales Last Six Months

protected _getSalesLastYear( void ) : float

Get Sales Last Year

public getAverageOrderValueToday( void ) : string

Gets the average order value of today as a formatted price (i.e.: 1.234,56 EUR).

public getAverageOrderValueLastWeek( void ) : string

Gets the average order value of the last week as a formatted price (i.e.: 1.234,56 EUR).

public getAverageOrderValueLastTwoWeeks( void ) : string

Gets the average order value of the last two weeks as a formatted price (i.e.: 1.234,56 EUR).

public getAverageOrderValueLastMonth( void ) : string

Gets the average order value of the last month as a formatted price (i.e.: 1.234,56 EUR).

public getAverageOrderValueLastThreeMonths( void ) : string

Gets the average order value of the last three months as a formatted price (i.e.: 1.234,56 EUR).

public getAverageOrderValueLastSixMonths( void ) : string

Gets the average order value of the last six months as a formatted price (i.e.: 1.234,56 EUR).

public getAverageOrderValueLastYear( void ) : string

Gets the average order value of the last year as a formatted price (i.e.: 1.234,56 EUR).

protected _calculateAverageOrderValue( float $p_sales, integer $p_ordersCount ) : float

Calculates the average order value.

protected _getAverageOrderValue( float $p_sales, integer $p_ordersCount ) : string

Returns the conversion rate as a formatted number (i.e.: 0,27).

Properties summary

protected $db : CI_DB_query_builder

		
protected $conversionRateDecimalPlaces : integer
2
protected $excludeOrderStatusIds : array
array(99)