// update tabs stats

This commit is contained in:
Sarah Lorenzini
2013-09-17 17:48:43 +02:00
parent 8f10a0e32f
commit bdb797a66c
18 changed files with 691 additions and 458 deletions
+18 -13
View File
@@ -62,19 +62,24 @@ class GridHtml extends ModuleGridEngine
if (!isset($params['emptyMsg']))
$params['emptyMsg'] = 'Empty';
$html = '<div style="width:'.$params['width'].'px;height:'.$params['height'].'px;overflow:scroll">
<table class="table" cellpadding="0" cellspacing="0" id="grid_1"><thead><tr>';
foreach ($params['columns'] as $column)
$html .= '<th style="width:'.$column['width'].'px;cursor:pointer">
'.$column['header'].'<br />
<a href="javascript:getGridData(\''.$grider.'&sort='.$column['dataIndex'].'&dir=ASC\');"><img src="../img/admin/up.gif" /></a>
<a href="javascript:getGridData(\''.$grider.'&sort='.$column['dataIndex'].'&dir=DESC\');"><img src="../img/admin/down.gif" /></a>
</th>';
$html .= '</tr></thead>
$html = '
<table class="table" id="grid_1">
<thead>
<tr>';
foreach ($params['columns'] as $column)
$html .= '<th class="center">
<span class="title_box active">'.$column['header'].'</span>
</th>';
$html .= '
</tr>
</thead>
<tbody></tbody>
<tfoot><tr><th colspan="'.count($params['columns']).'"></th></tr></tfoot>
<tfoot>
<tr>
<th colspan="'.count($params['columns']).'"></th>
</tr>
</tfoot>
</table>
</div>
<script type="text/javascript">
function getGridData(url)
{
@@ -96,7 +101,7 @@ class GridHtml extends ModuleGridEngine
$.each(values, function(index, row){
var newLine = "<tr>";';
foreach ($params['columns'] as $column)
$html .= ' newLine += "<td'.(isset($column['align']) ? ' style=\"text-align:'.$column['align'].'\"' : '').'>" + row["'.$column['dataIndex'].'"] + "</td>";';
$html .= ' newLine += "<td'.(isset($column['align']) ? ' class=\"'.$column['align'].'\"' : '').'>" + row["'.$column['dataIndex'].'"] + "</td>";';
if (!isset($params['defaultSortColumn']))
$params['defaultSortColumn'] = false;
if (!isset($params['defaultSortDirection']))
@@ -104,7 +109,7 @@ class GridHtml extends ModuleGridEngine
$html .= ' $("#grid_1 tbody").append(newLine);
});
else
$("#grid_1 tbody").append("<tr><td style=\"text-align:center\" colspan=\"" + '.count($params['columns']).' + "\">'.$params['emptyMsg'].'</td></tr>");
$("#grid_1 tbody").append("<tr><td class=\"center\" colspan=\"" + '.count($params['columns']).' + "\">'.$params['emptyMsg'].'</td></tr>");
});
}
+46 -32
View File
@@ -96,30 +96,54 @@ class Pagesnotfound extends Module
if (Tools::isSubmit('submitTruncatePNF'))
{
Db::getInstance()->execute('TRUNCATE `'._DB_PREFIX_.'pagenotfound`');
$this->_html .= '<div class="conf confirm"> '.$this->l('The pages not found cache has been emptied.').'</div>';
$this->_html .= '<div class="alert alert-warning"> '.$this->l('The pages not found cache has been emptied.').'</div>';
}
else if (Tools::isSubmit('submitDeletePNF'))
{
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'pagenotfound`
WHERE date_add BETWEEN '.ModuleGraph::getDateBetween());
$this->_html .= '<div class="conf confirm"> '.$this->l('Pages not found have been deleted.').'</div>';
$this->_html .= '<div class="alert alert-warning"> '.$this->l('Pages not found have been deleted.').'</div>';
}
$this->_html .= '<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>';
$this->_html .= '
<div class="panel-heading">
'.$this->displayName.'
</div>
<h4>'.$this->l('Guide').'</h4>
<div class="alert alert-warning">
<h4>'.$this->l('404 errors').'</h4>
<p>'
.$this->l('A 404 error is an HTTP error code which means that the file requested by the user cannot be found.
In your case it means that one of your visitors entered a wrong URL in the address bar or that you or another website has a dead link.
When it is available, the referrer is shown so you can find the page which contains the dead link.
If not, it means generally that it is a direct access, so someone may have bookmarked a link which doesn\'t exist anymore.').'
</p>
<p>&nbsp;</p>
<h4>'.$this->l('How to catch these errors?').'</h4>
<p>'
.$this->l('If your webhost supports .htaccess files, you can create one in the root directory of PrestaShop and insert the following line inside:').'
<i>ErrorDocument 404 '.__PS_BASE_URI__.'404.php</i>. '.
$this->l('A user requesting a page which doesn\'t exist will be redirected to the following page.').' <i>'.__PS_BASE_URI__.'404.php</i>. '.
$this->l('This module logs access to this page.').'
</p>
</div>';
if (!file_exists(dirname(__FILE__).'/../../.htaccess'))
$this->_html .= '<br/><div class="warning warn">'.$this->l('You must use a .htaccess file to redirect 404 errors to the page "404.php"').'</div>';
$this->_html .= '<div class="alert alert-warning">'.$this->l('You must use a .htaccess file to redirect 404 errors to the page "404.php"').'</div>';
$pages = $this->getPages();
if (count($pages))
{
$this->_html .= '
<table class="table" cellpadding="0" cellspacing="0">
<tr>
<th width="200">'.$this->l('Page').'</th>
<th width="500">'.$this->l('Referrer').'</th>
<th>'.$this->l('Counter').'</th>
</tr>';
<table class="table">
<thead>
<tr>
<th><span class="title_box active">'.$this->l('Page').'</span></th>
<th><span class="title_box active">'.$this->l('Referrer').'</span></th>
<th><span class="title_box active">'.$this->l('Counter').'</span></th>
</tr>
</thead>
<tbody>';
foreach ($pages as $ru => $hrs)
foreach ($hrs as $hr => $counter)
if ($hr != 'nb')
@@ -127,36 +151,26 @@ class Pagesnotfound extends Module
<tr>
<td><a href="'.$ru.'-admin404">'.wordwrap($ru, 30, '<br />', true).'</a></td>
<td><a href="'.Tools::getProtocol().$hr.'">'.wordwrap($hr, 40, '<br />', true).'</a></td>
<td align="right">'.$counter.'</td>
<td>'.$counter.'</td>
</tr>';
$this->_html .= '
</tbody>
</table>';
}
else
$this->_html .= '<div class="conf confirm"> '.$this->l('No pages registered').'</div>';
$this->_html .= '<div class="alert alert-warning"> '.$this->l('No pages registered').'</div>';
$this->_html .= '</div>';
if (count($pages))
$this->_html .= '<div class="clear">&nbsp;</div>
<div class="blocStats"><h2 class="icon-'.$this->name.'">'.$this->l('Empty database').'</h2>
$this->_html .= '
<h4>'.$this->l('Empty database').'</h4>
<form action="'.Tools::htmlEntitiesUtf8($_SERVER['REQUEST_URI']).'" method="post">
<input type="submit" class="button" name="submitDeletePNF" value="'.$this->l('Empty ALL pages not found for this period').'">
<input type="submit" class="button" name="submitTruncatePNF" value="'.$this->l('Empty ALL pages not found').'">
</form>
</div>';
$this->_html .= '<br />
<div class="blocStats"><h2 class="icon-guide"><span></span>'.$this->l('Guide').'</h2>
<h2>'.$this->l('404 errors').'</h2>
<p>'.$this->l('A 404 error is an HTTP error code which means that the file requested by the user cannot be found.
In your case it means that one of your visitors entered a wrong URL in the address bar or that you or another website has a dead link.
When it is available, the referrer is shown so you can find the page which contains the dead link.
If not, it means generally that it is a direct access, so someone may have bookmarked a link which doesn\'t exist anymore.').'</p>
<h3>'.$this->l('How to catch these errors?').'</h3>
<p>'.$this->l('If your webhost supports .htaccess files, you can create one in the root directory of PrestaShop and insert the following line inside:').'
<i>ErrorDocument 404 '.__PS_BASE_URI__.'404.php</i>. '.
$this->l('A user requesting a page which doesn\'t exist will be redirected to the following page.').' <i>'.__PS_BASE_URI__.'404.php</i>. '.
$this->l('This module logs access to this page.').'</p><br />
</div>';
<button type="submit" class="btn btn-default" name="submitDeletePNF">
<i class="icon-remove"></i> '.$this->l('Empty ALL pages not found for this period').'
</button>
<button type="submit" class="btn btn-default" name="submitTruncatePNF">
<i class="icon-remove"></i> '.$this->l('Empty ALL pages not found').'
</button>
</form>';
return $this->_html;
}
+54 -29
View File
@@ -104,52 +104,77 @@ class SEKeywords extends ModuleGraph
$this->csvExport(array('type' => 'pie'));
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query.ModuleGraph::getDateBetween().$this->_query2);
$total = count($result);
$this->html = '<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
$this->html = '
<div class="panel-heading">'
.$this->displayName.'
</div>
<h4>'.$this->l('Guide').'</h4>
<div class="alert alert-warning">
<h4>'.$this->l('Identify external search engine keywords').'</h4>
<p>'
.$this->l('One of the most common ways of finding a website through a search engine.').
$this->l('Identifying the most popular keywords entered by your new visitors allows you to see the products you should put in front if you want to achieve SEO. ').'
</p>
<p>&nbsp;</p>
<h4>'.$this->l('How does it work?').'</h4>
<p>'
.$this->l('When a visitor comes to your website, the server notes their previous location. This module parses the URL and finds the keywords in it.').
sprintf($this->l('Currently, it manages the following search engines: %1$s and %2$s.'),
'<b>Google, AOL, Yandex, Ask, NHL, Yahoo, Baidu, Lycos, Exalead, Live, Voila</b>',
'<b>Altavista</b>'
).$this->l('Soon, it will be possible to dynamically add new search engines and contribute to this module.').'
</p>
</div>
<p>'.($total == 1 ? sprintf($this->l('%d keyword matches your query.'), $total) : sprintf($this->l('%d keywords match your query.'), $total)).'</p>';
$form = '<form action="'.Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']).'" method="post">
'.$this->l('Filter by keyword').' <input type="text" name="SEK_FILTER_KW" value="'.Tools::htmlentitiesUTF8(Configuration::get('SEK_FILTER_KW')).'" />
'.$this->l('And min occurrences').' <input type="text" name="SEK_MIN_OCCURENCES" value="'.(int)Configuration::get('SEK_MIN_OCCURENCES').'" />
<input type="submit" class="button" name="submitSEK" value="'.$this->l('Apply ').'" />
</form>';
$form = '
<form action="'.Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']).'" method="post" class="form-horizontal">
<div class="row row-margin-bottom">
<label class="control-label col-lg-3">'.$this->l('Filter by keyword').'</label>
<div class="col-lg-9">
<input type="text" name="SEK_FILTER_KW" value="'.Tools::htmlentitiesUTF8(Configuration::get('SEK_FILTER_KW')).'" />
</div>
</div>
<div class="row row-margin-bottom">
<label class="control-label col-lg-3">'.$this->l('And min occurrences').'</label>
<div class="col-lg-9">
<input type="text" name="SEK_MIN_OCCURENCES" value="'.(int)Configuration::get('SEK_MIN_OCCURENCES').'" />
</div>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-9 col-lg-offset-3">
<button type="submit" class="btn btn-default" name="submitSEK">
<i class="icon-ok"></i> '.$this->l('Apply').'
</button>
</div>
</div>
</form>';
if ($result && $total)
{
$table = '
<div style="overflow-y: scroll; height: 600px;">
<table class="table" border="0" cellspacing="0" cellspacing="0">
<thead>
<tr><th style="width:400px;">'.$this->l('Keywords').'</th>
<th style="width:50px; text-align: right">'.$this->l('Occurrences').'</th></tr>
</thead><tbody>';
<table class="table">
<thead>
<tr>
<th><span class="title_box active">'.$this->l('Keywords').'</span></th>
<th><span class="title_box active">'.$this->l('Occurrences').'</span></th>
</tr>
</thead>
<tbody>';
foreach ($result as $index => $row)
{
$keyword =& $row['keyword'];
$occurences =& $row['occurences'];
$table .= '<tr><td>'.$keyword.'</td><td style="text-align: right">'.$occurences.'</td></tr>';
$table .= '<tr><td>'.$keyword.'</td><td>'.$occurences.'</td></tr>';
}
$table .= '</tbody></table></div>';
$table .= '</tbody></table>';
$this->html .= '<div>'.$this->engine(array('type' => 'pie')).'</div>
<br/>
<p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" /> '.$this->l('CSV Export').'</a></p><br/>
<a class="btn btn-default" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language"><<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'</a>
'.$form.'<br/>'.$table;
}
else
$this->html .= '<p>'.$form.'<strong>'.$this->l('No keywords').'</strong></p>';
$this->html .= '</div><br/>
<div class="blocStats"><h2 class="icon-guide"><span></span>'.$this->l('Guide').'</h2>
<h2>'.$this->l('Identify external search engine keywords').'</h2>
<p>'.$this->l('One of the most common ways of finding a website through a search engine.').
$this->l('Identifying the most popular keywords entered by your new visitors allows you to see the products you should put in front if you want to achieve SEO. ').'
</p><br />
<h3>'.$this->l('How does it work?').'</h2>
<p>'.$this->l('When a visitor comes to your website, the server notes their previous location. This module parses the URL and finds the keywords in it.').
sprintf($this->l('Currently, it manages the following search engines: %1$s and %2$s.'),
'<b>Google, AOL, Yandex, Ask, NHL, Yahoo, Baidu, Lycos, Exalead, Live, Voila</b>',
'<b>Altavista</b>'
).$this->l('Soon, it will be possible to dynamically add new search engines and contribute to this module.').'</p><br />
</div>';
return $this->html;
}
@@ -57,29 +57,25 @@ class StatsBestCategories extends ModuleGrid
'id' => 'name',
'header' => $this->l('Name'),
'dataIndex' => 'name',
'align' => 'left',
'width' => 140
'align' => 'center'
),
array(
'id' => 'totalQuantitySold',
'header' => $this->l('Total Quantity Sold'),
'dataIndex' => 'totalQuantitySold',
'width' => 20,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'totalPriceSold',
'header' => $this->l('Total Price'),
'dataIndex' => 'totalPriceSold',
'width' => 30,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'totalPageViewed',
'header' => $this->l('Total Viewed'),
'dataIndex' => 'totalPageViewed',
'width' => 30,
'align' => 'right'
'align' => 'center'
)
);
@@ -108,10 +104,13 @@ class StatsBestCategories extends ModuleGrid
$this->csvExport($engineParams);
$this->_html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
<div class="panel-heading">
'.$this->displayName.'
</div>
'.$this->engine($engineParams).'
<br /><a class="button export-csv" href="'.htmlentities($_SERVER['REQUEST_URI']).'&export=1"><span>'.$this->l('CSV Export').'</span></a>
</div>';
<a class="btn btn-default export-csv" href="'.htmlentities($_SERVER['REQUEST_URI']).'&export=1">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>';
return $this->_html;
}
@@ -59,38 +59,38 @@ class StatsBestCustomers extends ModuleGrid
'id' => 'lastname',
'header' => $this->l('Last Name'),
'dataIndex' => 'lastname',
'width' => 80
'align' => 'center'
),
array(
'id' => 'firstname',
'header' => $this->l('First Name'),
'dataIndex' => 'firstname',
'width' => 80
'align' => 'center'
),
array(
'id' => 'email',
'header' => $this->l('Email'),
'dataIndex' => 'email',
'width' => 140
'align' => 'center'
),
array(
'id' => 'totalVisits',
'header' => $this->l('Visits'),
'dataIndex' => 'totalVisits',
'width' => 80,
'align' => 'right'),
'align' => 'center'
),
array(
'id' => 'totalValidOrders',
'header' => $this->l('Valid orders'),
'dataIndex' => 'totalValidOrders',
'width' => 80,
'align' => 'right'),
'align' => 'center'
),
array(
'id' => 'totalMoneySpent',
'header' => $this->l('Money spent').' ('.Tools::safeOutput($currency->iso_code).')',
'dataIndex' => 'totalMoneySpent',
'width' => 140,
'align' => 'right')
'align' => 'center'
)
);
$this->displayName = $this->l('Best customers');
@@ -116,23 +116,27 @@ class StatsBestCustomers extends ModuleGrid
if (Tools::getValue('export'))
$this->csvExport($engineParams);
$this->_html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
'.$this->engine($engineParams).'
<p><a class="button export-csv" href="'.htmlentities($_SERVER['REQUEST_URI']).'&export=1"><span>'.$this->l('CSV Export').'</span></a></p>
</div><br />
<div class="blocStats"><h2 class="icon-guide"><span></span>'.$this->l('Guide').'</h2>
<h2 >'.$this->l('Develop clients\' loyalty').'</h2>
<p class="space">
'.$this->l('Keeping a client is more profitable than gaining a new one. That is one of the many reasons it is necessary to cultivate customer loyalty.').' <br />
'.$this->l('Word of mouth is also a means for getting new, satisfied clients. A dissatisfied customer can hurt your e-reputation and obstruct future sales goals.').'<br />
'.$this->l('In order to achieve this goal, you can organize:').'
<ul>
<li>'.$this->l('Punctual operations: commercial rewards (personalized special offers, product or service offered), non commercial rewards (priority handling of an order or a product), pecuniary rewards (bonds, discount coupons, payback).').'</li>
<li>'.$this->l('Sustainable operations: loyalty points or cards, which not only justify communication between merchant and client, but also offer advantages to clients (private offers, discounts).').'</li>
</ul>
'.$this->l('These operations encourage clients to buy products and visit your e-store regularly.').'
</p>
</div>';
<div class="panel-heading">
'.$this->displayName.'
</div>
<h4>'.$this->l('Guide').'</h4>
<div class="alert alert-warning">
<h4>'.$this->l('Develop clients\' loyalty').'</h4>
<p>
'.$this->l('Keeping a client is more profitable than gaining a new one. That is one of the many reasons it is necessary to cultivate customer loyalty.').' <br />
'.$this->l('Word of mouth is also a means for getting new, satisfied clients. A dissatisfied customer can hurt your e-reputation and obstruct future sales goals.').'<br />
'.$this->l('In order to achieve this goal, you can organize:').'
<ul>
<li>'.$this->l('Punctual operations: commercial rewards (personalized special offers, product or service offered), non commercial rewards (priority handling of an order or a product), pecuniary rewards (bonds, discount coupons, payback).').'</li>
<li>'.$this->l('Sustainable operations: loyalty points or cards, which not only justify communication between merchant and client, but also offer advantages to clients (private offers, discounts).').'</li>
</ul>
'.$this->l('These operations encourage clients to buy products and visit your e-store regularly.').'
</p>
</div>
'.$this->engine($engineParams).'
<a class="btn btn-default export-csv" href="'.htmlentities($_SERVER['REQUEST_URI']).'&export=1">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>';
return $this->_html;
}
+14 -19
View File
@@ -57,57 +57,49 @@ class StatsBestProducts extends ModuleGrid
'id' => 'reference',
'header' => $this->l('Ref.'),
'dataIndex' => 'reference',
'align' => 'left',
'width' => 50
'align' => 'center'
),
array(
'id' => 'name',
'header' => $this->l('Name'),
'dataIndex' => 'name',
'align' => 'left',
'width' => 100
'align' => 'center'
),
array(
'id' => 'totalQuantitySold',
'header' => $this->l('Quantity sold'),
'dataIndex' => 'totalQuantitySold',
'width' => 50,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'avgPriceSold',
'header' => $this->l('Price sold'),
'dataIndex' => 'avgPriceSold',
'width' => 50,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'totalPriceSold',
'header' => $this->l('Sales'),
'dataIndex' => 'totalPriceSold',
'width' => 50,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'averageQuantitySold',
'header' => $this->l('Quantity sold in a day.'),
'dataIndex' => 'averageQuantitySold',
'width' => 60,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'totalPageViewed',
'header' => $this->l('Page views'),
'dataIndex' => 'totalPageViewed',
'width' => 60,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'quantity',
'header' => $this->l('Available quantity for sale.'),
'dataIndex' => 'quantity',
'width' => 150,
'align' => 'right'
'align' => 'center'
)
);
@@ -136,10 +128,13 @@ class StatsBestProducts extends ModuleGrid
$this->csvExport($engineParams);
$this->_html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
<div class="panel-heading">
'.$this->displayName.'
</div>
'.$this->engine($engineParams).'
<p><a class="button export-csv" href="'.htmlentities($_SERVER['REQUEST_URI']).'&export=1"><span>'.$this->l('CSV Export').'</span></a></p>
</fieldset>';
<a class="btn btn-default export-csv" href="'.htmlentities($_SERVER['REQUEST_URI']).'&export=1">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>';
return $this->_html;
}
@@ -57,22 +57,19 @@ class StatsBestSuppliers extends ModuleGrid
'id' => 'name',
'header' => $this->l('Name'),
'dataIndex' => 'name',
'align' => 'left',
'width' => 200
'align' => 'center'
),
array(
'id' => 'quantity',
'header' => $this->l('Quantity sold'),
'dataIndex' => 'quantity',
'width' => 60,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'sales',
'header' => $this->l('Total paid'),
'dataIndex' => 'sales',
'width' => 60,
'align' => 'right'
'align' => 'center'
)
);
@@ -100,10 +97,13 @@ class StatsBestSuppliers extends ModuleGrid
if (Tools::getValue('export') == 1)
$this->csvExport($engineParams);
$this->_html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
<div class="panel-heading">
'.$this->displayName.'
</div>
'.$this->engine($engineParams).'
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><span>'.$this->l('CSV Export').'</span></a></p>
</div>';
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>';
return $this->_html;
}
+10 -11
View File
@@ -57,29 +57,25 @@ class StatsBestVouchers extends ModuleGrid
'id' => 'code',
'header' => $this->l('Code'),
'dataIndex' => 'code',
'align' => 'left',
'width' => 300
'align' => 'center'
),
array(
'id' => 'name',
'header' => $this->l('Name'),
'dataIndex' => 'name',
'align' => 'left',
'width' => 300
'align' => 'center'
),
array(
'id' => 'ca',
'header' => $this->l('Sales'),
'dataIndex' => 'ca',
'width' => 30,
'align' => 'right'
'align' => 'center'
),
array(
'id' => 'total',
'header' => $this->l('Total used'),
'dataIndex' => 'total',
'width' => 30,
'align' => 'right'
'align' => 'center'
)
);
@@ -108,10 +104,13 @@ class StatsBestVouchers extends ModuleGrid
$this->csvExport($engineParams);
$this->_html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
<div class="panel-heading">
'.$this->displayName.'
</div>
'.$this->engine($engineParams).'
<br /><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><span>'.$this->l('CSV Export').'</span></a>
</div>';
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>';
return $this->_html;
}
+32 -11
View File
@@ -66,18 +66,39 @@ class StatsCarrier extends ModuleGraph
if (Tools::getValue('export'))
$this->csvExport(array('type' => 'pie', 'option' => Tools::getValue('id_order_state')));
$this->_html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" style="float: right;">
<select name="id_order_state">
<option value="0"'.((!Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$this->l('All').'</option>';
foreach ($states as $state)
$this->_html .= '<option value="'.$state['id_order_state'].'"'.(($state['id_order_state'] == Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$state['name'].'</option>';
$this->_html .= '</select>
<input type="submit" name="submitState" value="'.$this->l('Filter').'" class="button" />
<div class="panel-heading">
'.$this->displayName.'
</div>
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" class="form-horizontal alert">
<div class="row">
<div class="col-lg-5 col-lg-offset-6">
<select name="id_order_state">
<option value="0"'.((!Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$this->l('All').'</option>';
foreach ($states as $state)
$this->_html .= '<option value="'.$state['id_order_state'].'"'.(($state['id_order_state'] == Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$state['name'].'</option>';
$this->_html .= '</select>
</div>
<div class="col-lg-1">
<input type="submit" name="submitState" value="'.$this->l('Filter').'" class="btn btn-default pull-right" />
</div>
</div>
</form>
<p><img src="../img/admin/down.gif" />'.$this->l('This graph represents the carrier distribution for your orders. You can also narrow the focus of the graph to display distribution for a particular state.').'</p>
'.($result['total'] ? $this->engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))).'<br /><br /> <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a>' : $this->l('No valid orders have been received for this period.')).'
</div>';
<div class="alert alert-info">
'.$this->l('This graph represents the carrier distribution for your orders. You can also narrow the focus of the graph to display distribution for a particular state.').'
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.($result['total'] ? $this->engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))).'
</div>
<div class="col-lg-4">
<a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language" class="btn btn-default">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>' : $this->l('No valid orders have been received for this period.')).'
</div>
</div>
</div>';
return $this->_html;
}
+68 -44
View File
@@ -172,66 +172,90 @@ class StatsCatalog extends Module
$html = '
<script type="text/javascript" language="javascript">$(\'#calendar\').slideToggle();</script>
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
<div class="margin-form">
<form action="" method="post" id="categoriesForm">
<label>
'.$this->l('Choose a category').'
</label>
<select name="id_category" onchange="$(\'#categoriesForm\').submit();">
<option value="0">'.$this->l('All').'</option>';
foreach ($categories as $category)
$html .= '<option value="'.$category['id_category'].'"'.($id_category == $category['id_category'] ? ' selected="selected"' : '').'>'.
$category['name'].'
</option>';
$html .= '
</select>
</form>
<div class="panel-heading">
'.$this->displayName.'
</div>
<table>
'.$this->returnLine($this->l('Products available:'), (int)$total).'
'.$this->returnLine($this->l('Average price (base price):'), Tools::displayPrice($averagePrice, $this->context->currency)).'
'.$this->returnLine($this->l('Product pages viewed:'), (int)$totalPageViewed).'
'.$this->returnLine($this->l('Products bought:'), (int)$totalBought).'
'.$this->returnLine($this->l('Average number of page visits:'), number_format((float)$averageViewed, 2, '.', '')).'
'.$this->returnLine($this->l('Average number of purchases:'), number_format((float)$averagePurchase, 2, '.', '')).'
'.$this->returnLine($this->l('Images available:'), (int)$totalPictures).'
'.$this->returnLine($this->l('Average number of images:'), number_format((float)$averagePictures, 2, '.', '')).'
'.$this->returnLine($this->l('Products never viewed:'), (int)$totalNV.' / '.(int)$total).'
'.$this->returnLine('<a style="cursor : pointer" onclick="$(\'#pnb\').slideToggle();">'.$this->l('Products never purchased:').'</a>', (int)$totalNB.' / '.(int)$total).'
'.$this->returnLine($this->l('Conversion rate*:'), $conversion).'
</table>
<div style="margin-top: 20px;">
<span style="color:red;font-weight:bold">*</span>
'.$this->l('Define the average conversion rate for the product page (It is possible to purchase a product without viewing the product page, so this rate can be greater than 1).').'
</div>
</div>';
<form action="" method="post" id="categoriesForm" class="form-horizontal">
<div class="row row-margin-bottom">
<label class="control-label col-lg-3">
'.$this->l('Choose a category').'
</label>
<div class="col-lg-6">
<select name="id_category" onchange="$(\'#categoriesForm\').submit();">
<option value="0">'.$this->l('All').'</option>';
foreach ($categories as $category)
$html .= '<option value="'.$category['id_category'].'"'.($id_category == $category['id_category'] ? ' selected="selected"' : '').'>'.
$category['name'].'
</option>';
$html .= '
</select>
</div>
</div>
</form>
<ul class="list-group">
<li class="list-group-item">'.$this->returnLine($this->l('Products available:'), '<span class="badge">'.(int)$total).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Average price (base price):'), '<span class="badge">'.Tools::displayPrice($averagePrice, $this->context->currency)).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Product pages viewed:'), '<span class="badge">'.(int)$totalPageViewed).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Products bought:'), '<span class="badge">'.(int)$totalBought).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Average number of page visits:'), '<span class="badge">'.number_format((float)$averageViewed, 2, '.', '')).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Average number of purchases:'), '<span class="badge">'.number_format((float)$averagePurchase, 2, '.', '')).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Images available:'), '<span class="badge">'.(int)$totalPictures).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Average number of images:'), '<span class="badge">'.number_format((float)$averagePictures, 2, '.', '')).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Products never viewed:'), '<span class="badge">'.(int)$totalNV.' / '.(int)$total).'</span></li>
<li class="list-group-item">'.$this->returnLine('<a style="cursor : pointer" onclick="$(\'#pnb\').slideToggle();">'.$this->l('Products never purchased:').'</a>', '<span class="badge">'.(int)$totalNB.' / '.(int)$total).'</span></li>
<li class="list-group-item">'.$this->returnLine($this->l('Conversion rate*:'), '<span class="badge">'.$conversion).'</span></li>
</ul>
<div class="row row-margin-bottom">
<p>
<i class="icon-asterisk"></i>'.$this->l('Define the average conversion rate for the product page (It is possible to purchase a product without viewing the product page, so this rate can be greater than 1).').'
</p>
</div>';
if (count($productsNB) && count($productsNB) < 50)
{
$html .= '<br />
<div class="blocStats"><h2 class="icon-basket-delete"><span></span>'.$this->l('Products never purchased').'</h2>
<table cellpadding="0" cellspacing="0" class="table">
<tr><th>'.$this->l('ID').'</th><th>'.$this->l('Name').'</th><th>'.$this->l('Edit / View').'</th></tr>';
$html .= '
<div class="panel-heading">'.$this->l('Products never purchased').'</div>
<table class="table">
<thead>
<tr>
<th><span class="title_box active">'.$this->l('ID').'</span></th>
<th><span class="title_box active">'.$this->l('Name').'</span></th>
<th><span class="title_box active">'.$this->l('Edit / View').'</span></th>
</tr>
</thead>
<tbody>';
foreach ($productsNB as $product)
$html .= '
<tr'.($irow++ % 2 ? ' class="alt_row"' : '').'>
<td>'.$product['id_product'].'</td>
<td style="width: 400px;">'.$product['name'].'</td>
<td style="text-align: right">
<a href="index.php?tab=AdminProducts&id_product='.$product['id_product'].'&addproduct&token='.$productToken.'" target="_blank"><img src="../modules/'.$this->name.'/page_edit.png" /></a>
<a href="'.$this->context->link->getProductLink($product['id_product'], $product['link_rewrite']).'" target="_blank"><img src="../modules/'.$this->name.'/application_home.png" /></a>
<td>'.$product['name'].'</td>
<td class="left">
<div class="btn-group btn-group-action">
<a class="btn btn-default" href="index.php?tab=AdminProducts&id_product='.$product['id_product'].'&addproduct&token='.$productToken.'" target="_blank">
<i class="icon-edit"></i> '.$this->l('Edit').'
</a>
<button data-toggle="dropdown" class="btn btn-default dropdown-toggle" type="button">
<span class="caret">&nbsp;</span>
</button>
<ul class="dropdown-menu">
<li>
<a href="'.$this->context->link->getProductLink($product['id_product'], $product['link_rewrite']).'" target="_blank">
<i class="icon-eye-open"></i> '.$this->l('See').'
</a>
</li>
</ul>
</div>
</td>
</tr>';
$html .= '
</table>
</div>';
</tbody>
</table>';
}
return $html;
}
private function returnLine($label, $data)
{
return '<tr><td>'.$label.'</td><td style="color:green;font-weight:bold;padding-left:20px;">'.$data.'</td></tr>';
return '<tr><td>'.$label.'</td><td>'.$data.'</td></tr>';
}
}
+114 -92
View File
@@ -155,61 +155,80 @@ class StatsCheckUp extends Module
);
$this->html = '
<style type="text/css">
form.checkup input[type=text] {width:30px}
form.checkup div {margin-top:20px}
table.checkup th {text-align:center}
table.checkup td {padding:5px 10px}
table.checkup2 td {text-align:right}
</style>
<div class="blocStats">
<form action="'.AdminController::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'" method="post" class="checkup">
<table class="table checkup" border="0" cellspacing="0" cellspacing="0">
<tr>
<th></th>
<th>'.$arrayColors[0].' '.$this->l('Not enough').'</th>
<th>'.$arrayColors[2].' '.$this->l('Alright').'</th>
</tr>';
foreach ($arrayConf as $conf => $translations)
$this->html .= '<tr>
<th>'.$translations['name'].'</th>
<td>'.$this->l('Less than').'
<input type="text" name="CHECKUP_'.$conf.'_LT"
value="'.Tools::safeOutput(Tools::getValue('CHECKUP_'.$conf.'_LT', Configuration::get('CHECKUP_'.$conf.'_LT'))).'" /> '.$translations['text'].'
</td>
<td>'.$this->l('Greater than').'
<input type="text" name="CHECKUP_'.$conf.'_GT"
value="'.Tools::safeOutput(Tools::getValue('CHECKUP_'.$conf.'_GT', Configuration::get('CHECKUP_'.$conf.'_GT'))).'" /> '.$translations['text'].'
</td>
</tr>';
$this->html .= '</table>
<div><input type="submit" name="submitCheckup" class="button" value="'.$this->l(' Save ').'" /></div>
</form>
<div class="panel-heading">'
.$this->displayName.'
</div>
<br />
<div class="blocStats">
<form action="'.AdminController::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'" method="post">
'.$this->l('Order by').'
<select name="submitCheckupOrder" onchange="this.form.submit();" style="width:100px">
<option value="1">'.$this->l('ID').'</option>
<option value="2" '.($this->context->cookie->checkup_order == 2 ? 'selected="selected"' : '').'>'.$this->l('Name').'</option>
<option value="3" '.($this->context->cookie->checkup_order == 3 ? 'selected="selected"' : '').'>'.$this->l('Sales').'</option>
</select>
<form action="'.AdminController::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'" method="post" class="checkup form-horizontal">
<table class="table checkup">
<thead>
<tr>
<th></th>
<th><span class="title_box active">'.$arrayColors[0].' '.$this->l('Not enough').'</span></th>
<th><span class="title_box active">'.$arrayColors[2].' '.$this->l('Alright').'</span></th>
</tr>
</thead>';
foreach ($arrayConf as $conf => $translations)
$this->html .= '
<tbody>
<tr>
<td>
<label class="control-label col-lg-12">'.$translations['name'].'</label>
</td>
<td>
<div class="row">
<div class="col-lg-11 input-group">
<span class="input-group-addon">'.$this->l('Less than').'</span>
<input type="text" name="CHECKUP_'.$conf.'_LT" value="'.Tools::safeOutput(Tools::getValue('CHECKUP_'.$conf.'_LT', Configuration::get('CHECKUP_'.$conf.'_LT'))).'" />
<span class="input-group-addon">'.$translations['text'].'</span>
</div>
</div>
</td>
<td>
<div class="row">
<div class="col-lg-12 input-group">
<span class="input-group-addon">'.$this->l('Greater than').'</span>
<input type="text" name="CHECKUP_'.$conf.'_GT" value="'.Tools::safeOutput(Tools::getValue('CHECKUP_'.$conf.'_GT', Configuration::get('CHECKUP_'.$conf.'_GT'))).'" />
<span class="input-group-addon">'.$translations['text'].'</span>
</div>
</div>
</td>
</tr>
</tbody>';
$this->html .= '</table>
<button type="submit" name="submitCheckup" class="btn btn-default pull-right">
<i class="icon-save"></i> '.$this->l('Save').'
</button>
</form>
<br />
<table class="table checkup2" border="0" cellspacing="0" cellspacing="0">
<tr>
<th>'.$this->l('ID').'</th>
<th>'.$this->l('Item').'</th>
<th>'.$this->l('Active').'</th>';
foreach ($languages as $language)
$this->html .= '<th>'.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')</th>';
$this->html .= '
<th>'.$this->l('Images').'</th>
<th>'.$this->l('Sales').'</th>
<th>'.$this->l('Available quantity for sale').'</th>
<th>'.$this->l('Global').'</th>
</tr>';
<form action="'.AdminController::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'" method="post" class="form-horizontal alert">
<div class="row">
<div class="col-lg-12">
<label class="control-label pull-left">'.$this->l('Order by').'</label>
<div class="col-lg-3">
<select name="submitCheckupOrder" onchange="this.form.submit();">
<option value="1">'.$this->l('ID').'</option>
<option value="2" '.($this->context->cookie->checkup_order == 2 ? 'selected="selected"' : '').'>'.$this->l('Name').'</option>
<option value="3" '.($this->context->cookie->checkup_order == 3 ? 'selected="selected"' : '').'>'.$this->l('Sales').'</option>
</select>
</div>
</div>
</div>
</form>
<table class="table checkup2">
<thead>
<tr>
<th><span class="title_box active">'.$this->l('ID').'</span></th>
<th><span class="title_box active">'.$this->l('Item').'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Active').'</span></th>';
foreach ($languages as $language)
$this->html .= '<th><span class="title_box active">'.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')</span></th>';
$this->html .= '
<th class="center"><span class="title_box active">'.$this->l('Images').'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Sales').'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Available quantity for sale').'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Global').'</span></th>
</tr>
</thead>
<tbody>';
foreach ($result as $row)
{
$totals['products']++;
@@ -238,23 +257,26 @@ class StatsCheckUp extends Module
$scores['average'] = array_sum($scores) / $divisor;
$scores['average'] = ($scores['average'] < 1 ? 0 : ($scores['average'] > 1.5 ? 2 : 1));
$this->html .= '<tr>
<td>'.$row['id_product'].'</td>
<td style="text-align:left"><a href="index.php?tab=AdminProducts&updateproduct&id_product='.$row['id_product'].'&token='.$tokenProducts.'">'.Tools::substr($row['name'], 0, 42).'</a></td>
<td>'.$arrayColors[$scores['active']].'</td>';
foreach ($languages as $language)
if (isset($row['desclength_'.$language['iso_code']]))
$this->html .= '<td>'.(int)$row['desclength_'.$language['iso_code']].' '.$arrayColors[$scores['description_'.$language['iso_code']]].'</td>';
else
$this->html .= '<td>0 '.$arrayColors[0].'</td>';
$this->html .= '
<td>'.(int)$row['nbImages'].' '.$arrayColors[$scores['images']].'</td>
<td>'.(int)$row['nbSales'].' '.$arrayColors[$scores['sales']].'</td>
<td>'.(int)$row['stock'].' '.$arrayColors[$scores['stock']].'</td>
<td>'.$arrayColors[$scores['average']].'</td>
</tr>';
<tr>
<td>'.$row['id_product'].'</td>
<td><a href="index.php?tab=AdminProducts&updateproduct&id_product='.$row['id_product'].'&token='.$tokenProducts.'">'.Tools::substr($row['name'], 0, 42).'</a></td>
<td class="center">'.$arrayColors[$scores['active']].'</td>';
foreach ($languages as $language)
if (isset($row['desclength_'.$language['iso_code']]))
$this->html .= '<td class="center">'.(int)$row['desclength_'.$language['iso_code']].' '.$arrayColors[$scores['description_'.$language['iso_code']]].'</td>';
else
$this->html .= '<td>0 '.$arrayColors[0].'</td>';
$this->html .= '
<td class="center">'.(int)$row['nbImages'].' '.$arrayColors[$scores['images']].'</td>
<td class="center">'.(int)$row['nbSales'].' '.$arrayColors[$scores['sales']].'</td>
<td class="center">'.(int)$row['stock'].' '.$arrayColors[$scores['stock']].'</td>
<td class="center">'.$arrayColors[$scores['average']].'</td>
</tr>';
}
$this->html .= '</tbody>';
$totals['active'] = $totals['active'] / $totals['products'];
$totals['active'] = ($totals['active'] < 1 ? 0 : ($totals['active'] > 1.5 ? 2 : 1));
$totals['images'] = $totals['images'] / $totals['products'];
@@ -272,31 +294,31 @@ class StatsCheckUp extends Module
$totals['average'] = ($totals['average'] < 1 ? 0 : ($totals['average'] > 1.5 ? 2 : 1));
$this->html .= '
<tr>
<th colspan="2"></th>
<th>'.$this->l('Active').'</th>';
foreach ($languages as $language)
$this->html .= '<th>'.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')</th>';
$this->html .= '
<th>'.$this->l('Images').'</th>
<th>'.$this->l('Sales').'</th>
<th>'.$this->l('Available quantity for sale').'</th>
<th>'.$this->l('Global').'</th>
</tr>
<tr>
<td colspan="2"></td>
<td>'.$arrayColors[$totals['active']].'</td>';
foreach ($languages as $language)
$this->html .= '<td>'.$arrayColors[$totals['description_'.$language['iso_code']]].'</td>';
$this->html .= '
<td>'.$arrayColors[$totals['images']].'</td>
<td>'.$arrayColors[$totals['sales']].'</td>
<td>'.$arrayColors[$totals['stock']].'</td>
<td>'.$arrayColors[$totals['average']].'</td>
</tr>
</table>
</div>
<div class="clear">&nbsp;</div>';
<tfoot>
<tr>
<th colspan="2"></th>
<th class="center"><span class="title_box active">'.$this->l('Active').'</span></th>';
foreach ($languages as $language)
$this->html .= '<th class="center"><span class="title_box active">'.$this->l('Desc.').' ('.strtoupper($language['iso_code']).')</span></th>';
$this->html .= '
<th class="center"><span class="title_box active">'.$this->l('Images').'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Sales').'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Available quantity for sale').'</span></th>
<th class="center"><span class="title_box active">'.$this->l('Global').'</span></th>
</tr>
<tr>
<td colspan="2"></td>
<td class="center">'.$arrayColors[$totals['active']].'</td>';
foreach ($languages as $language)
$this->html .= '<td class="center">'.$arrayColors[$totals['description_'.$language['iso_code']]].'</td>';
$this->html .= '
<td class="center">'.$arrayColors[$totals['images']].'</td>
<td class="center">'.$arrayColors[$totals['sales']].'</td>
<td class="center">'.$arrayColors[$totals['stock']].'</td>
<td class="center">'.$arrayColors[$totals['average']].'</td>
</tr>
</tfoot>
</table>';
return $this->html;
}
+43 -23
View File
@@ -121,35 +121,55 @@ class StatsEquipment extends ModuleGraph
$equipment = $this->getEquipment();
$this->html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>
<p><img src="../img/admin/down.gif" />'.$this->l('Determine the percentage of web browsers used by customers.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'wb')).'<br /><br />
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=browser"><span>'.$this->l('CSV Export').'</span></a></p>
<p><img src="../img/admin/down.gif" />'.$this->l('Determine the percentage of operating systems used by customers.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'os')).'
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=os"><span>'.$this->l('CSV Export').'</span></a></p>';
<div class="panel-heading">'
.$this->displayName.'
</div>
<h4>'.$this->l('Guide').'</h4>
<div class="alert alert-warning">
<h4>'.$this->l('Ensure that your website is accessible to all.').'</h4>
<p>
'.$this->l('When managing Websites, it is important to keep track of software used by visitors in order to be sure that the site displays the same way for everyone.
PrestaShop was built in order to be compatible with most recent Web browsers and computer operating systems (OS).
However, because you may end up adding advanced features to your Website or even modify the core PrestaShop code, these additions may not be accessible by everyone.
That is why it is a good idea to keep tabs on the percentage of users for each type of software before adding or changing something that only a limited number of users will be able to access.').'
</p>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie', 'option' => 'wb')).'
</div>
<div class="col-lg-4">
<p>'.$this->l('Determine the percentage of web browsers used by customers.').'</p>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=browser">
<i class="icon-cloud-upload"></i>'.$this->l('CSV Export').'
</a>
</div>
</div>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie', 'option' => 'os')).'
</div>
<div class="col-lg-4">
<p>'.$this->l('Determine the percentage of operating systems used by customers.').'</p>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=os">
<i class="icon-cloud-upload"></i>'.$this->l('CSV Export').'
</a>
</div>
</div>
</div>';
if ($equipment)
{
$this->html .= '<table class="table space" border="0" cellspacing="0" cellpadding="0">
<tr><th style="width: 200px">'.$this->l('Plugins').'</th><th></th></tr>';
$this->html .= '<table class="table">
<tr><th><span class="title_box active">'.$this->l('Plugins').'</th></span><th></th></tr>';
foreach ($equipment as $name => $value)
$this->html .= '<tr><td>'.$name.'</td><td>'.number_format(100 * $value, 2).'%</td></tr>';
$this->html .= '</table>';
}
$this->html .= '
</div>
<br />
<div class="blocStats"><h2 class="icon-guide"><span></span>'.$this->l('Guide').'</h2>
<h2>'.$this->l('Ensure that your website is accessible to all.').'</h2>
<p>
'.$this->l('When managing Websites, it is important to keep track of software used by visitors in order to be sure that the site displays the same way for everyone.
PrestaShop was built in order to be compatible with most recent Web browsers and computer operating systems (OS).
However, because you may end up adding advanced features to your Website or even modify the core PrestaShop code, these additions may not be accessible by everyone.
That is why it is a good idea to keep tabs on the percentage of users for each type of software before adding or changing something that only a limited number of users will be able to access.').'
</p><br />
</div>';
return $this->html;
}
+20 -7
View File
@@ -61,13 +61,26 @@ class StatsNewsletter extends ModuleGraph
if (Tools::getValue('export'))
$this->csvExport(array('type' => 'line', 'layers' => 3));
$this->_html = '
<div class="blocStats">
<h2><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</h2>
<p>'.$this->l('Customer registrations:').' '.(int)$totals['customers'].'</p>
<p>'.$this->l('Visitor registrations: ').' '.(int)$totals['visitors'].'</p>
<p>'.$this->l('Both:').' '.(int)$totals['both'].'</p>
<div>'.$this->engine(array('type' => 'line', 'layers' => 3)).'</div>
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><span>'.$this->l('CSV Export').'</span></a></p>
<div class="panel-heading">
'.$this->displayName.'
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'line', 'layers' => 3)).'
</div>
<div class="col-lg-4">
<ul class="list-unstyled">
<li>'.$this->l('Customer registrations:').' '.(int)$totals['customers'].'</li>
<li>'.$this->l('Visitor registrations: ').' '.(int)$totals['visitors'].'</li>
<li>'.$this->l('Both:').' '.(int)$totals['both'].'</li>
</ul>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>
</div>
</div>
</div>';
}
else
+45 -28
View File
@@ -83,40 +83,57 @@ class StatsOrigin extends ModuleGraph
if (Tools::getValue('export'))
if (Tools::getValue('exportType') == 'top')
$this->csvExport(array('type' => 'pie'));
$this->_html = '<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->l('Origin').'</h2>';
$this->_html = '<div class="panel-heading">'.$this->l('Origin').'</div>';
if (count($websites))
{
$this->_html .= '
<p><img src="../img/admin/down.gif" />'.$this->l('Here we break down the 10 most popular referral websites that call customers to your e-store.').'</p>
<div>'.$this->engine(array('type' => 'pie')).'</div><br />
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=top"><span>'.$this->l('CSV Export').'</span></a></p><br />
<table class="table " border="0" cellspacing="0" cellspacing="0">
<tr>
<th style="width:400px;">'.$this->l('Origin').'</th>
<th style="width:50px; text-align: right">'.$this->l('Total').'</th>
</tr>';
<div class="alert alert-info">
'.$this->l('Here we break down the 10 most popular referral websites that call customers to your e-store.').'
</div>
<h4>'.$this->l('Guide').'</h4>
<div class="alert alert-warning">
<h4>'.$this->l('What is a referral website?').'</h4>
<p>
'.$this->l('When visiting a webpage, the referrer is the URL of the previous webpage from which a link was followed.').'<br />
'.$this->l('A referrer enables you to know which keywords visitors use in search engines when browsing for your online store.').'<br /><br />
'.$this->l('A referrer can be:').'
</p>
<ul>
<li>'.$this->l('Someone who posts a link to your shop.').'</li>
<li>'.$this->l('A partner who has agreed to a link exchange in order to attract new customers.').'</li>
</ul>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie')).'
</div>
<div class="col-lg-4">
<a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=top" class="btn btn-default">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>
</div>
</div>
</div>
<table class="table">
<thead>
<tr>
<th><span class="title_box active">'.$this->l('Origin').'</span></th>
<th><span class="title_box active">'.$this->l('Total').'</span></th>
</tr>
</thead>
<tbody>';
foreach ($websites as $website => $total)
$this->_html .= '<tr>
<td>'.(!strstr($website, ' ') ? '<a href="'.Tools::getProtocol().$website.'">' : '').$website.(!strstr($website, ' ') ? '</a>' : '').'</td><td style="text-align: right">'.$total.'</td>
</tr>';
$this->_html .= '</table></div>';
$this->_html .= '
<tr>
<td>'.(!strstr($website, ' ') ? '<a href="'.Tools::getProtocol().$website.'">' : '').$website.(!strstr($website, ' ') ? '</a>' : '').'</td><td>'.$total.'</td>
</tr>';
$this->_html .= '
</tbody>
</table>';
}
else
$this->_html .= '<p><strong>'.$this->l('Direct links only').'</strong></p>';
$this->_html .= '</div><br />
<div class="blocStats"><h2 class="icon-guide"><span></span>'.$this->l('Guide').'</h2>
<h2>'.$this->l('What is a referral website?').'</h2>
<p>
'.$this->l('When visiting a webpage, the referrer is the URL of the previous webpage from which a link was followed.').'<br />
'.$this->l('A referrer enables you to know which keywords visitors use in search engines when browsing for your online store.').'<br /><br />
'.$this->l('A referrer can be:').'
<ul>
<li class="bullet">'.$this->l('Someone who posts a link to your shop.').'</li>
<li class="bullet">'.$this->l('A partner who has agreed to a link exchange in order to attract new customers.').'</li>
</ul>
</p>
</div>';
$this->_html .= '<p>'.$this->l('Direct links only').'</p>';
return $this->_html;
}
@@ -54,7 +54,27 @@ class StatsPersonalInfos extends ModuleGraph
public function hookAdminStatsModules($params)
{
$this->html = '<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>';
$this->html = '
<div class="panel-heading">
'.$this->displayName.'
</div>
<h4>'.$this->l('Guide').'</h4>
<div class="alert alert-warning">
<h4>'.$this->l('Target your audience.').'</h4>
<p>
'.$this->l('In order for each message to have an impact, you need to know who it is being addressed to. ').'
'.$this->l('Defining your target audience is essential when choosing the right tools to win them over.').'
'.$this->l('It is best to limit action to a group -- or groups -- of clients.').'
'.$this->l('Storing registered customer information allows you to accurately define customer profile so you can adapt your special deals and promotions.').'
</p>
<p>
'.$this->l('Increase your sales by').'
<ul>
<li class="bullet">'.$this->l('launching targeted advertisement campaigns.').'</li>
<li class="bullet">'.$this->l('Contact a group of clients by email or newsletter.').'</li>
</ul>
</p>
</div>';
if (count(Customer::getCustomers()))
{
if (Tools::getValue('export'))
@@ -70,44 +90,79 @@ class StatsPersonalInfos extends ModuleGraph
$this->csvExport(array('type' => 'pie', 'option' => 'language'));
$this->html .= '
<p><img src="../img/admin/down.gif" />'.$this->l('Gender distribution allows you to determine the percentage of men and women shoppers in your store. ').'</p>
<div>'.$this->engine(array('type' => 'pie', 'option' => 'gender')).'</div><br />
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=gender"><span>'.$this->l('CSV Export').'</span></a></p>
<br class="clear" /><br />
<p><img src="../img/admin/down.gif" />'.$this->l('Age ranges allow you to better understand target demographics. ').'</p>
<div>'.$this->engine(array('type' => 'pie', 'option' => 'age')).'</div><br />
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=age"><span>'.$this->l('CSV Export').'</span></a></p><br /><br />
<p><img src="../img/admin/down.gif" />'.$this->l('Country distribution allows you to analyze which part of the world your customers are shopping from.').'</p>
<div>'.$this->engine(array('type' => 'pie', 'option' => 'country')).'</div><br />
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=country"><span>'.$this->l('CSV Export').'</span></a></p><br /><br />
<p><img src="../img/admin/down.gif" />'.$this->l('Currency range allows you to determine which currency your customers are using.').'</p>
<div>'.$this->engine(array('type' => 'pie', 'option' => 'currency')).'</div><br />
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=currency"><span>'.$this->l('CSV Export').'</span></a></p><br /><br />
<p><img src="../img/admin/down.gif" />'.$this->l('Language distribution allows you to analyze the browsing language used by your customers. ').'</p>
<div>'.$this->engine(array('type' => 'pie', 'option' => 'language')).'</div><br />
<p><a class="button export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language"><span>'.$this->l('CSV Export').'</span></a></p>
</center>';
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie', 'option' => 'gender')).'
</div>
<div class="col-lg-4">
<p>'.$this->l('Gender distribution allows you to determine the percentage of men and women shoppers in your store. ').'</p>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=gender">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>
</div>
</div>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie', 'option' => 'age')).'
</div>
<div class="col-lg-4">
<p>'.$this->l('Age ranges allow you to better understand target demographics. ').'</p>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=age">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>
</div>
</div>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie', 'option' => 'country')).'
</div>
<div class="col-lg-4">
<p>'.$this->l('Country distribution allows you to analyze which part of the world your customers are shopping from.').'</p>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=country">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>
</div>
</div>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie', 'option' => 'currency')).'
</div>
<div class="col-lg-4">
<p>'.$this->l('Currency range allows you to determine which currency your customers are using.').'</p>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=currency">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>
</div>
</div>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('type' => 'pie', 'option' => 'language')).'
</div>
<div class="col-lg-4">
<p>'.$this->l('Language distribution allows you to analyze the browsing language used by your customers. ').'</p>
<hr/>
<a class="btn btn-default export-csv" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>
</div>
</div>
</div>';
}
else
$this->html .= '<p>'.$this->l('No customers have registered yet.').'</p>';
$this->html .= '
</div><br />
<div class="blocStats"><h2 class="icon-guide"><span></span>'.$this->l('Guide').'</h2>
<h2>'.$this->l('Target your audience.').'</h2>
<p>
'.$this->l('In order for each message to have an impact, you need to know who it is being addressed to. ').'
'.$this->l('Defining your target audience is essential when choosing the right tools to win them over.').'
'.$this->l('It is best to limit action to a group -- or groups -- of clients.').'
'.$this->l('Storing registered customer information allows you to accurately define customer profile so you can adapt your special deals and promotions.').'
</p><br />
<p>
'.$this->l('Increase your sales by').'
<ul>
<li class="bullet">'.$this->l('launching targeted advertisement campaigns.').'</li>
<li class="bullet">'.$this->l('Contact a group of clients by email or newsletter.').'</li>
</ul>
</p><br />
</div>';
return $this->html;
}
+2 -2
View File
@@ -184,7 +184,7 @@ class StatsProduct extends ModuleGraph
$totalSales = $this->getTotalSales($product->id);
$totalViewed = $this->getTotalViewed($product->id);
$this->html .= '<h4>'.$product->name.' - '.$this->l('Details').'</h4>
<div class="row">
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
'.$this->engine(array('layers' => 2, 'type' => 'line', 'option' => '1-'.$id_product)).'
@@ -292,7 +292,7 @@ class StatsProduct extends ModuleGraph
$categories = Category::getCategories((int)$this->context->language->id, true, false);
$this->html .= '
<form action="" method="post" id="categoriesForm" class="form-horizontal">
<div class="row row-margin-form">
<div class="row row-margin-bottom">
<label class="control-label col-lg-3" for="id_category">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="'.$this->l('Click on a product to access its statistics!').'">
'.$this->l('Choose a category').'
+21 -16
View File
@@ -97,35 +97,40 @@ class StatsSearch extends ModuleGraph
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query.ModuleGraph::getDateBetween().$this->_query2);
$this->_html = '
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->displayName.'</h2>';
$table = '<div style="overflow-y: scroll; height: 600px;">
<table class="table" border="0" cellspacing="0" cellspacing="0">
<thead>
<tr>
<th style="width:400px;">'.$this->l('Keywords').'</th>
<th style="width:50px; text-align: right">'.$this->l('Occurrences').'</th>
<th style="width:50px; text-align: right">'.$this->l('Results').'</th>
</tr>
</thead><tbody>';
<div class="panel-heading">
'.$this->displayName.'
</div>';
$table = '
<table class="table">
<thead>
<tr>
<th><span class="title_box active">'.$this->l('Keywords').'</span></th>
<th><span class="title_box active">'.$this->l('Occurrences').'</span></th>
<th><span class="title_box active">'.$this->l('Results').'</span></th>
</tr>
</thead>
<tbody>';
foreach ($result as $row)
{
if (Tools::strlen($row['keywords']) >= Configuration::get('PS_SEARCH_MINWORDLEN'))
$table .= '<tr>
<td>'.$row['keywords'].'</td>
<td style="text-align: right">'.$row['occurences'].'</td>
<td style="text-align: right">'.$row['total'].'</td>
<td>'.$row['occurences'].'</td>
<td>'.$row['total'].'</td>
</tr>';
}
$table .= '</tbody></table></div>';
$table .= '
</tbody>
</table>';
if (count($result))
$this->_html .= '<div>'.$this->engine(array('type' => 'pie')).'</div>
<p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
<br class="clear" />'.$table;
<a class="btn btn-default" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1">
<i class="icon-cloud-upload"></i> '.$this->l('CSV Export').'
</a>'.$table;
else
$this->_html .= '<p>'.$this->l('No keywords searched more than once have been found.').'</p>';
$this->_html .= '</div>';
return $this->_html;
}
+64 -49
View File
@@ -84,62 +84,77 @@ class StatsStock extends Module
$this->html .= '
<script type="text/javascript">$(\'#calendar\').slideToggle();</script>
<div class="blocStats"><h2 class="icon-'.$this->name.'"><span></span>'.$this->l('Evaluation of available quantities for sale.').'</h2>
<form action="'.$ru.'" method="post">
<input type="hidden" name="submitCategory" value="1" />
'.$this->l('Category').' : <select name="statsstock_id_category" onchange="this.form.submit();">
<option value="0">-- '.$this->l('All').' --</option>';
foreach (Category::getSimpleCategories($this->context->language->id) as $category)
$this->html .= '<option value="'.(int)$category['id_category'].'" '.
($this->context->cookie->statsstock_id_category == $category['id_category'] ? 'selected="selected"' : '').'>'.
$category['name'].'
</option>';
$this->html .= '</select>
</form><br />';
<div class="panel-heading">'
.$this->l('Evaluation of available quantities for sale.').
'</div>
<form action="'.$ru.'" method="post" class="form-horizontal">
<div class="row row-margin-bottom">
<label class="control-label col-lg-3">'.$this->l('Category').'</label>
<div class="col-lg-6">
<select name="statsstock_id_category" onchange="this.form.submit();">
<option value="0">-- '.$this->l('All').' --</option>';
foreach (Category::getSimpleCategories($this->context->language->id) as $category)
$this->html .= '<option value="'.(int)$category['id_category'].'" '.
($this->context->cookie->statsstock_id_category == $category['id_category'] ? 'selected="selected"' : '').'>'.
$category['name'].'
</option>';
$this->html .= '
</select>
<input type="hidden" name="submitCategory" value="1" />
</div>
</div>
</form>';
if (!count($products))
$this->html .= $this->l('Your catalog is empty.');
$this->html .= '<p>'.$this->l('Your catalog is empty.').'</p>';
else
{
$rollup = array('quantity' => 0, 'wholesale_price' => 0, 'stockvalue' => 0);
$this->html .= '<table class="table" cellspacing="0" cellpadding="0">
<tr>
<th>'.$this->l('ID').'</th>
<th>'.$this->l('Ref.').'</th>
<th style="width:350px">'.$this->l('Item').'</th>
<th>'.$this->l('Available quantity for sale').'</th>
<th>'.$this->l('Price*').'</th>
<th>'.$this->l('Value').'</th>
</tr>';
foreach ($products as $product)
{
$rollup['quantity'] += $product['quantity'];
$rollup['wholesale_price'] += $product['wholesale_price'];
$rollup['stockvalue'] += $product['stockvalue'];
$this->html .= '<tr>
<td>'.$product['id_product'].'</td>
<td>'.$product['reference'].'</td>
<td>'.$product['name'].'</td>
<td>'.$product['quantity'].'</td>
<td>'.Tools::displayPrice($product['wholesale_price'], $currency).'</td>
<td>'.Tools::displayPrice($product['stockvalue'], $currency).'</td>
</tr>';
}
$this->html .= '
<tr>
<th colspan="3"></th>
<th>'.$this->l('Total quantities').'</th>
<th>'.$this->l('Avg price').'</th>
<th>'.$this->l('Total value').'</th>
</tr>
<tr>
<td colspan="3"></td>
<td>'.$rollup['quantity'].'</td>
<td>'.Tools::displayPrice($rollup['wholesale_price'] / count($products), $currency).'</td>
<td>'.Tools::displayPrice($rollup['stockvalue'], $currency).'</td>
</tr>
<table class="table">
<thead>
<tr>
<th><span class="title_box active">'.$this->l('ID').'</span></th>
<th><span class="title_box active">'.$this->l('Ref.').'</span></th>
<th><span class="title_box active">'.$this->l('Item').'</span></th>
<th><span class="title_box active">'.$this->l('Available quantity for sale').'</span></th>
<th><span class="title_box active">'.$this->l('Price*').'</span></th>
<th><span class="title_box active">'.$this->l('Value').'</span></th>
</tr>
</thead>
<tbody>';
foreach ($products as $product)
{
$rollup['quantity'] += $product['quantity'];
$rollup['wholesale_price'] += $product['wholesale_price'];
$rollup['stockvalue'] += $product['stockvalue'];
$this->html .= '<tr>
<td>'.$product['id_product'].'</td>
<td>'.$product['reference'].'</td>
<td>'.$product['name'].'</td>
<td>'.$product['quantity'].'</td>
<td>'.Tools::displayPrice($product['wholesale_price'], $currency).'</td>
<td>'.Tools::displayPrice($product['stockvalue'], $currency).'</td>
</tr>';
}
$this->html .= '
</tbody>
<tfoot>
<tr>
<th colspan="3"></th>
<th><span class="title_box active">'.$this->l('Total quantities').'</span></th>
<th><span class="title_box active">'.$this->l('Avg price').'</span></th>
<th><span class="title_box active">'.$this->l('Total value').'</span></th>
</tr>
<tr>
<td colspan="3"></td>
<td>'.$rollup['quantity'].'</td>
<td>'.Tools::displayPrice($rollup['wholesale_price'] / count($products), $currency).'</td>
<td>'.Tools::displayPrice($rollup['stockvalue'], $currency).'</td>
</tr>
</tfoot>
</table>
<p>* '.$this->l('This section corresponds to the default wholesale price according to the default supplier for the product. An average price is used when the product has attributes.').'</p></div>';
<i class="icon-asterisk"></i> '.$this->l('This section corresponds to the default wholesale price according to the default supplier for the product. An average price is used when the product has attributes.');
return $this->html;
}