/**
  * The final "child" implementation of the parental abstract method.
  *
  * @see OA_Admin_Statistics_Common::start()
  */
 function start()
 {
     // Get the preferences
     $aPref = $GLOBALS['_MAX']['PREF'];
     // Get parameters
     $advertiserId = $this->_getId('advertiser');
     $placementId = $this->_getId('placement');
     // Security check
     OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
     $this->_checkAccess(array('advertiser' => $advertiserId, 'placement' => $placementId));
     // Add standard page parameters
     $this->aPageParams = array('clientid' => $advertiserId, 'campaignid' => $placementId);
     // Load the period preset and stats breakdown parameters
     $this->_loadPeriodPresetParam();
     $this->_loadStatsBreakdownParam();
     // Load $_GET parameters
     $this->_loadParams();
     // HTML Framework
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $this->pageId = '2.1.2.2';
         $this->aPageSections = array('2.1.2.1', '2.1.2.2', '2.1.2.3', '2.1.2.4');
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->pageId = '1.2.2';
         $this->aPageSections = array('1.2.1', '1.2.2', '1.2.3');
     }
     // Add breadcrumbs
     $this->_addBreadcrumbs('campaign', $placementId);
     // Add context
     $this->aPageContext = array('campaigns', $placementId);
     // Add shortcuts
     if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->_addShortcut($GLOBALS['strClientProperties'], 'advertiser-edit.php?clientid=' . $advertiserId, 'images/icon-advertiser.gif');
     }
     $this->_addShortcut($GLOBALS['strCampaignProperties'], 'campaign-edit.php?clientid=' . $advertiserId . '&campaignid=' . $placementId, 'images/icon-campaign.gif');
     $this->hideInactive = MAX_getStoredValue('hideinactive', $aPref['ui_hide_inactive'] == true, null, true);
     $this->showHideInactive = true;
     $this->startLevel = 0;
     // Init nodes
     $this->aNodes = MAX_getStoredArray('nodes', array());
     $expand = MAX_getValue('expand', '');
     $collapse = MAX_getValue('collapse');
     // Adjust which nodes are opened closed...
     MAX_adjustNodes($this->aNodes, $expand, $collapse);
     $aParams = $this->coreParams;
     $aParams['placement_id'] = $placementId;
     $this->aEntitiesData = $this->getBanners($aParams, $this->startLevel, $expand);
     // Summarise the values into a the totals array, & format
     $this->_summariseTotalsAndFormat($this->aEntitiesData);
     $this->showHideLevels = array();
     $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveBannersHidden']}";
     // Save prefs
     $this->aPagePrefs['startlevel'] = $this->startLevel;
     $this->aPagePrefs['nodes'] = implode(",", $this->aNodes);
     $this->aPagePrefs['hideinactive'] = $this->hideInactive;
     $this->aPagePrefs['startlevel'] = $this->startLevel;
 }
 /**
  * The final "child" implementation of the parental abstract method.
  *
  * @see OA_Admin_Statistics_Common::start()
  */
 function start()
 {
     // Get the preferences
     $aPref = $GLOBALS['_MAX']['PREF'];
     // Security check
     OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER);
     // HTML Framework
     $this->pageId = '2.4';
     $this->aPageSections = array('2.1', '2.4', '2.2');
     $this->hideInactive = MAX_getStoredValue('hideinactive', $aPref['ui_hide_inactive'] == true, null, true);
     $this->showHideInactive = true;
     $this->startLevel = MAX_getStoredValue('startlevel', 0, null, true);
     // Init nodes
     $this->aNodes = MAX_getStoredArray('nodes', array());
     $expand = MAX_getValue('expand', '');
     $collapse = MAX_getValue('collapse');
     // Adjust which nodes are opened closed...
     MAX_adjustNodes($this->aNodes, $expand, $collapse);
     $aParams = $this->coreParams;
     if (!OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
         $aParams['agency_id'] = OA_Permission::getAgencyId();
     }
     // Add module page parameters
     $this->aPageParams['period_preset'] = MAX_getStoredValue('period_preset', 'today');
     $this->aPageParams['statsBreakdown'] = htmlspecialchars(MAX_getStoredValue('statsBreakdown', 'day'));
     $this->_loadParams();
     switch ($this->startLevel) {
         case 1:
             $this->aEntitiesData = $this->getZones($aParams, $this->startLevel, $expand);
             break;
         default:
             $this->startLevel = 0;
             $this->aEntitiesData = $this->getPublishers($aParams, $this->startLevel, $expand);
             break;
     }
     // Summarise the values into a the totals array, & format
     $this->_summariseTotalsAndFormat($this->aEntitiesData);
     $this->showHideLevels = array();
     switch ($this->startLevel) {
         case 1:
             $this->showHideLevels = array(0 => array('text' => $GLOBALS['strShowParentAffiliates'], 'icon' => 'images/icon-affiliate.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveZonesHidden']}";
             break;
         case 0:
             $this->showHideLevels = array(1 => array('text' => $GLOBALS['strHideParentAffiliates'], 'icon' => 'images/icon-affiliate-d.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveAffiliatesHidden']}";
             break;
     }
     // Save prefs
     $this->aPagePrefs['startlevel'] = $this->startLevel;
     $this->aPagePrefs['nodes'] = implode(",", $this->aNodes);
     $this->aPagePrefs['hideinactive'] = $this->hideInactive;
     $this->aPagePrefs['startlevel'] = $this->startLevel;
 }
 /**
  * The final "child" implementation of the parental abstract method.
  *
  * @see OA_Admin_Statistics_Common::start()
  */
 function start()
 {
     // Get the preferences
     $aPref = $GLOBALS['_MAX']['PREF'];
     // Get parameters
     $publisherId = $this->_getId('publisher');
     $zoneId = $this->_getId('zone');
     // Security check
     OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_TRAFFICKER);
     $this->_checkAccess(array('publisher' => $publisherId, 'zone' => $zoneId));
     // Add standard page parameters
     $this->aPageParams = array('affiliateid' => $publisherId, 'zoneid' => $zoneId);
     // Load the period preset and stats breakdown parameters
     $this->_loadPeriodPresetParam();
     $this->_loadStatsBreakdownParam();
     // Load $_GET parameters
     $this->_loadParams();
     // HTML Framework
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $this->pageId = '2.4.2.2';
         $this->aPageSections = array('2.4.2.1', '2.4.2.2');
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         $this->pageId = '1.2.2';
         $this->aPageSections = array('1.2.1', '1.2.2');
     }
     // Add breadcrumbs
     $this->_addBreadcrumbs('zone', $zoneId);
     // Add context
     $this->aPageContext = array('zones', $zoneId);
     // Add shortcuts
     if (!OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         $this->_addShortcut($GLOBALS['strAffiliateProperties'], 'affiliate-edit.php?affiliateid=' . $publisherId, 'images/icon-affiliate.gif');
     }
     $this->_addShortcut($GLOBALS['strZoneProperties'], 'zone-edit.php?affiliateid=' . $publisherId . '&zoneid=' . $zoneId, 'images/icon-zone.gif');
     // Fix entity links
     $this->entityLinks['c'] = 'stats.php?entity=zone&breakdown=campaign-history';
     $this->entityLinks['b'] = 'stats.php?entity=zone&breakdown=banner-history';
     $this->hideInactive = MAX_getStoredValue('hideinactive', $aPref['ui_hide_inactive'] == true, null, true);
     $this->showHideInactive = true;
     $this->startLevel = MAX_getStoredValue('startlevel', 0, null, true);
     // Init nodes
     $this->aNodes = MAX_getStoredArray('nodes', array());
     $expand = MAX_getValue('expand', '');
     $collapse = MAX_getValue('collapse');
     // Adjust which nodes are opened closed...
     MAX_adjustNodes($this->aNodes, $expand, $collapse);
     $aParams = $this->coreParams;
     $aParams['zone_id'] = $zoneId;
     switch ($this->startLevel) {
         case 1:
             $this->aEntitiesData = $this->getBanners($aParams, $this->startLevel, $expand, true);
             break;
         default:
             $this->startLevel = 0;
             $this->aEntitiesData = $this->getCampaigns($aParams, $this->startLevel, $expand);
             break;
     }
     // Summarise the values into a the totals array, & format
     $this->_summariseTotalsAndFormat($this->aEntitiesData);
     $this->showHideLevels = array();
     switch ($this->startLevel) {
         case 1:
             $this->showHideLevels = array(0 => array('text' => $GLOBALS['strShowParentCampaigns'], 'icon' => 'images/icon-campaign.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveBannersHidden']}";
             break;
         case 0:
             $this->showHideLevels = array(1 => array('text' => $GLOBALS['strHideParentCampaigns'], 'icon' => 'images/icon-campaign-d.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveCampaignsHidden']}";
             break;
     }
     // Add standard page parameters
     $this->aPageParams = array('affiliateid' => $publisherId, 'zoneid' => $zoneId);
     $this->aPageParams['period_preset'] = MAX_getStoredValue('period_preset', 'today');
     $this->aPageParams['statsBreakdown'] = htmlspecialchars(MAX_getStoredValue('statsBreakdown', 'day'));
     $this->_loadParams();
     // Save prefs
     $this->aPagePrefs['startlevel'] = $this->startLevel;
     $this->aPagePrefs['nodes'] = implode(",", $this->aNodes);
     $this->aPagePrefs['hideinactive'] = $this->hideInactive;
     $this->aPagePrefs['startlevel'] = $this->startLevel;
 }
