[*] BO #PSFV-94 : Added AdminStatsController && AdminStatsTabController && norm of statistic modules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10004 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre committed 2011-11-09 15:48:15 +00:00
1 parent 42bfc372da
commit dc716baa05
28 files changed
+980 -891

No files matched your search

@@ -38,7 +38,7 @@ class StatsBestVouchers extends ModuleGrid
private $_emptyMessage;
private $_pagingMessage;
function __construct()
public function __construct()
{
$this->name = 'statsbestvouchers';
$this->tab = 'analytics_stats';
@@ -83,7 +83,7 @@ class StatsBestVouchers extends ModuleGrid
public function install()
{
return (parent::install() AND $this->registerHook('AdminStatsModules'));
return (parent::install() && $this->registerHook('AdminStatsModules'));
}
public function hookAdminStatsModules($params)
@@ -97,12 +97,12 @@ class StatsBestVouchers extends ModuleGrid
'emptyMessage' => $this->_emptyMessage,
'pagingMessage' => $this->_pagingMessage
);
if (Tools::getValue('export'))
$this->csvExport($engineParams);
$this->_html = '
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
<fieldset><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
'.$this->engine($engineParams).'
<br /><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a>
</fieldset>';
@@ -110,7 +110,7 @@ class StatsBestVouchers extends ModuleGrid
}
public function getData()
{
{
$this->_query = 'SELECT SQL_CALC_FOUND_ROWS ocr.code, COUNT(ocr.id_cart_rule) as total, SUM(o.total_paid_real) / o.conversion_rate as ca
FROM '._DB_PREFIX_.'order_cart_rule ocr
LEFT JOIN '._DB_PREFIX_.'orders o ON o.id_order = ocr.id_order
@@ -124,7 +124,7 @@ class StatsBestVouchers extends ModuleGrid
if (isset($this->_direction))
$this->_query .= ' '.$this->_direction;
}
if (($this->_start === 0 OR Validate::IsUnsignedInt($this->_start)) AND Validate::IsUnsignedInt($this->_limit))
if (($this->_start === 0 || Validate::IsUnsignedInt($this->_start)) && Validate::IsUnsignedInt($this->_limit))
$this->_query .= ' LIMIT '.$this->_start.', '.($this->_limit);
$this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query);
$this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()');