• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Admin_DA类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Admin_DA的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA类的具体用法?PHP Admin_DA怎么用?PHP Admin_DA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Admin_DA类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getSpan

 /**
  * A method that can be inherited and used by children classes to get the
  * required date span of a statistics page.
  *
  * @param object $oCaller      The calling object. Expected to have the
  *                             the following class variables:
  *                                  $oCaller->aPlugins    - An array of statistics fields plugins
  *                                  $oCaller->oStartDate  - Will be set by method
  *                                  $oCaller->spanDays    - Will be set by method
  *                                  $oCaller->spanWeeks   - Will be set by method
  *                                  $oCaller->spanMonths  - Will be set by method
  * @param array  $aParams      An array of query parameters for
  *                             {@link Admin_DA::fromCache()}.
  */
 function getSpan(&$oCaller, $aParams)
 {
     $oStartDate = new Date(date('Y-m-d'));
     $oStartDate->setHour(0);
     $oStartDate->setMinute(0);
     $oStartDate->setSecond(0);
     // Check span using all plugins
     foreach ($oCaller->aPlugins as $oPlugin) {
         $aPluginParams = call_user_func(array($oPlugin, 'getHistorySpanParams'));
         $aSpan = Admin_DA::fromCache('getHistorySpan', $aParams + $aPluginParams);
         if (!empty($aSpan['start_date'])) {
             $oDate = new Date($aSpan['start_date']);
             $oDate->setTZbyID('UTC');
             if ($oDate->before($oStartDate)) {
                 $oDate->convertTZ($oStartDate->tz);
                 $oStartDate = new Date($oDate);
             }
         }
     }
     $oStartDate->setHour(0);
     $oStartDate->setMinute(0);
     $oStartDate->setSecond(0);
     $oNow = new Date();
     $oSpan = new Date_Span(new Date($oStartDate), new Date($oNow->format('%Y-%m-%d')));
     // Store the span data required for stats display
     $oCaller->oStartDate = $oStartDate;
     $oCaller->spanDays = (int) ceil($oSpan->toDays());
     $oCaller->spanWeeks = (int) ceil($oCaller->spanDays / 7) + ($oCaller->spanDays % 7 ? 1 : 0);
     $oCaller->spanMonths = ($oNow->getYear() - $oStartDate->getYear()) * 12 + ($oNow->getMonth() - $oStartDate->getMonth()) + 1;
     // Set the caller's aDates span in the event that it's empty
     if (empty($oCaller->aDates)) {
         $oCaller->aDates['day_begin'] = $oStartDate->format('%Y-%m-%d');
         $oCaller->aDates['day_end'] = $oNow->format('%Y-%m-%d');
     }
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:49,代码来源:History.php


示例2: beforePageHeader

 public function beforePageHeader(OX_Admin_UI_Event_EventContext $oEventContext)
 {
     $pageId = $oEventContext->data['pageId'];
     $pageData = $oEventContext->data['pageData'];
     $oHeaderModel = $oEventContext->data['headerModel'];
     $agencyId = $pageData['agencyid'];
     $campaignId = $pageData['campaignid'];
     $advertiserId = $pageData['clientid'];
     $oEntityHelper = $this->oMarkedTextAdvertiserComponent->getEntityHelper();
     if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         switch ($pageId) {
             case 'campaign-banners':
                 $oDalZones = OA_Dal::factoryDAL('zones');
                 $linkedWebsites = $oDalZones->getWebsitesAndZonesListByCategory($agencyId, null, $campaignId, true);
                 $arraylinkedWebsitesKeys = array_keys($linkedWebsites);
                 $linkedWebsitesKey = $arraylinkedWebsitesKeys[0];
                 $arraylinkedZonesKeys = array_keys($linkedWebsites[$linkedWebsitesKey]['zones']);
                 $zoneId = $arraylinkedZonesKeys[0];
                 $aZone = Admin_DA::getZone($zoneId);
                 if ($aZone['type'] == 3) {
                     if (OA_Permission::hasAccessToObject('clients', $clientid) && OA_Permission::hasAccessToObject('campaigns', $campaignid)) {
                         OX_Admin_Redirect::redirect('plugins/' . $this->oMarkedTextAdvertiserComponent->group . "/oxMarkedTextAdvertiser-index.php?campaignid={$campaignId}&clientid={$advertiserId}");
                     }
                 }
                 break;
         }
     }
 }
开发者ID:rcdesign-cemetery,项目名称:openx-markedtext,代码行数:28,代码来源:EntityScreenManager.php


