29         if ($soxId != 
"-1" && isset($soxId)) {
 
   31             $oStat = 
oxNew(
"oxstatistic");
 
   34             $aReports = $oStat->getReports();
 
   35             $this->_aViewData[
"edit"] = $oStat;
 
   39         $sPath = getShopBasePath() . 
"application/controllers/admin/reports";
 
   41         $aAllreports = array();
 
   43         $aReportFiles = glob($sPath . 
"/*.php");
 
   44         foreach ($aReportFiles as $sFile) {
 
   45             if (is_file($sFile) && !is_dir($sFile)) {
 
   47                 $sConst = strtoupper(str_replace(
'.php', 
'', basename($sFile)));
 
   50                 if ($sConst == 
'REPORT_BASE') {
 
   56                 $oItem = 
new stdClass();
 
   57                 $oItem->filename = basename($sFile);
 
   58                 $oItem->name = $oLang->translateString($sConst, $iLanguage);
 
   59                 $aAllreports[] = $oItem;
 
   68         if (is_array($aReports)) {
 
   69             $this->_aViewData[
'ireports'] = count($aReports);
 
   73             $oStatisticMainAjax = 
oxNew(
'statistic_main_ajax');
 
   74             $this->_aViewData[
'oxajax'] = $oStatisticMainAjax->getColumns();
 
   76             return "popups/statistic_main.tpl";
 
   79         return "statistic_main.tpl";
 
   92         $oStat = 
oxNew(
"oxstatistic");
 
   96             $aParams[
'oxstatistics__oxid'] = null;
 
   99         $aParams[
'oxstatistics__oxshopid'] = $sShopID;
 
  100         $oStat->assign($aParams);
 
  117         $oStat = 
oxNew(
"oxstatistic");
 
  118         $oStat->load($soxId);
 
  120         $aAllreports = $oStat->getReports();
 
  122         $oShop = 
oxNew(
"oxshop");
 
  128         if ($sTimeFrom && $sTimeTo) {
 
  129             $sTimeFrom = 
oxRegistry::get(
"oxUtilsDate")->formatDBDate($sTimeFrom, 
true);
 
  130             $sTimeFrom = date(
"Y-m-d", strtotime($sTimeFrom));
 
  131             $sTimeTo = 
oxRegistry::get(
"oxUtilsDate")->formatDBDate($sTimeTo, 
true);
 
  132             $sTimeTo = date(
"Y-m-d", strtotime($sTimeTo));
 
  136             $sTimeFrom = date(
"Y-m-d", mktime(0, 0, 0, date(
"m", $dNow), date(
"d", $dNow) - $dDays, date(
"Y", $dNow)));
 
  137             $sTimeTo = date(
"Y-m-d", time());
 
  141         $oSmarty->assign(
"time_from", $sTimeFrom . 
" 23:59:59");
 
  142         $oSmarty->assign(
"time_to", $sTimeTo . 
" 23:59:59");
 
  143         $oSmarty->assign(
"oViewConf", $this->_aViewData[
"oViewConf"]);
 
  145         echo($oSmarty->fetch(
"report_pagehead.tpl"));
 
  146         foreach ($aAllreports as $file) {
 
  147             if (($file = trim($file))) {
 
  148                 $sClassName = str_replace(
".php", 
"", strtolower($file));
 
  150                 $oReport = 
oxNew($sClassName);
 
  151                 $oReport->setSmarty($oSmarty);
 
  153                 $oSmarty->assign(
"oView", $oReport);
 
  154                 echo($oSmarty->fetch($oReport->render()));