本文整理汇总了PHP中ModuleGraph::getDateBetween方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleGraph::getDateBetween方法的具体用法?PHP ModuleGraph::getDateBetween怎么用?PHP ModuleGraph::getDateBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleGraph
的用法示例。
在下文中一共展示了ModuleGraph::getDateBetween方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTotalGuests
public function getTotalGuests()
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT COUNT(DISTINCT c.`id_guest`)
FROM `' . _DB_PREFIX_ . 'connections` c
WHERE c.`date_add` BETWEEN ' . ModuleGraph::getDateBetween());
}
示例2: hookAdminStatsModules
function hookAdminStatsModules()
{
$result = Db::getInstance()->ExecuteS($this->_query . ModuleGraph::getDateBetween() . $this->_query2);
$this->_html = '<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->displayName . '</legend>';
if ($result and sizeof($result)) {
$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('Occurences') . '</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 .= '</tbody></table></div>';
$this->_html .= '<center>' . ModuleGraph::engine(array('type' => 'pie')) . '</center><br class="clear" />' . $table;
} else {
$this->_html .= '<p><strong>' . $this->l('No keyword searched for more than once found') . '</strong></p>';
}
$this->_html .= '</fieldset><br class="clear" />
<fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> ' . $this->l('Guide') . '</legend>
<h2>' . $this->l('Identify external search engines keywords') . '</h2>
<p>' . $this->l('There are many ways to find a website, but one of the most common is to find it with a search engine. Identifying the most "visitor-making" keywords entered by your new visitors is really important, it allows you to see which product you have to put in front if you want more visitors and customers.') . '</p><br />
<h3>' . $this->l('How does it work?') . '</h2>
<p>' . $this->l('When a visitors comes to your website, the server knows its previous location. This module parses this URL and finds the keywords in it. Currently, it manages the following search engines:') . '<b> Google, AOL, Yandex, Ask, NHL, Yahoo, Baidu, Lycos, Exalead, Live, Voila</b> ' . $this->l('and') . ' <b>Altavista</b>. ' . $this->l('Soon it will be possible to add dynamically new search engine and to contribute to this module!') . '</p><br />
</fieldset>';
return $this->_html;
}
示例3: hookAdminStatsModules
function hookAdminStatsModules()
{
if (Tools::getValue('export')) {
$this->csvExport(array('type' => 'pie'));
}
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query . ModuleGraph::getDateBetween() . $this->_query2);
$this->_html = '
<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->displayName . '</legend>';
$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>';
foreach ($result as $row) {
$table .= '<tr>
<td>' . $row['keywords'] . '</td>
<td style="text-align: right">' . $row['occurences'] . '</td>
<td style="text-align: right">' . $row['total'] . '</td>
</tr>';
}
$table .= '</tbody></table></div>';
if (sizeof($result)) {
$this->_html .= '<center>' . ModuleGraph::engine(array('type' => 'pie')) . '</center>
<p><a href="' . $_SERVER['REQUEST_URI'] . '&export=1"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p>
<br class="clear" />' . $table;
} else {
$this->_html .= '<p><strong>' . $this->l('No keywords searched more than once found.') . '</strong></p>';
}
$this->_html .= '</fieldset>';
return $this->_html;
}
示例4: getEquipment
/**
* @return array Get list of browser "plugins" (javascript, media player, etc.)
*/
private function getEquipment()
{
$sql = 'SELECT DISTINCT g.*
FROM `' . _DB_PREFIX_ . 'connections` c
LEFT JOIN `' . _DB_PREFIX_ . 'guest` g ON g.`id_guest` = c.`id_guest`
WHERE c.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . '
' . Shop::addSqlRestriction(false, 'c');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->query($sql);
$calcArray = array('jsOK' => 0, 'jsKO' => 0, 'javaOK' => 0, 'javaKO' => 0, 'wmpOK' => 0, 'wmpKO' => 0, 'qtOK' => 0, 'qtKO' => 0, 'realOK' => 0, 'realKO' => 0, 'flashOK' => 0, 'flashKO' => 0, 'directorOK' => 0, 'directorKO' => 0);
while ($row = Db::getInstance(_PS_USE_SQL_SLAVE_)->nextRow($result)) {
if (!$row['javascript']) {
++$calcArray['jsKO'];
continue;
}
++$calcArray['jsOK'];
$row['windows_media'] ? ++$calcArray['wmpOK'] : ++$calcArray['wmpKO'];
$row['real_player'] ? ++$calcArray['realOK'] : ++$calcArray['realKO'];
$row['adobe_flash'] ? ++$calcArray['flashOK'] : ++$calcArray['flashKO'];
$row['adobe_director'] ? ++$calcArray['directorOK'] : ++$calcArray['directorKO'];
$row['sun_java'] ? ++$calcArray['javaOK'] : ++$calcArray['javaKO'];
$row['apple_quicktime'] ? ++$calcArray['qtOK'] : ++$calcArray['qtKO'];
}
if (!$calcArray['jsOK']) {
return false;
}
$equip = array('Windows Media Player' => $calcArray['wmpOK'] / ($calcArray['wmpOK'] + $calcArray['wmpKO']), 'Real Player' => $calcArray['realOK'] / ($calcArray['realOK'] + $calcArray['realKO']), 'Apple Quicktime' => $calcArray['qtOK'] / ($calcArray['qtOK'] + $calcArray['qtKO']), 'Sun Java' => $calcArray['javaOK'] / ($calcArray['javaOK'] + $calcArray['javaKO']), 'Adobe Flash' => $calcArray['flashOK'] / ($calcArray['flashOK'] + $calcArray['flashKO']), 'Adobe Shockwave' => $calcArray['directorOK'] / ($calcArray['directorOK'] + $calcArray['directorKO']));
arsort($equip);
return $equip;
}
示例5: getEquipment
private function getEquipment()
{
$result = mysql_query('
SELECT DISTINCT g.*
FROM `' . _DB_PREFIX_ . 'connections` c
LEFT JOIN `' . _DB_PREFIX_ . 'guest` g ON g.`id_guest` = c.`id_guest`
WHERE c.`date_add` BETWEEN ' . ModuleGraph::getDateBetween());
$calcArray = array('jsOK' => 0, 'jsKO' => 0, 'javaOK' => 0, 'javaKO' => 0, 'wmpOK' => 0, 'wmpKO' => 0, 'qtOK' => 0, 'qtKO' => 0, 'realOK' => 0, 'realKO' => 0, 'flashOK' => 0, 'flashKO' => 0, 'directorOK' => 0, 'directorKO' => 0);
while ($row = mysql_fetch_assoc($result)) {
if (!$row['javascript']) {
++$calcArray['jsKO'];
continue;
}
++$calcArray['jsOK'];
$row['windows_media'] ? ++$calcArray['wmpOK'] : ++$calcArray['wmpKO'];
$row['real_player'] ? ++$calcArray['realOK'] : ++$calcArray['realKO'];
$row['adobe_flash'] ? ++$calcArray['flashOK'] : ++$calcArray['flashKO'];
$row['adobe_director'] ? ++$calcArray['directorOK'] : ++$calcArray['directorKO'];
$row['sun_java'] ? ++$calcArray['javaOK'] : ++$calcArray['javaKO'];
$row['apple_quicktime'] ? ++$calcArray['qtOK'] : ++$calcArray['qtKO'];
}
mysql_free_result($result);
if (!$calcArray['jsOK']) {
return false;
}
$equip = array('Windows Media Player' => $calcArray['wmpOK'] / ($calcArray['wmpOK'] + $calcArray['wmpKO']), 'Real Player' => $calcArray['realOK'] / ($calcArray['realOK'] + $calcArray['realKO']), 'Apple Quicktime' => $calcArray['qtOK'] / ($calcArray['qtOK'] + $calcArray['qtKO']), 'Sun Java' => $calcArray['javaOK'] / ($calcArray['javaOK'] + $calcArray['javaKO']), 'Adobe Flash' => $calcArray['flashOK'] / ($calcArray['flashOK'] + $calcArray['flashKO']), 'Adobe Shockwave' => $calcArray['directorOK'] / ($calcArray['directorOK'] + $calcArray['directorKO']));
arsort($equip);
return $equip;
}
示例6: getTotalGuests
public function getTotalGuests()
{
$sql = 'SELECT COUNT(DISTINCT c.`id_guest`)
FROM `' . _DB_PREFIX_ . 'connections` c
WHERE c.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . '
' . Shop::addSqlRestriction(false, 'c');
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
}
示例7: getFirstBuyers
public function getFirstBuyers()
{
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT COUNT(DISTINCT o.`id_customer`) as buyers
FROM `' . _DB_PREFIX_ . 'orders` o
LEFT JOIN `' . _DB_PREFIX_ . 'guest` g ON o.id_customer = g.id_customer
LEFT JOIN `' . _DB_PREFIX_ . 'connections` c ON c.id_guest = g.id_guest
WHERE o.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . ' AND o.valid = 1
AND ABS(TIMEDIFF(o.date_add, c.date_add)+0) < 120000');
return $result['buyers'];
}
示例8: getTotals
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']);
}
示例9: getTotalViewed
public function getTotalViewed($id_product)
{
$dateBetween = ModuleGraph::getDateBetween();
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT SUM(pv.`counter`) AS total
FROM `' . _DB_PREFIX_ . 'page_viewed` pv
LEFT JOIN `' . _DB_PREFIX_ . 'date_range` dr ON pv.`id_date_range` = dr.`id_date_range`
LEFT JOIN `' . _DB_PREFIX_ . 'page` p ON pv.`id_page` = p.`id_page`
LEFT JOIN `' . _DB_PREFIX_ . 'page_type` pt ON pt.`id_page_type` = p.`id_page_type`
WHERE pt.`name` = \'product.php\'
AND p.`id_object` = ' . (int) $id_product . '
AND dr.`time_start` BETWEEN ' . $dateBetween . '
AND dr.`time_end` BETWEEN ' . $dateBetween . '');
return isset($result['total']) ? $result['total'] : 0;
}
示例10: getTotals
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 ' . _DB_PREFIX_ . 'newsletter
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']);
}
示例11: hookAdminStatsModules
public function hookAdminStatsModules()
{
$websites = $this->getOrigins(ModuleGraph::getDateBetween());
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>';
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>';
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>';
} 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>';
return $this->_html;
}
示例12: hookAdminStatsModules
function hookAdminStatsModules()
{
$websites = $this->getOrigins(ModuleGraph::getDateBetween());
if (Tools::getValue('export')) {
if (Tools::getValue('exportType') == 'top') {
$this->csvExport(array('type' => 'pie'));
}
}
$this->_html = '<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->l('Origin') . '</legend>';
if (sizeof($websites)) {
$this->_html .= '
<center><p><img src="../img/admin/down.gif" />' . $this->l('Here is the percentage of the 10 most popular referrer websites by which visitors went through to get to your shop.') . '</p>
' . ModuleGraph::engine(array('type' => 'pie')) . '</center>
<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=top"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p><br /><br />
<div style="overflow-y: scroll; height: 600px;">
<center>
<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>';
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></center></div>';
} else {
$this->_html .= '<p><strong>' . $this->l('Direct links only') . '</strong></p>';
}
$this->_html .= '</fieldset><br />
<fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> ' . $this->l('Guide') . '</legend>
<h2>' . $this->l('What is a referrer 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 are entered by visitors in search engines when getting to your shop and allows you to optimize web promotion.') . '<br /><br />
' . $this->l('A referrer can be:') . '
<ul>
<li class="bullet">' . $this->l('Someone who put a link on their website for your shop') . '</li>
<li class="bullet">' . $this->l('A partner with whom you made a link exchange in order to bring in sales or attract new customers') . '</li>
</ul>
</p>
</fieldset>';
return $this->_html;
}
示例13: getData
protected function getData($layers)
{
$stateQuery = '';
if (intval($this->_option)) {
$stateQuery = 'AND (SELECT oh.id_order_state FROM `' . _DB_PREFIX_ . 'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = ' . intval($this->_option);
}
$this->_titles['main'] = $this->l('Percentage of orders by carrier');
$result = Db::getInstance()->ExecuteS('
SELECT c.name, COUNT(DISTINCT o.`id_order`) as total
FROM `' . _DB_PREFIX_ . 'carrier` c
LEFT JOIN `' . _DB_PREFIX_ . 'orders` o ON o.id_carrier = c.id_carrier
WHERE o.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . '
' . $stateQuery . '
GROUP BY c.`id_carrier`');
foreach ($result as $row) {
$this->_values[] = $row['total'];
$this->_legend[] = $row['name'];
}
}
示例14: hookAdminStatsModules
public function hookAdminStatsModules()
{
if (Tools::getValue('export')) {
$this->csvExport(array('type' => 'pie'));
}
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query . ModuleGraph::getDateBetween() . $this->query_group_by);
$this->html = '
<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>' . $row['occurences'] . '</td>
<td>' . $row['total'] . '</td>
</tr>';
}
}
$table .= '
</tbody>
</table>';
if (count($result)) {
$this->html .= '<div>' . $this->engine(array('type' => 'pie')) . '</div>
<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('Cannot find any keywords that have been searched for more than once.') . '</p>';
}
return $this->html;
}
示例15: getPages
private function getPages()
{
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT http_referer, request_uri, COUNT(*) as nb
FROM `' . _DB_PREFIX_ . 'pagenotfound` p
WHERE p.date_add BETWEEN ' . ModuleGraph::getDateBetween() . '
GROUP BY http_referer, request_uri');
$pages = array();
foreach ($result as $row) {
$row['http_referer'] = parse_url($row['http_referer'], PHP_URL_HOST) . parse_url($row['http_referer'], PHP_URL_PATH);
if (!isset($row['http_referer']) or empty($row['http_referer'])) {
$row['http_referer'] = '--';
}
if (!isset($pages[$row['request_uri']])) {
$pages[$row['request_uri']] = array('nb' => 0);
}
$pages[$row['request_uri']][$row['http_referer']] = $row['nb'];
$pages[$row['request_uri']]['nb'] += $row['nb'];
}
uasort($pages, 'pnfSort');
return $pages;
}