| Name | Size | Mode | Actions |
|---|---|---|---|
| translations/ | - | 0755 | rm |
| upgrade/ | - | 0755 | rm |
| config.xml | 493 | 0755 | editdlrm |
| index.php | 1449 | 0755 | editdlrm |
| logo.gif | 983 | 0755 | editdlrm |
| logo.png | 4009 | 0755 | editdlrm |
| statsnewsletter.php | 8418 | 0755 | editdlrm |
/home/sharedstore/public_html/prestashop.sharedstore.ma/modules/statsnewsletter/statsnewsletter.php (8418B)
'.$this->trans('The %s module must be installed.', array($this->newsletter_module_human_readable_name), 'Modules.Statsnewsletter.Admin').'
'; } return $this->_html; } private function getTotals() { $sql = 'SELECT COUNT(*) as customers FROM `'._DB_PREFIX_.'customer` WHERE 1 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' AND `newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween(); $result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); $sql = 'SELECT COUNT(*) as visitors FROM ' . $this->table_name . ' WHERE 1 '.Shop::addSqlRestriction().' AND `newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween(); $result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); return array('customers' => $result1['customers'], 'visitors' => $result2['visitors'], 'both' => $result1['customers'] + $result2['visitors']); } protected function getData($layers) { $this->_titles['main'][0] = $this->trans('Newsletter statistics', array(), 'Modules.Statsnewsletter.Admin'); $this->_titles['main'][1] = $this->trans('customers', array(), 'Admin.Global'); $this->_titles['main'][2] = $this->trans('Visitors', array(), 'Admin.Shopparameters.Feature'); $this->_titles['main'][3] = $this->trans('Both', array(), 'Admin.Advparameters.Feature'); $this->_query = 'SELECT newsletter_date_add FROM `'._DB_PREFIX_.'customer` WHERE 1 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' AND `newsletter_date_add` BETWEEN '; $this->_query2 = 'SELECT newsletter_date_add FROM ' . $this->table_name . ' WHERE 1 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' AND `newsletter_date_add` BETWEEN '; $this->setDateGraph($layers, true); } protected function setAllTimeValues($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'], 0, 4)] += 1; } if ($result2) { foreach ($result2 as $row) { $this->_values[1][(int)substr($row['newsletter_date_add'], 0, 4)] += 1; } } foreach ($this->_values[2] as $key => $zerofill) { $this->_values[2][$key] = $this->_values[0][$key] + $this->_values[1][$key]; } } 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]; } } }