add group switch
This commit is contained in:
parent
759b22b764
commit
3e287f888a
@ -21,6 +21,15 @@ class d3_usersonline_statistic extends d3_cfg_mod_main
|
|||||||
|
|
||||||
protected $_sMenuSubItemTitle = 'd3mxusersonline_analysis';
|
protected $_sMenuSubItemTitle = 'd3mxusersonline_analysis';
|
||||||
|
|
||||||
|
public $blGroupByClass = false;
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$this->blGroupByClass = oxRegistry::getConfig()->getRequestParameter('groupbyclass') == 'true';
|
||||||
|
$this->addTplParam('blGroupByClass', $this->blGroupByClass);
|
||||||
|
return parent::render();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -29,7 +38,7 @@ class d3_usersonline_statistic extends d3_cfg_mod_main
|
|||||||
/** @var d3usersonline $oUsersOnline */
|
/** @var d3usersonline $oUsersOnline */
|
||||||
$oUsersOnline = oxNew('d3usersonline');
|
$oUsersOnline = oxNew('d3usersonline');
|
||||||
$oUsersOnline->clearOldItems($this->_iExpTime);
|
$oUsersOnline->clearOldItems($this->_iExpTime);
|
||||||
return $oUsersOnline->getUserCount();
|
return $oUsersOnline->getUserCount($this->blGroupByClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getControllerTitle($sControllerIdent)
|
public function getControllerTitle($sControllerIdent)
|
||||||
|
@ -66,12 +66,17 @@ class d3usersonline extends oxbase
|
|||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getUserCount()
|
public function getUserCount($blGroupByClass = false)
|
||||||
{
|
{
|
||||||
startProfile(__METHOD__);
|
startProfile(__METHOD__);
|
||||||
|
|
||||||
|
if ($blGroupByClass) {
|
||||||
|
$sSelect = "SELECT count(oxid) AS counter, oxclass FROM " .
|
||||||
|
$this->getViewName() . " GROUP BY oxclass ORDER BY counter DESC";
|
||||||
|
} else {
|
||||||
$sSelect = "select count(oxid) AS counter, oxclass, oxpage from ".
|
$sSelect = "select count(oxid) AS counter, oxclass, oxpage from ".
|
||||||
$this->getViewName()." GROUP BY oxclass, oxpage ORDER BY counter desc";
|
$this->getViewName()." GROUP BY oxclass, oxpage ORDER BY counter desc";
|
||||||
|
}
|
||||||
$aRecords = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getAll($sSelect);
|
$aRecords = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getAll($sSelect);
|
||||||
|
|
||||||
$iAllCounter = 0;
|
$iAllCounter = 0;
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
<!--
|
<!--
|
||||||
|
div.box h3 {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
fieldset {
|
fieldset {
|
||||||
border: 1px inset black;
|
border: 1px inset black;
|
||||||
background-color: #F0F0F0;
|
background-color: #F0F0F0;
|
||||||
@ -98,11 +102,13 @@
|
|||||||
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
|
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
|
||||||
<input type="hidden" name="actshop" value="[{$shop->id}]">
|
<input type="hidden" name="actshop" value="[{$shop->id}]">
|
||||||
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
|
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
|
||||||
|
<input type="hidden" id="groupbyclass" name="groupbyclass" value="false">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
[{d3modcfgcheck modid="d3usersonline"}][{/d3modcfgcheck}]
|
[{d3modcfgcheck modid="d3usersonline"}][{/d3modcfgcheck}]
|
||||||
[{if $mod_d3usersonline}]
|
[{if $mod_d3usersonline}]
|
||||||
[{assign var="aUsersOnline" value=$oView->getUserCount()}]
|
[{assign var="aUsersOnline" value=$oView->getUserCount()}]
|
||||||
|
<input id="groupbyclasscheckbox" value="1" type="checkbox" [{if $blGroupByClass}]checked[{/if}] onchange="document.getElementById('groupbyclass').value = this.checked; document.getElementById('transfer').submit();"> <label for="groupbyclasscheckbox">Besuche nach Shopseiten gruppieren</label>
|
||||||
<h3>[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</h3>
|
<h3>[{oxmultilang ident="D3_USERSONLINE_USERSONLINE"}]</h3>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<table style="border-style: none; width: 100%;">
|
<table style="border-style: none; width: 100%;">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user