}
function commerce_statistics_referer_sort_orders_asc($a, $b)
{
    return commerce_statistics_referer_sort($a, $b, 'orders', 1);
}
function commerce_statistics_referer_sort_units_desc($a, $b)
{
    return commerce_statistics_referer_sort($a, $b, 'units');
}
function commerce_statistics_referer_sort_units_asc($a, $b)
{
    return commerce_statistics_referer_sort($a, $b, 'units', 1);
}
function commerce_statistics_referer_sort_customers_desc($a, $b)
{
    return commerce_statistics_referer_sort($a, $b, 'customers');
}
function commerce_statistics_referer_sort_customers_asc($a, $b)
{
    return commerce_statistics_referer_sort($a, $b, 'customers', 1);
}
function commerce_statistics_referer_sort($a, $b, $pSort = 'revenue', $pDirection = '-1')
{
    if ($a[$pSort] == $b[$pSort]) {
        return 0;
    }
    return $a[$pSort] < $b[$pSort] ? $pDirection * -1 : $pDirection * 1;
}
// }}}
CommerceStatistics::loadSingleton();