示例3: getZones

 function getZones()
 {
     global $list_filters;
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
         $aParams = array();
         $aPublishers = Admin_DA::getPublishers($aParams);
         // set publisher id if list is to be filtered by publisher
         if (isset($list_filters['publisher'])) {
             $aParams = array('publisher_id' => $list_filters['publisher']);
         } else {
             // else use all publishers
             $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         }
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $aParams = array('agency_id' => OA_Permission::getEntityId());
         $aPublishers = Admin_DA::getPublishers($aParams);
         // set publisher id if list is to be filtered by publisher
         if (isset($list_filters['publisher'])) {
             $aParams = array('publisher_id' => $list_filters['publisher']);
         } else {
             // else use all of this agency's publishers
             $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         }
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         $aParams = array('publisher_id' => OA_Permission::getEntityId());
         $aPublishers = Admin_DA::getPublishers($aParams);
         $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } else {
         $aPublishers = array();
         $aZones = array();
     }
     $aZoneArray = array();
     foreach ($aPublishers as $publisherId => $aPublisher) {
         foreach ($aZones as $zoneId => $aZone) {
             if ($aZone['publisher_id'] == $publisherId) {
                 $aZoneArray[$zoneId] = phpads_buildName($publisherId, MAX_getPublisherName($aPublisher['name'])) . " - " . phpAds_buildName($zoneId, MAX_getZoneName($aZone['name']));
             }
         }
     }
     return $aZoneArray;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:53,代码来源:ZoneIdField.php


示例4: display

 function display()
 {
     $aParams = array();
     if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $aParams['agency_id'] = OA_Permission::getEntityId();
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         $aParams['advertiser_id'] = OA_Permission::getEntityId();
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         $aParams['publisher_id'] = OA_Permission::getEntityId();
     }
     $aPlacements = Admin_DA::getPlacements($aParams, true);
     $aPlacements = $this->multiSort($aPlacements, "name", true);
     echo "\n        <select name='{$this->_name}' tabindex='" . $this->_tabIndex++ . "'>";
     foreach ($aPlacements as $aPlacement) {
         $selected = $aPlacement['placement_id'] == $this->getValue() ? " selected='selected'" : '';
         $name = MAX_getPlacementName($aPlacement);
         echo "\n            <option value='{$aPlacement['placement_id']}'{$selected}>" . htmlspecialchars($name) . "</option>";
     }
     echo "\n        </select>";
 }
开发者ID:villos,项目名称:tree_admin,代码行数:20,代码来源:CampaignSelectionField.php


示例5: testFromCacheGetAdsStats

 function testFromCacheGetAdsStats()
 {
     $this->_generateStats();
     $res = Admin_DA::fromCache('getAdsStats', array('placement_id' => $this->campaignId));
     $this->assertTrue(is_array($res));
     $this->assertTrue(count($res));
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:7,代码来源:AdminDA.dal.test.php


示例6: getCampaignMap

function getCampaignMap($advertiserId)
{
    $aCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $advertiserId));
    $aCampaignMap = array();
    foreach ($aCampaigns as $campaignId => $aCampaign) {
        $campaignName = $aCampaign['name'];
        // mask campaign name if anonymous campaign
        $campaign_details = Admin_DA::getPlacement($campaignId);
        $campaignName = MAX_getPlacementName($campaign_details);
        $aCampaignMap[$campaignId] = array('name' => $campaignName);
    }
    return $aCampaignMap;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:13,代码来源:campaign-banners.php


示例7: mergeConversions


