statistic_service.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class Statistic_Service extends oxAdminDetails
00009 {
00010 
00017     public function render()
00018     {
00019         parent::render();
00020         $sSql = "select count(*) from oxlogs where oxshopid = '" . $this->getConfig()->getShopId() . "'";
00021         $this->_aViewData['iLogCount'] = oxDb::getDb()->getOne($sSql, false, false);
00022 
00023         return "statistic_service.tpl";
00024     }
00025 
00029     public function cleanup()
00030     {
00031         $iTimeFrame = oxRegistry::getConfig()->getRequestParameter("timeframe");
00032         $dNow = time();
00033         $iTimestamp = mktime(
00034             date("H", $dNow),
00035             date("i", $dNow),
00036             date("s", $dNow),
00037             date("m", $dNow),
00038             date("d", $dNow) - $iTimeFrame,
00039             date("Y", $dNow)
00040         );
00041         $sDeleteFrom = date("Y-m-d H:i:s", $iTimestamp);
00042 
00043         $oDb = oxDb::getDb();
00044         $oDb->Execute("delete from oxlogs where oxtime < " . $oDb->quote($sDeleteFrom));
00045     }
00046 }