Пример #4
0
 /**
  * The final "child" implementation of the parental abstract method.
  *
  * @see OA_Admin_Statistics_Common::start()
  */
 function start()
 {
     // Get the preferences
     $aPref = $GLOBALS['_MAX']['PREF'];
     // Get parameters
     $advertiserId = $this->_getId('advertiser');
     $placementId = $this->_getId('placement');
     $adId = $this->_getId('ad');
     // Security check
     OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
     $this->_checkAccess(array('advertiser' => $advertiserId, 'placement' => $placementId, 'ad' => $adId));
     // Add standard page parameters
     $this->aPageParams = array('clientid' => $advertiserId, 'campaignid' => $placementId, 'bannerid' => $adId);
     // Load the period preset and stats breakdown parameters
     $this->_loadPeriodPresetParam();
     $this->_loadStatsBreakdownParam();
     // Load $_GET parameters
     $this->_loadParams();
     // HTML Framework
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $this->pageId = '2.1.2.2.2';
         $this->aPageSections = array('2.1.2.2.1', '2.1.2.2.2', '2.1.2.2.3');
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->pageId = '1.2.2.4';
         $this->aPageSections[] = '1.2.2.1';
         if (OA_Permission::hasPermission(OA_PERM_BANNER_EDIT)) {
             $this->aPageSections[] = '1.2.2.2';
         }
         $this->aPageSections[] = '1.2.2.4';
     }
     // Add breadcrumbs
     $this->_addBreadcrumbs('banner', $adId);
     // Add context
     $this->aPageContext = array('banners', $adId);
     // Add shortcuts
     if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $this->_addShortcut($GLOBALS['strClientProperties'], 'advertiser-edit.php?clientid=' . $advertiserId, 'images/icon-advertiser.gif');
     }
     $this->_addShortcut($GLOBALS['strCampaignProperties'], 'campaign-edit.php?clientid=' . $advertiserId . '&campaignid=' . $placementId, 'images/icon-campaign.gif');
     $this->_addShortcut($GLOBALS['strBannerProperties'], 'banner-edit.php?clientid=' . $advertiserId . '&campaignid=' . $placementId . '&bannerid=' . $adId, 'images/icon-banner-stored.gif');
     $this->_addShortcut($GLOBALS['strModifyBannerAcl'], 'banner-acl.php?clientid=' . $advertiserId . '&campaignid=' . $placementId . '&bannerid=' . $adId, 'images/icon-acl.gif');
     // Fix entity links
     $this->entityLinks['p'] = 'stats.php?entity=banner&breakdown=affiliate-history';
     $this->entityLinks['z'] = 'stats.php?entity=banner&breakdown=zone-history';
     $this->hideInactive = MAX_getStoredValue('hideinactive', $aPref['ui_hide_inactive'] == true, null, true);
     $this->showHideInactive = true;
     $this->startLevel = MAX_getStoredValue('startlevel', 0, null, true);
     // Init nodes
     $this->aNodes = MAX_getStoredArray('nodes', array());
     $expand = MAX_getValue('expand', '');
     $collapse = MAX_getValue('collapse');
     // Adjust which nodes are opened closed...
     MAX_adjustNodes($this->aNodes, $expand, $collapse);
     $aParams = array();
     $aParams['ad_id'] = $adId;
     switch ($this->startLevel) {
         case 1:
             $this->aEntitiesData = $this->getZones($aParams, $this->startLevel, $expand, true);
             break;
         default:
             $this->startLevel = 0;
             $this->aEntitiesData = $this->getPublishers($aParams, $this->startLevel, $expand);
             break;
     }
     // Summarise the values into a the totals array, & format
     $this->_summariseTotalsAndFormat($this->aEntitiesData);
     $this->showHideLevels = array();
     switch ($this->startLevel) {
         case 1:
             $this->showHideLevels = array(0 => array('text' => $GLOBALS['strShowParentAffiliates'], 'icon' => 'images/icon-affiliate.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveZonesHidden']}";
             break;
         case 0:
             $this->showHideLevels = array(1 => array('text' => $GLOBALS['strHideParentAffiliates'], 'icon' => 'images/icon-affiliate-d.gif'));
             $this->hiddenEntitiesText = "{$this->hiddenEntities} {$GLOBALS['strInactiveAffiliatesHidden']}";
             break;
     }
     // Save prefs
     $this->aPagePrefs['startlevel'] = $this->startLevel;
     $this->aPagePrefs['nodes'] = implode(",", $this->aNodes);
     $this->aPagePrefs['hideinactive'] = $this->hideInactive;
 }
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/max/other/common.php';
require_once MAX_PATH . '/lib/max/Admin_DA.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/max/other/stats.php';
require_once 'Pager/Pager.php';
require_once MAX_PATH . '/lib/pear/Date.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
// Get input variables
$pref = $GLOBALS['_MAX']['PREF'];
$hideinactive = MAX_getStoredValue('hideinactive', $pref['ui_hide_inactive'] == true, null, true);
$listorder = MAX_getStoredValue('listorder', 'date_time');
$orderdirection = MAX_getStoredValue('orderdirection', 'up');
$aNodes = MAX_getStoredArray('nodes', array());
$editStatuses = MAX_getStoredValue('editStatuses', false, null, true);
$day = MAX_getStoredValue('day', null, 'stats-conversions.php');
$howLong = MAX_getStoredValue('howLong', 'd');
$hour = MAX_getStoredValue('hour', null, 'stats-conversions.php', true);
$setPerPage = MAX_getStoredValue('setPerPage', 15);
$pageID = MAX_getStoredValue('pageID', 1);
if (!empty($day)) {
    // Reset period
    $period_preset = '';
    // Always refresh howLong and hour
    $howLong = MAX_getValue('howLong', 'd');
    $hour = MAX_getValue('hour');
} else {
    $period_preset = MAX_getStoredValue('period_preset', 'today');
    $period_start = MAX_getStoredValue('period_start', date('Y-m-d'));