//.........这里部分代码省略.........
         $aGroupBy = array('day_and_hour');
     }
     $aFrom = array("{$conf['table']['prefix']}{$conf['table']['data_intermediate_ad_connection']} diac");
     $aWhere = array("diac.inside_window = 1");
     $aFields[] = "SUM(IF(diac.connection_status = " . MAX_CONNECTION_STATUS_APPROVED . " AND diac.connection_action = " . MAX_CONNECTION_AD_IMPRESSION . ",1,0)) AS sum_conversions_" . MAX_CONNECTION_AD_IMPRESSION;
     $aFields[] = "SUM(IF(diac.connection_status = " . MAX_CONNECTION_STATUS_APPROVED . " AND diac.connection_action = " . MAX_CONNECTION_AD_CLICK . ",1,0)) AS sum_conversions_" . MAX_CONNECTION_AD_CLICK;
     $aFields[] = "SUM(IF(diac.connection_status = " . MAX_CONNECTION_STATUS_APPROVED . " AND diac.connection_action = " . MAX_CONNECTION_AD_ARRIVAL . ",1,0)) AS sum_conversions_" . MAX_CONNECTION_AD_ARRIVAL;
     $aFields[] = "SUM(IF(diac.connection_status = " . MAX_CONNECTION_STATUS_APPROVED . " AND diac.connection_action = " . MAX_CONNECTION_MANUAL . ",1,0)) AS sum_conversions_" . MAX_CONNECTION_MANUAL;
     $aFields[] = "SUM(IF(diac.connection_status = " . MAX_CONNECTION_STATUS_APPROVED . ",1,0)) AS sum_conversions";
     $aFields[] = "SUM(IF(diac.connection_status = " . MAX_CONNECTION_STATUS_PENDING . ",1,0)) AS sum_conversions_pending";
     if (!empty($aParams['day_begin']) && !empty($aParams['day_end'])) {
         $oStartDate =& new Date("{$aParams['day_begin']} 00:00:00");
         $oEndDate =& new Date("{$aParams['day_end']} 23:59:59");
         $oStartDate->toUTC();
         $oEndDate->toUTC();
         $aWhere[] = "diac.tracker_date_time BETWEEN '" . $oStartDate->format('%Y-%m-%d %H:%M:%S') . "'" . " AND '" . $oEndDate->format('%Y-%m-%d %H:%M:%S') . "'";
     }
     if (!empty($aParams['agency_id'])) {
         $aFrom['b'] = "JOIN {$conf['table']['prefix']}{$conf['table']['banners']} b ON (b.bannerid = diac.ad_id)";
         $aFrom['m'] = "JOIN {$conf['table']['prefix']}{$conf['table']['campaigns']} m ON (m.campaignid = b.campaignid)";
         $aFrom['c'] = "JOIN {$conf['table']['prefix']}{$conf['table']['clients']} c ON (c.clientid = m.clientid)";
         $aFrom['z'] = "LEFT JOIN {$conf['table']['prefix']}{$conf['table']['zones']} z ON (z.zoneid = diac.zone_id)";
         $aFrom['p'] = "LEFT JOIN {$conf['table']['prefix']}{$conf['table']['affiliates']} p ON (p.affiliateid = z.affiliateid AND p.agencyid = '{$aParams['agency_id']}')";
         $aWhere[] = "c.agencyid = '{$aParams['agency_id']}'";
     }
     if (!empty($aParams['advertiser_id']) || isset($aParams['include']['advertiser_id'])) {
         $aFrom['b'] = "JOIN {$conf['table']['prefix']}{$conf['table']['banners']} b ON (b.bannerid = diac.ad_id)";
         $aFrom['m'] = "JOIN {$conf['table']['prefix']}{$conf['table']['campaigns']} m ON (m.campaignid = b.campaignid)";
         if (!empty($aParams['advertiser_id'])) {
             $aWhere[] = "m.clientid = '{$aParams['advertiser_id']}'";
         }
         if (isset($aParams['include']['advertiser_id']) && !isset($aParams['exclude']['advertiser_id'])) {
             $aFields[] = "m.clientid AS advertiser_id";
             $aGroupBy[] = "advertiser_id";
         }
     }
     if (!empty($aParams['placement_id']) || isset($aParams['include']['placement_id'])) {
         $aFrom['b'] = "JOIN {$conf['table']['prefix']}{$conf['table']['banners']} b ON (b.bannerid = diac.ad_id)";
         if (!empty($aParams['placement_id'])) {
             $aWhere[] = "b.campaignid = '{$aParams['placement_id']}'";
         }
         if (isset($aParams['include']['placement_id']) && !isset($aParams['exclude']['placement_id'])) {
             $aFields[] = "b.campaignid AS placement_id";
             $aGroupBy[] = "placement_id";
         }
     }
     if (!empty($aParams['publisher_id']) || isset($aParams['include']['publisher_id'])) {
         $aFrom['z'] = "JOIN {$conf['table']['prefix']}{$conf['table']['zones']} z ON (z.zoneid = diac.zone_id)";
         if (!empty($aParams['publisher_id'])) {
             $aWhere[] = "z.affiliateid = '{$aParams['publisher_id']}'";
         }
         if (isset($aParams['include']['publisher_id']) && !isset($aParams['exclude']['publisher_id'])) {
             $aFields[] = "z.affiliateid AS publisher_id";
             $aGroupBy[] = "publisher_id";
         }
     }
     if (!empty($aParams['ad_id'])) {
         $aWhere[] = "diac.ad_id = '{$aParams['ad_id']}'";
     }
     if (!isset($aParams['exclude']['ad_id'])) {
         $aFields[] = "diac.ad_id AS ad_id";
         $aGroupBy[] = "ad_id";
     }
     // Using isset: zone_id could be 0 in case of direct selection
     if (isset($aParams['zone_id'])) {
         $aWhere[] = "diac.zone_id = '{$aParams['zone_id']}'";
     }
     if (!isset($aParams['exclude']['zone_id'])) {
         $aFields[] = "diac.zone_id AS zone_id";
         $aGroupBy[] = "zone_id";
     }
     $sFields = count($aFields) ? join(', ', $aFields) : '';
     $sFrom = count($aFrom) ? join(' ', $aFrom) : '';
     $sWhere = count($aWhere) ? 'WHERE ' . join(' AND ', $aWhere) : '';
     $sGroupBy = count($aGroupBy) ? 'GROUP BY ' . join(', ', $aGroupBy) : '';
     $query = "SELECT " . $sFields . " FROM " . $sFrom . " " . $sWhere . " " . $sGroupBy;
     $oDbh = OA_DB::singleton();
     $key = $method == 'getEntitiesStats' ? 'pkey' : 'day_and_hour';
     $oRes = $oDbh->query($query);
     $aResult = array();
     if (!PEAR::isError($oRes)) {
         while ($row = $oRes->fetchRow()) {
             $aResult[$row[$key]] = $row;
             unset($aResult[$row[$key]][$key]);
         }
     }
     if ($method != 'getEntitiesStats') {
         $aResult = Admin_DA::_convertStatsArrayToTz($aResult, $aParams, null, $tzMethod, $tzArgs);
     }
     foreach ($aResult as $k => $row) {
         if (!isset($aRows[$k])) {
             $aRows[$k] = $emptyRow;
         }
         foreach ($row as $field => $value) {
             if (!isset($aRows[$k][$field])) {
                 $aRows[$k][$field] = $value;
             }
         }
     }
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:101,代码来源:Delivery.php


