This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>statsnewsletter</name>
|
||||
<displayName>Newsletter</displayName>
|
||||
<version>1</version>
|
||||
<description>Display the newsletter registrations</description>
|
||||
<author>PrestaShop</author>
|
||||
<tab>analytics_stats</tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
</module>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Newsletter-Anmeldung anzeigen';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Anmeldungen von Kunden:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Anmeldungen von Besuchern:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'Beide:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'CSV-Export';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'Modul Newsletter Block muss installiert sein';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'Newsletter Statistik';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Kunden';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Besucher';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Beide';
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Mostrar suscripciones a la newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Suscripciones de clientes:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Suscripciones de visitantes';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'ambos:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'CSV Export';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'El módulo bloque newsletter debe instalarse';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'estadísticas de la newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clientes ';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitantes';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Ambos';
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Affiche les inscriptions à la newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Inscriptions depuis le compte client :';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Inscriptions depuis le block sur le front office :';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'Les deux :';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'Export CSV';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'Le module block newsletter doit être installé';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'Statistiques de la newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clients';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visiteurs';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Les deux';
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ffb7e666a70151215b4c55c6268d7d72'] = 'Newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_eb4337ccc2c2e7d7622d21554e1bcc25'] = 'Visualizza le iscrizioni alla newsletter';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_39d3d2445552ee17e870d7f64262669f'] = 'Iscrizioni da parte dei clienti:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_a6152725246f91ab908781d1d6345bc3'] = 'Iscrizioni da parte dei visitatori:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_64342cd480b27dfeefb08bace6e82fdc'] = 'Entrambi:';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_998e4c5c80f27dec552e99dfed34889a'] = 'Esporta CSV';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ce182d3cf87db4fd00942a586f16170a'] = 'Il modulo del blocco Newsletter deve essere installato';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_cf74c2815ab62be1efa55a4a5d3f46a4'] = 'Statistiche Newsletter ';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clienti';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_ae5d01b6efa819cc7a7c05a8c57fcc2c'] = 'Visitatori';
|
||||
$_MODULE['<{statsnewsletter}prestashop>statsnewsletter_130c5b3473c57faa76e2a1c54e26f88e'] = 'Entrambi';
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 983 B |
@@ -1,149 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class StatsNewsletter extends ModuleGraph
|
||||
{
|
||||
private $_html = '';
|
||||
private $_query = '';
|
||||
private $_query2 = '';
|
||||
private $_option = '';
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->name = 'statsnewsletter';
|
||||
$this->tab = 'analytics_stats';
|
||||
$this->version = 1.0;
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Newsletter');
|
||||
$this->description = $this->l('Display the newsletter registrations');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return (parent::install() AND $this->registerHook('AdminStatsModules'));
|
||||
}
|
||||
|
||||
public function hookAdminStatsModules($params)
|
||||
{
|
||||
if(Module::isInstalled('blocknewsletter'))
|
||||
{
|
||||
$totals = $this->getTotals();
|
||||
if (Tools::getValue('export'))
|
||||
$this->csvExport(array('type' => 'line', 'layers' => 3));
|
||||
$this->_html = '
|
||||
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
|
||||
<p>'.$this->l('Registrations from customers:').' '.(int)($totals['customers']).'</p>
|
||||
<p>'.$this->l('Registrations from visitors:').' '.(int)($totals['visitors']).'</p>
|
||||
<p>'.$this->l('Both:').' '.(int)($totals['both']).'</p>
|
||||
<center>'.ModuleGraph::engine(array('type' => 'line', 'layers' => 3)).'</center>
|
||||
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
|
||||
</fieldset>';
|
||||
}
|
||||
else
|
||||
$this->_html = '<p>'.$this->l('Module Newsletter Block must be installed').'</p>';
|
||||
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
private function getTotals()
|
||||
{
|
||||
$result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT COUNT(*) as customers
|
||||
FROM `'._DB_PREFIX_.'customer` c
|
||||
WHERE c.`newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween());
|
||||
$result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
|
||||
SELECT COUNT(*) as visitors
|
||||
FROM '._DB_PREFIX_.'newsletter n
|
||||
WHERE n.`newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween());
|
||||
return array('customers' => $result1['customers'], 'visitors' => $result2['visitors'], 'both' => $result1['customers'] + $result2['visitors']);
|
||||
}
|
||||
|
||||
protected function getData($layers)
|
||||
{
|
||||
$this->_titles['main'][0] = $this->l('Newsletter statistics');
|
||||
$this->_titles['main'][1] = $this->l('Customers');
|
||||
$this->_titles['main'][2] = $this->l('Visitors');
|
||||
$this->_titles['main'][3] = $this->l('Both');
|
||||
|
||||
$this->_query = '
|
||||
SELECT c.newsletter_date_add
|
||||
FROM `'._DB_PREFIX_.'customer` c
|
||||
WHERE c.`newsletter_date_add` BETWEEN ';
|
||||
$this->_query2 = '
|
||||
SELECT n.newsletter_date_add
|
||||
FROM '._DB_PREFIX_.'newsletter n
|
||||
WHERE n.`newsletter_date_add` BETWEEN ';
|
||||
$this->setDateGraph($layers, true);
|
||||
}
|
||||
|
||||
protected function setYearValues($layers)
|
||||
{
|
||||
$result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate());
|
||||
$result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query2.$this->getDate());
|
||||
foreach ($result1 AS $row)
|
||||
$this->_values[0][(int)(substr($row['newsletter_date_add'], 5, 2))] += 1;
|
||||
if ($result2)
|
||||
foreach ($result2 AS $row)
|
||||
$this->_values[1][(int)(substr($row['newsletter_date_add'], 5, 2))] += 1;
|
||||
foreach ($this->_values[2] as $key => $zerofill)
|
||||
$this->_values[2][$key] = $this->_values[0][$key] + $this->_values[1][$key];
|
||||
}
|
||||
|
||||
protected function setMonthValues($layers)
|
||||
{
|
||||
$result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate());
|
||||
$result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query2.$this->getDate());
|
||||
foreach ($result1 AS $row)
|
||||
$this->_values[0][(int)(substr($row['newsletter_date_add'], 8, 2))] += 1;
|
||||
if ($result2)
|
||||
foreach ($result2 AS $row)
|
||||
$this->_values[1][(int)(substr($row['newsletter_date_add'], 8, 2))] += 1;
|
||||
foreach ($this->_values[2] as $key => $zerofill)
|
||||
$this->_values[2][$key] = $this->_values[0][$key] + $this->_values[1][$key];
|
||||
}
|
||||
|
||||
protected function setDayValues($layers)
|
||||
{
|
||||
$result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate());
|
||||
$result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query2.$this->getDate());
|
||||
foreach ($result1 AS $row)
|
||||
$this->_values[0][(int)(substr($row['newsletter_date_add'], 11, 2))] += 1;
|
||||
if ($result2)
|
||||
foreach ($result2 AS $row)
|
||||
$this->_values[1][(int)(substr($row['newsletter_date_add'], 11, 2))] += 1;
|
||||
foreach ($this->_values[2] as $key => $zerofill)
|
||||
$this->_values[2][$key] = $this->_values[0][$key] + $this->_values[1][$key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user