26 if ( $soxId !=
"-1" && isset( $soxId)) {
28 $oStat =
oxNew(
"oxstatistic" );
29 $oStat->load( $soxId);
31 $aReports = $oStat->getReports();
32 $this->_aViewData[
"edit"] = $oStat;
36 $sPath = getShopBasePath().
"application/controllers/admin/reports";
38 $aAllreports = array();
40 $aReportFiles = glob( $sPath.
"/*.php" );
41 foreach ( $aReportFiles as $sFile ) {
42 if ( is_file( $sFile ) && !is_dir( $sFile ) ) {
44 $sConst = strtoupper( str_replace(
'.php',
'', basename( $sFile ) ) );
47 if ( $sConst ==
'REPORT_BASE') {
53 $oItem =
new stdClass();
54 $oItem->filename = basename( $sFile );
55 $oItem->name = $oLang->translateString( $sConst, $iLanguage );
56 $aAllreports[] = $oItem;
65 if ( is_array($aReports) ) {
66 $this->_aViewData[
'ireports'] = count($aReports);
70 $oStatisticMainAjax =
oxNew(
'statistic_main_ajax' );
71 $this->_aViewData[
'oxajax'] = $oStatisticMainAjax->getColumns();
73 return "popups/statistic_main.tpl";
76 return "statistic_main.tpl";
91 $oStat =
oxNew(
"oxstatistic" );
93 $oStat->load( $soxId);
95 $aParams[
'oxstatistics__oxid'] = null;
97 $aParams[
'oxstatistics__oxshopid'] = $sShopID;
98 $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() ) );