示例8: OA_Admin_Template

    }
}
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('campaign-index.html');
// Get clients & campaign and build the tree
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->clientid = $clientid;
$doCampaigns->addListOrderBy($listorder, $orderdirection);
$doCampaigns->find();
while ($doCampaigns->fetch() && ($row_campaigns = $doCampaigns->toArray())) {
    $campaigns[$row_campaigns['campaignid']]['campaignid'] = $row_campaigns['campaignid'];
    // mask campaign name if anonymous campaign
    $campaign_details = Admin_DA::getPlacement($row_campaigns['campaignid']);
    $row_campaigns['campaignname'] = MAX_getPlacementName($campaign_details);
    $campaigns[$row_campaigns['campaignid']]['campaignname'] = $row_campaigns['campaignname'];
    $campaigns[$row_campaigns['campaignid']]['impressions'] = phpAds_formatNumber($row_campaigns['views']);
    $campaigns[$row_campaigns['campaignid']]['clicks'] = phpAds_formatNumber($row_campaigns['clicks']);
    $campaigns[$row_campaigns['campaignid']]['conversions'] = phpAds_formatNumber($row_campaigns['conversions']);
    if ($row_campaigns['activate'] && $row_campaigns['activate'] != '0000-00-00') {
        $oActivateDate =& new Date($row_campaigns['activate']);
        $campaigns[$row_campaigns['campaignid']]['activate'] = $oActivateDate->format($date_format);
    } else {
        $campaigns[$row_campaigns['campaignid']]['activate'] = '-';
    }
    if ($row_campaigns['activate'] && $row_campaigns['expire'] != '0000-00-00') {
        $oExpireDate =& new Date($row_campaigns['expire']);
        $campaigns[$row_campaigns['campaignid']]['expire'] = $oExpireDate->format($date_format);
    } else {
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:advertiser-campaigns.php


示例9: array

            $translated_message = $translation->translate($GLOBALS['strChannelAclHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "channel-edit.php?" . (!empty($affiliateid) ? "affiliateid={$affiliateid}&" : "") . "channelid={$channelid}"), htmlspecialchars($doChannel->name)));
            OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
            // Redirect
            if (!empty($affiliateid)) {
                header("Location: channel-acl.php?affiliateid={$affiliateid}&channelid={$channelid}");
            } else {
                header("Location: channel-acl.php?channelid={$channelid}");
            }
            exit;
        }
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
MAX_displayNavigationChannel($pageName, $aOtherChannels, $aEntities);
$aChannel = Admin_DA::getChannel($channelid);
if (!isset($acl)) {
    $acl = Admin_DA::getChannelLimitations(array('channel_id' => $channelid));
    // This array needs to be sorted by executionorder, this should ideally be done in SQL
    // When we move to DataObject this should be addressed
    ksort($acl);
}
if (!empty($affiliateid)) {
    $aParams = array('affiliateid' => $affiliateid, 'channelid' => $channelid);
} else {
    $aParams = array('agencyid' => $agencyId, 'channelid' => $channelid);
}
MAX_displayAcls($acl, $aParams);
echo "<br /><input type='submit' name='submit' value='{$GLOBALS['strSaveChanges']}' tabindex='" . $tabindex++ . "'></form>";
phpAds_PageFooter();
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:channel-acl.php


示例10: _checkObjectsExist

 /**
  * Function check if advertiser or placement exists
  * if not: display proper error message
  * Error message contains link to:
  * - advertiser summary statistics if campaign does not exists
  * - stats.php if advertiser does not exists
  *
  * @param int $advertiserId Advertiser Id
  * @param int $placementId  Placement Id (Campaign Id)
  */
 function _checkObjectsExist($advertiserId, $placementId)
 {
     // Check if placement (campaign) exist
     if (0 == count(Admin_DA::getPlacements($this->coreParams + array('advertiser_id' => $advertiserId, 'placement_id' => $placementId)))) {
         phpAds_PageHeader('2');
         // Check if advertiser (clientid) exist
         if (0 == count(Admin_DA::getPlacements($this->coreParams + array('advertiser_id' => $advertiserId)))) {
             phpAds_Die($GLOBALS['strDeadLink'], str_replace('{link}', 'stats.php', $GLOBALS['strNoAdvertiser']));
         } else {
             $link = "stats.php?" . htmlspecialchars(preg_replace('#campaignid=[0-9]*&?#', '', $_SERVER['QUERY_STRING']), ENT_QUOTES);
             phpAds_Die($GLOBALS['strDeadLink'], str_replace('{link}', $link, $GLOBALS['strNoPlacement']));
         }
     }
 }
开发者ID:hostinger,项目名称:revive-adserver,代码行数:24,代码来源:CampaignHistory.php


示例11: displayPage

function displayPage($channel, $form)
{
    $pageName = basename($_SERVER['PHP_SELF']);
    $agencyId = OA_Permission::getAgencyId();
    // Obtain the needed data
    if (!empty($channel['affiliateid'])) {
        $aEntities = array('agencyid' => $agencyId, 'affiliateid' => $channel['affiliateid'], 'channelid' => $channel['channelid']);
        // Editing a channel at the publisher level; Only use the
        // channels at this publisher level for the navigation bar
        $aOtherChannels = Admin_DA::getChannels(array('publisher_id' => $channel['affiliateid']));
    } else {
        $aEntities = array('agencyid' => $agencyId, 'channelid' => $channel['channelid']);
        // Editing a channel at the agency level; Only use the
        // channels at this agency level for the navigation bar
        $aOtherChannels = Admin_DA::getChannels(array('agency_id' => $agencyId, 'channel_type' => 'agency'));
    }
    //show header and breadcrumbs
    MAX_displayNavigationChannel($pageName, $aOtherChannels, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('channel-edit.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->assign('formId', $form->getId());
    $oTpl->display();
    //show footer
    phpAds_PageFooter();
}
开发者ID:villos,项目名称:tree_admin,代码行数:26,代码来源:channel-edit.php


示例12: displayPage

function displayPage($aZone, $form)
{
    $pageName = basename($_SERVER['SCRIPT_NAME']);
    $agencyId = OA_Permission::getAgencyId();
    $aEntities = array('affiliateid' => $aZone['affiliateid'], 'zoneid' => $aZone['zoneid']);
    $aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
    $aOtherZones = Admin_DA::getZones(array('publisher_id' => $aZone['affiliateid']));
    MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('zone-advanced.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    _echoDeliveryCappingJs();
    //footer
    phpAds_PageFooter();
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:16,代码来源:zone-advanced.php


示例13: unlinkCampaign

 /**
  * A method to unlink a campaign from a zone
  *
  * @param int $zoneId
  * @param int $campaignId
  * @return bool
  */
 function unlinkCampaign($zoneId, $campaignId)
 {
     if ($this->checkIdExistence('zones', $zoneId) && $this->checkIdExistence('campaigns', $campaignId)) {
         $doZones = OA_Dal::staticGetDO('zones', $zoneId);
         if (!$this->checkPermissions(null, 'affiliates', $doZones->affiliateid, OA_PERM_ZONE_LINK)) {
             return false;
         }
         $result = Admin_DA::deletePlacementZones(array('zone_id' => $zoneId, 'placement_id' => $campaignId));
         if ($result === 0) {
             $this->raiseError('Unknown link for zoneId and campaignId Error');
             return false;
         } else {
             return $result;
         }
     }
     return false;
 }
开发者ID:Jaree,项目名称:revive-adserver,代码行数:24,代码来源:Zone.php


示例14: getHistory

 /**
  * Fetch the history stats using the specified parameters
  *
  * @param array  $aParams Query parameters
  * @param string $link    Optional link for the leftmost column content
  */
 function getHistory($aParams, $link = '')
 {
     $oNow = new Date();
     $aParams['tz'] = $oNow->tz->getID();
     $method = $this->oHistory->setBreakdownInfo($this);
     // Add plugin aParams
     $pluginParams = array();
     foreach ($this->aPlugins as $oPlugin) {
         $oPlugin->addQueryParams($pluginParams);
     }
     $aStats = Admin_DA::fromCache($method, $aParams + $this->aDates + $pluginParams);
     // Merge plugin additional $oPlugin
     foreach ($this->aPlugins as $oPlugin) {
         $oPlugin->mergeData($aStats, $method, $aParams + $this->aDates, $this->aEmptyRow);
     }
     if (count($aStats) == 0) {
         $this->noStatsAvailable = true;
         return $aStats;
     }
     // Fill unused plugins columns
     foreach (array_keys($aStats) as $k) {
         $aStats[$k] += $this->aEmptyRow;
     }
     // Set some of the variables that used to be set by getSpan
     if (!empty($aStats)) {
         $dates = array_keys($aStats);
         // assumes first row has earliest date
         $firstDate = new Date($dates[0]);
         // Convert to current TZ
         $firstDate->setTZbyID('UTC');
         $firstDate->convertTZ($oNow->tz);
         $firstDate->setHour(0);
         $firstDate->setMinute(0);
         $firstDate->setSecond(0);
         if (empty($this->aDates)) {
             $this->aDates['day_begin'] = $firstDate->format('%Y-%m-%d');
             $this->aDates['day_end'] = $oNow->format('%Y-%m-%d');
         }
         $this->oStartDate = new Date($firstDate);
     }
     $aDates = $this->oHistory->getDatesArray($this->aDates, $this->statsBreakdown, $this->oStartDate);
     $this->oHistory->fillGapsAndLink($aStats, $aDates, $this, $link);
     if (!in_array($this->listOrderField, array_merge(array($this->statsBreakdown), array_keys($this->aColumns)))) {
         $this->listOrderField = $this->statsBreakdown;
         $this->listOrderDirection = $this->statsBreakdown == 'hour' || $this->statsBreakdown == 'dow' ? 'up' : 'down';
     }
     // If required, re-format the data in the weekly breakdown format
     if ($this->statsBreakdown == 'week') {
         $this->oHistory->prepareWeekBreakdown($aStats, $this);
     }
     MAX_sortArray($aStats, $this->listOrderField, $this->listOrderDirection == 'up');
     // Summarise the values into a the totals array, & format
     $this->_summariseTotalsAndFormat($aStats, true);
     return $aStats;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:61,代码来源:CommonHistory.php


示例15: _linkZonesToCampaignsBannersOrSingleBanner

 /**
  * Batch linking list of zones to campaign's banners or a specific banner
  * This is a sub-function of linkZonesToCampaigns and linkZonesToBanner.
  *
  * Banners are linked when:
  *  - text text banner and text zone (ignore width/height)
  *  - link non text banners when matching width/height to non text zone
  * Don't link banners to zone if that link already exists
  * Don't link Email zones
  *
  * @param array $aZonesIds array of zones IDs
  * @param int $campaignId  the campaign ID.
  * @param int $bannerId    the banner ID.
  * @return int number of linked banners
  */
 function _linkZonesToCampaignsBannersOrSingleBanner($aZonesIds, $campaignId, $bannerId = null)
 {
     $prefix = $this->getTablePrefix();
     $rsEmailZones = DBC::NewRecordSet("SELECT zoneid FROM {$prefix}zones WHERE delivery = " . MAX_ZoneEmail . " AND zoneid IN (" . implode(',', array_map('intval', $aZonesIds)) . ")");
     $aEmailZoneIds = $rsEmailZones->getAll();
     $fastLinking = !$GLOBALS['_MAX']['CONF']['audit']['enabledForZoneLinking'];
     $fromWhereClause = " FROM\n                {$prefix}banners AS b\n                CROSS JOIN\n                {$prefix}zones AS z\n                LEFT JOIN {$prefix}ad_zone_assoc AS aza ON (aza.ad_id = b.bannerid AND aza.zone_id = z.zoneid)\n            WHERE";
     if (!empty($campaignId)) {
         $fromWhereClause .= "\n                b.campaignid = " . DBC::makeLiteral($campaignId) . "\n                AND";
         foreach ($aEmailZoneIds as $zoneId) {
             $okToLink = Admin_DA::_checkEmailZoneAdAssoc($zoneId, $campaignId);
             if (PEAR::isError($okToLink)) {
                 $aZonesIds = array_diff($aZonesIds, array($zoneId));
             }
         }
     }
     if (!empty($bannerId)) {
         $fromWhereClause .= "\n                b.bannerid = " . DBC::makeLiteral($bannerId) . "\n                AND";
         // Remove any zoneids which this banner cannot be linked to due to email zone restrictions
         foreach ($aEmailZoneIds as $zoneId) {
             $aAd = Admin_DA::getAd($bannerId);
             $okToLink = Admin_DA::_checkEmailZoneAdAssoc($zoneId, $aAd['placement_id']);
             if (PEAR::isError($okToLink)) {
                 $aZonesIds = array_diff($aZonesIds, array($zoneId));
             }
         }
     }
     $fromWhereClause .= "\n                z.zoneid IN (" . implode(",", array_map('intval', $aZonesIds)) . ")\n                AND\n                (\n                    (\n                        b.storagetype = 'txt'\n                        AND\n                        z.delivery = " . phpAds_ZoneText . "\n                    )\n                    OR\n                    (\n                        z.delivery <> " . phpAds_ZoneText . "\n                        AND\n                        b.storagetype <> 'txt'\n                        AND\n                        (\n                          (\n                            ( z.width = -1\n                              OR\n                              z.width = b.width\n                            )\n                            AND\n                            ( z.height = -1\n                              OR\n                              z.height = b. height\n                            )\n                          )\n                          OR\n                          (\n                            b.height = -1 AND b.width = -1\n                          )\n                        )\n                    )\n                )\n                AND\n                aza.ad_zone_assoc_id IS NULL\n        ";
     // if only one zone is selected and this zone is an email zone
     // we only link it if it was not previously linked to any banner (email zones can be linked to one banner only)
     if ($fastLinking) {
         $query = "INSERT INTO {$prefix}ad_zone_assoc (zone_id, ad_id, priority_factor)\n                SELECT z.zoneid, b.bannerid, 1\n                {$fromWhereClause}\n            ";
         return $this->oDbh->exec($query);
     } else {
         $query = "\n                SELECT z.zoneid AS zoneid,\n                       b.bannerid AS bannerid\n                {$fromWhereClause}\n            ";
         $rsAdZones = DBC::NewRecordSet($query);
         if (PEAR::isError($rsAdZones)) {
             return $rsAdZones;
         }
         $aAdZones = $rsAdZones->getAll();
         $doAdZoneAssoc = OA_Dal::factoryDO('ad_zone_assoc');
         foreach ($aAdZones as $aAdZone) {
             $doAdZoneAssoc->zone_id = $aAdZone['zoneid'];
             $doAdZoneAssoc->ad_id = $aAdZone['bannerid'];
             $doAdZoneAssoc->priority_factor = 1;
             $doAdZoneAssoc->insert();
         }
         return count($aAdZones);
     }
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:65,代码来源:Zones.php


示例16: basename

}
if (!isset($orderdirection)) {
    if (isset($session['prefs']['campaign-trackers.php']['orderdirection'])) {
        $orderdirection = $session['prefs']['campaign-trackers.php']['orderdirection'];
    } else {
        $orderdirection = '';
    }
}
// Initialise some parameters
$pageName = basename($_SERVER['PHP_SELF']);
$tabindex = 1;
$agencyId = OA_Permission::getAgencyId();
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid);
// Display navigation
$aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
$aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $clientid));
MAX_displayNavigationCampaign($campaignid, $aOtherAdvertisers, $aOtherCampaigns, $aEntities);
if (!empty($campaignid)) {
    $doCampaigns = OA_Dal::factoryDO('campaigns');
    if ($doCampaigns->get($campaignid)) {
        $campaign = $doCampaigns->toArray();
    }
}
$tabindex = 1;
echo "\t\t\t\t<form name='availabletrackers' method='post' action='campaign-trackers.php'>\n";
echo "\t\t\t\t<input type='hidden' name='campaignid' value='" . $GLOBALS['campaignid'] . "'>\n";
echo "\t\t\t\t<input type='hidden' name='clientid' value='" . $GLOBALS['clientid'] . "'>\n";
echo "\t\t\t\t<input type='hidden' name='action' value='set'>\n";
echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>" . "\n";
echo "<tr><td height='25' width='100%' colspan='3'><b>{$GLOBALS['strConversionWindow']}</b></td></tr>" . "\n";
echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>" . "\n";
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:campaign-trackers.php


示例17: phpAds_registerGlobal

| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: channel-index.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
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/html.php';
// Register input variables
phpAds_registerGlobal('acl', 'action', 'submit');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
// Initialise some parameters
$pageName = basename($_SERVER['PHP_SELF']);
$agencyId = OA_Permission::getEntityId();
$tabindex = 1;
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("5.7");
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
echo "<img src='" . OX::assetPath() . "/images/icon-channel-add.gif' border='0' align='absmiddle'>&nbsp;";
echo "<a href='channel-edit.php?agencyid={$agencyId}' accesskey='" . $keyAddNew . "'>{$GLOBALS['strAddNewChannel_Key']}</a>&nbsp;&nbsp;";
phpAds_ShowBreak();
$channels = Admin_DA::getChannels(array('agency_id' => $agencyId), true);
MAX_displayChannels($channels, array('agencyid' => $agencyId));
phpAds_PageFooter();
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:channel-index.php


示例18: displayPage

function displayPage($campaign, $campaignForm, $statusForm, $campaignErrors = null)
{
    global $conf;
    //header and breadcrumbs
    if ($campaign['campaignid'] != "") {
        //edit campaign
        // Initialise some parameters
        $tabindex = 1;
        $agencyId = OA_Permission::getAgencyId();
        $aEntities = array('clientid' => $campaign['clientid'], 'campaignid' => $campaign['campaignid']);
        // Display navigation
        $aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
        $aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $campaign['clientid']));
        MAX_displayNavigationCampaign($campaign['campaignid'], $aOtherAdvertisers, $aOtherCampaigns, $aEntities);
    } else {
        //new campaign
        $advertiser = phpAds_getClientDetails($campaign['clientid']);
        $advertiserName = $advertiser['clientname'];
        $advertiserEditUrl = "advertiser-edit.php?clientid=" . $campaign['clientid'];
        // New campaign
        $builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder();
        $oHeaderModel = $builder->buildEntityHeader(array(array("name" => $advertiserName, "url" => $advertiserEditUrl), array("name" => "")), "campaign", "edit-new");
        phpAds_PageHeader("campaign-edit_new", $oHeaderModel);
    }
    //get template and display form
    $oTpl = new OA_Admin_Template('campaign-edit.html');
    $oTpl->assign('clientid', $campaign['clientid']);
    $oTpl->assign('campaignid', $campaign['campaignid']);
    $oTpl->assign('calendarBeginOfWeek', $GLOBALS['pref']['begin_of_week'] ? 1 : 0);
    $oTpl->assign('language', $GLOBALS['_MAX']['PREF']['language']);
    $oTpl->assign('conversionsEnabled', $conf['logging']['trackerImpressions']);
    $oTpl->assign('adDirectEnabled', defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true);
    $oTpl->assign('impressionsDelivered', isset($campaign['impressions_delivered']) ? $campaign['impressions_delivered'] : 0);
    $oTpl->assign('clicksDelivered', isset($campaign['clicks_delivered']) ? $campaign['clicks_delivered'] : 0);
    $oTpl->assign('conversionsDelivered', isset($campaign['conversions_delivered']) ? $campaign['conversions_delivered'] : 0);
    $oTpl->assign('strCampaignWarningNoTargetMessage', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningNoTarget'])));
    $oTpl->assign('strCampaignWarningRemnantNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningRemnantNoWeight'])));
    $oTpl->assign('strCampaignWarningEcpmNoRevenue', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningEcpmNoRevenue'])));
    $oTpl->assign('strCampaignWarningExclusiveNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningExclusiveNoWeight'])));
    $oTpl->assign('campaignErrors', $campaignErrors);
    $oTpl->assign('CAMPAIGN_TYPE_REMNANT', OX_CAMPAIGN_TYPE_REMNANT);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_NORMAL', OX_CAMPAIGN_TYPE_CONTRACT_NORMAL);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE', OX_CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE);
    $oTpl->assign('CAMPAIGN_TYPE_ECPM', OX_CAMPAIGN_TYPE_ECPM);
    $oTpl->assign('CAMPAIGN_TYPE_CONTRACT_ECPM', OX_CAMPAIGN_TYPE_CONTRACT_ECPM);
    $oTpl->assign('PRIORITY_ECPM_FROM', DataObjects_Campaigns::PRIORITY_ECPM_FROM);
    $oTpl->assign('PRIORITY_ECPM_TO', DataObjects_Campaigns::PRIORITY_ECPM_TO);
    $oTpl->assign('MODEL_CPM', MAX_FINANCE_CPM);
    $oTpl->assign('MODEL_CPC', MAX_FINANCE_CPC);
    $oTpl->assign('MODEL_CPA', MAX_FINANCE_CPA);
    if ($conf['logging']['trackerImpressions']) {
        $oTpl->assign('MODEL_MT', MAX_FINANCE_MT);
    }
    $oTpl->assign('campaignFormId', $campaignForm->getId());
    $oTpl->assign('campaignForm', $campaignForm->serialize());
    if (!empty($campaign['campaignid']) && defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true) {
        $oTpl->assign('statusForm', $statusForm->serialize());
    }
    $oTpl->display();
    _echoDeliveryCappingJs();
    //footer
    phpAds_PageFooter();
}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:63,代码来源:campaign-edit.php


示例19: MAX_duplicatePlacementZones


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AdminbaseAction类代码示例发布时间:2022-05-23
下一篇:
PHP Admin_Controller类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap