OXID eShop CE  4.9.10
 All Classes Files Functions Variables Pages
statistic_service.php
Go to the documentation of this file.
1 <?php
2 
9 {
10 
17  public function render()
18  {
20  $sSql = "select count(*) from oxlogs where oxshopid = '" . $this->getConfig()->getShopId() . "'";
21  $this->_aViewData['iLogCount'] = oxDb::getDb()->getOne($sSql, false, false);
22 
23  return "statistic_service.tpl";
24  }
25 
29  public function cleanup()
30  {
31  $iTimeFrame = oxRegistry::getConfig()->getRequestParameter("timeframe");
32  $dNow = time();
33  $iTimestamp = mktime(
34  date("H", $dNow),
35  date("i", $dNow),
36  date("s", $dNow),
37  date("m", $dNow),
38  date("d", $dNow) - $iTimeFrame,
39  date("Y", $dNow)
40  );
41  $sDeleteFrom = date("Y-m-d H:i:s", $iTimestamp);
42 
43  $oDb = oxDb::getDb();
44  $oDb->Execute("delete from oxlogs where oxtime < " . $oDb->quote($sDeleteFrom));
45  }
46 }