use Bitrix\Seo\Adv;
Loc::loadMessages(dirname(__FILE__) . '/../seo_adv.php');
$engine = new Engine\YandexDirect();
$currentUser = $engine->getCurrentUser();
$bNeedAuth = !is_array($currentUser);
if ($bNeedAuth) {
    if (!defined('BX_PUBLIC_MODE') || !BX_PUBLIC_MODE) {
        $message = new CAdminMessage(array("TYPE" => "OK", "DETAILS" => Loc::getMessage("SEO_ERROR_NO_YANDEX_AUTH", array("#LANGUAGE_ID#" => LANGUAGE_ID)), "HTML" => true));
        echo $message->Show();
    } else {
        echo BeginNote() . Loc::getMessage("SEO_ERROR_NO_YANDEX_AUTH", array("#LANGUAGE_ID#" => LANGUAGE_ID)) . EndNote();
    }
    return;
}
$request = Main\Context::getCurrent()->getRequest();
$dbRes = Adv\YandexCampaignTable::getList(array("order" => array("NAME" => "asc"), "filter" => array('=ACTIVE' => Adv\YandexCampaignTable::ACTIVE, '=ENGINE_ID' => $engine->getId()), 'select' => array("ID", "NAME", "XML_ID", "OWNER_ID", "SETTINGS")));
$campaignList = array();
while ($campaign = $dbRes->fetch()) {
    if ($campaign['OWNER_ID'] == $currentUser['id']) {
        $campaignList[$campaign['ID']] = $campaign;
    }
}
if (count($campaignList) <= 0) {
    if (!defined('BX_PUBLIC_MODE') || !BX_PUBLIC_MODE) {
        $message = new CAdminMessage(array("TYPE" => "OK", "DETAILS" => Loc::getMessage("SEO_ERROR_NO_CAMPAIGNS", array("#LANGUAGE_ID#" => LANGUAGE_ID)), "HTML" => true));
        echo $message->Show();
    } else {
        echo BeginNote() . Loc::getMessage("SEO_ERROR_NO_CAMPAIGNS", array("#LANGUAGE_ID#" => LANGUAGE_ID)) . EndNote();
    }
    ?>
<a href="/bitrix/admin/seo_search_yandex_direct_edit.php?lang=<?php 
     try {
         $result = Adv\YandexCampaignTable::delete($campaignId);
         if (!$result->isSuccess()) {
             $errorsList = $result->getErrorMessages();
             foreach ($errorsList as $errorMessage) {
                 $adminList->AddGroupError($errorMessage, $campaignId);
             }
         }
     } catch (Engine\YandexDirectException $e) {
         // if we got an error from yandex - kill only local mirror
         Adv\YandexCampaignTable::setSkipRemoteUpdate(true);
         Adv\YandexCampaignTable::delete($campaignId);
         Adv\YandexCampaignTable::setSkipRemoteUpdate(false);
     }
 } else {
     $filter = array('=ID' => $campaignId, '=ENGINE_ID' => $engine->getId(), '=ACTIVE' => $archive ? Adv\YandexCampaignTable::INACTIVE : Adv\YandexCampaignTable::ACTIVE);
     $dbRes = Adv\YandexCampaignTable::getList(array('filter' => $filter, 'select' => array('ID', 'XML_ID')));
     $campaign = $dbRes->fetch();
     if ($campaign) {
         try {
             switch ($_REQUEST['action']) {
                 case 'archive':
                     $engine->stopCampaign($campaign['XML_ID']);
                     $engine->archiveCampaign($campaign['XML_ID']);
                     break;
                 case 'unarchive':
                     $engine->unArchiveCampaign($campaign['XML_ID']);
                     break;
                 case 'stop':
                     $engine->stopCampaign($campaign['XML_ID']);
                     break;
		"MESSAGE" => Loc::getMessage("SEO_CAMPAIGN_STRATEGY_NOT_SUPPORTED", array(
			"#STRATEGY#" => Loc::getMessage('SEO_CAMPAIGN_STRATEGY_'.$campaign["SETTINGS"]['Strategy']['StrategyName']),
		))
	));
}

$tableID = "tbl_yandex_direct_banner";

$oSort = new \CAdminSorting($tableID, "ID", "desc");
$adminList = new \CAdminList($tableID, $oSort);

if($bAllowSimpleActions && ($bannerIDs = $adminList->GroupAction()))
{
	$filter = array(
		'=CAMPAIGN_ID' => $campaignId,
		'=ENGINE_ID' => $engine->getId(),
		'=ACTIVE' => $archive ? Adv\YandexBannerTable::INACTIVE : Adv\YandexBannerTable::ACTIVE,
	);

	if($_REQUEST['action_target']!=='selected')
	{
		$filter['=ID'] = $bannerIDs;
	}

	$dbRes = Adv\YandexBannerTable::getList(array(
		'filter' => $filter,
		'select' => array('ID', 'XML_ID'),
	));

	$bannersList = array();
	while($banner = $dbRes->fetch())
	{
		echo BeginNote().Loc::getMessage("SEO_ERROR_NO_YANDEX_AUTH", array(
				"#LANGUAGE_ID#" => LANGUAGE_ID,
			)).EndNote();
	}

	return;
}

$request = Main\Context::getCurrent()->getRequest();

$dbRes = Adv\YandexCampaignTable::getList(array(
	"order" => array("NAME" => "asc"),
	"filter" => array(
		'=ACTIVE' => Adv\YandexCampaignTable::ACTIVE,
		'=ENGINE_ID' => $engine->getId(),
	),
	'select' => array(
		"ID", "NAME", "XML_ID", "OWNER_ID", "SETTINGS"
	)
));
$campaignList = array();

while($campaign = $dbRes->fetch())
{
	if($campaign['OWNER_ID'] == $currentUser['id'])
	{
		$campaignList[$campaign['ID']] = $campaign;
	}
}
    $archive = true;
}
if ($campaign['OWNER_ID'] != $currentUser['id']) {
    $bReadOnly = true;
    $bAllowSimpleActions = false;
    $message = new CAdminMessage(array("TYPE" => "ERROR", "MESSAGE" => Loc::getMessage('SEO_CAMPAIGN_WRONG_OWNER', array("#USERINFO#" => "(" . $campaign["OWNER_ID"] . ") " . $campaign["OWNER_NAME"]))));
} elseif (!in_array($campaign["SETTINGS"]['Strategy']['StrategyName'], Adv\YandexCampaignTable::$supportedStrategy)) {
    $bReadOnly = true;
    $bAllowSimpleActions = true;
    $message = new CAdminMessage(array("TYPE" => "ERROR", "MESSAGE" => Loc::getMessage("SEO_CAMPAIGN_STRATEGY_NOT_SUPPORTED", array("#STRATEGY#" => Loc::getMessage('SEO_CAMPAIGN_STRATEGY_' . $campaign["SETTINGS"]['Strategy']['StrategyName'])))));
}
$tableID = "tbl_yandex_direct_banner";
$oSort = new \CAdminSorting($tableID, "ID", "desc");
$adminList = new \CAdminList($tableID, $oSort);
if ($bAllowSimpleActions && ($bannerIDs = $adminList->GroupAction())) {
    $filter = array('=CAMPAIGN_ID' => $campaignId, '=ENGINE_ID' => $engine->getId(), '=ACTIVE' => $archive ? Adv\YandexBannerTable::INACTIVE : Adv\YandexBannerTable::ACTIVE);
    if ($_REQUEST['action_target'] !== 'selected') {
        $filter['=ID'] = $bannerIDs;
    }
    $dbRes = Adv\YandexBannerTable::getList(array('filter' => $filter, 'select' => array('ID', 'XML_ID')));
    $bannersList = array();
    while ($banner = $dbRes->fetch()) {
        $bannersList[$banner['XML_ID']] = $banner['ID'];
    }
    if (count($bannersList) > 0) {
        if ($_REQUEST['action'] == 'delete') {
            try {
                $engine->deleteBanners($campaign['XML_ID'], array_keys($bannersList));
                Adv\YandexBannerTable::setSkipRemoteUpdate(true);
            } catch (Engine\YandexDirectException $e) {
                Adv\YandexBannerTable::setSkipRemoteUpdate(false);
Beispiel #6
0
				|| (
					defined('BX_ADMIN_SEO_ADV_MENU_OPEN')
					&& BX_ADMIN_SEO_ADV_MENU_OPEN == 1
				)
			)
			{
				if(\Bitrix\Main\Loader::includeModule('seo'))
				{
					$yandexAdvCampaigns = array();

					$engine = new Engine\YandexDirect();

					$dbRes = Adv\YandexCampaignTable::getList(array(
						'order' => array('NAME' => 'ASC'),
						'filter' => array(
							'=ENGINE_ID' => $engine->getId(),
							'=ACTIVE' => Adv\YandexCampaignTable::ACTIVE
						),
						'select' => array('ID', 'NAME'),
					));

					while($campaign = $dbRes->fetch())
					{
						if(
						(
							method_exists($this, "IsSectionActive")
							&& $this->IsSectionActive("seo_search_adv_items/".$campaign['ID'])
						)
						|| (
							$GLOBALS["APPLICATION"]->GetCurPage() == '/bitrix/admin/seo_search_yandex_direct_banner_edit.php'
							&& $_REQUEST['campaign'] == $campaign['ID']
Beispiel #7
0
 public static function checkQuantityAgent()
 {
     if (!IsModuleInstalled("catalog")) {
         return __CLASS__ . "::checkQuantityAgent();";
     }
     $dbRes = YandexBannerTable::getList(array('filter' => array(array('=AUTO_QUANTITY_ON' => YandexBannerTable::MARKED), array('=AUTO_QUANTITY_OFF' => YandexBannerTable::MARKED), 'LOGIC' => "OR"), 'select' => array('ID', 'XML_ID', 'CAMPAIGN_ID', 'CAMPAIGN_XML_ID' => 'CAMPAIGN.XML_ID', 'AUTO_QUANTITY_ON', 'AUTO_QUANTITY_OFF')));
     $engine = new YandexDirect();
     $bannersListToStop = array();
     $bannersListToResume = array();
     $bannersListToUnMarkStopped = array();
     $bannersListToUnMarkResumed = array();
     $bannersLogData = array();
     while ($banner = $dbRes->fetch()) {
         if ($banner["AUTO_QUANTITY_ON"] == YandexBannerTable::MARKED) {
             if (!isset($bannersListToResume[$banner["CAMPAIGN_XML_ID"]])) {
                 $bannersListToResume[$banner["CAMPAIGN_XML_ID"]] = array();
             }
             $bannersListToResume[$banner["CAMPAIGN_XML_ID"]][$banner["ID"]] = $banner["XML_ID"];
             $causeCode = AutologTable::CODE_QUANTITY_ON;
             if ($banner["AUTO_QUANTITY_OFF"] == YandexBannerTable::MARKED) {
                 $bannersListToUnMarkStopped[] = $banner["ID"];
             }
         } else {
             if (!isset($bannersListToResume[$banner["CAMPAIGN_XML_ID"]])) {
                 $bannersListToStop[$banner["CAMPAIGN_XML_ID"]] = array();
             }
             $bannersListToStop[$banner["CAMPAIGN_XML_ID"]][$banner["ID"]] = $banner["XML_ID"];
             $causeCode = AutologTable::CODE_QUANTITY_OFF;
             if ($banner["AUTO_QUANTITY_ON"] == YandexBannerTable::MARKED) {
                 $bannersListToUnMarkResumed[] = $banner["ID"];
             }
         }
         $bannersLogData[$banner["ID"]] = array('CAMPAIGN_ID' => $banner['CAMPAIGN_ID'], 'CAMPAIGN_XML_ID' => $banner['CAMPAIGN_XML_ID'], 'BANNER_ID' => $banner['ID'], 'BANNER_XML_ID' => $banner['XML_ID'], 'CAUSE_CODE' => $causeCode);
     }
     if (count($bannersLogData) > 0) {
         foreach ($bannersListToResume as $campaignId => $bannersList) {
             if (count($bannersList) > 0) {
                 $success = true;
                 try {
                     $engine->resumeBanners($campaignId, array_values($bannersList));
                 } catch (YandexDirectException $e) {
                     $success = false;
                 }
                 foreach ($bannersList as $bannerId => $bannerXmlId) {
                     $logEntry = $bannersLogData[$bannerId];
                     $logEntry['ENGINE_ID'] = $engine->getId();
                     $logEntry['SUCCESS'] = $success ? AutologTable::SUCCESS : AutologTable::FAILURE;
                     AutologTable::add($logEntry);
                 }
                 $bannersListToUnMarkResumed = array_merge($bannersListToUnMarkResumed, array_keys($bannersList));
             }
         }
         foreach ($bannersListToStop as $campaignId => $bannersList) {
             if (count($bannersList) > 0) {
                 $success = true;
                 try {
                     $engine->stopBanners($campaignId, array_values($bannersList));
                 } catch (YandexDirectException $e) {
                     $success = false;
                 }
                 foreach ($bannersList as $bannerId => $bannerXmlId) {
                     $logEntry = $bannersLogData[$bannerId];
                     $logEntry['ENGINE_ID'] = $engine->getId();
                     $logEntry['SUCCESS'] = $success ? AutologTable::SUCCESS : AutologTable::FAILURE;
                     AutologTable::add($logEntry);
                 }
                 $bannersListToUnMarkStopped = array_merge($bannersListToUnMarkStopped, array_keys($bannersList));
             }
         }
         if (count($bannersListToUnMarkStopped) > 0) {
             YandexBannerTable::unMarkStopped($bannersListToUnMarkStopped);
         }
         if (count($bannersListToUnMarkResumed) > 0) {
             YandexBannerTable::unMarkResumed($bannersListToUnMarkResumed);
         }
     }
     return __CLASS__ . "::checkQuantityAgent();";
 }
Beispiel #8
0
 protected function processStatsResult($campaignId, array $result, YandexDirect $liveEngine)
 {
     if ($result['Stat']) {
         $bannerIds = array();
         foreach ($result['Stat'] as $statEntry) {
             $bannerIds[] = $statEntry['BannerID'];
         }
         if (count($bannerIds) > 0) {
             $dbRes = YandexBannerTable::getList(array('filter' => array('=XML_ID' => array_values(array_unique($bannerIds)), '=ENGINE_ID' => $liveEngine->getId()), 'select' => array('ID', 'XML_ID')));
             $bannerList = array();
             while ($bannerData = $dbRes->fetch()) {
                 $bannerList[$bannerData['XML_ID']] = $bannerData['ID'];
             }
             if (count($bannerList) > 0) {
                 foreach ($result['Stat'] as $statEntry) {
                     if (array_key_exists($statEntry['BannerID'], $bannerList)) {
                         $statFields = array('CAMPAIGN_ID' => $campaignId, 'BANNER_ID' => $bannerList[$statEntry['BannerID']], 'DATE_DAY' => new Date($statEntry['StatDate'], 'Y-m-d'), 'CURRENCY' => $result['Currency'], 'SUM' => $statEntry['Sum'], 'SUM_SEARCH' => $statEntry['SumSearch'], 'SUM_CONTEXT' => $statEntry['SumContext'], 'CLICKS' => $statEntry['Clicks'], 'CLICKS_SEARCH' => $statEntry['ClicksSearch'], 'CLICKS_CONTEXT' => $statEntry['ClicksContext'], 'SHOWS' => $statEntry['Shows'], 'SHOWS_SEARCH' => $statEntry['ShowsSearch'], 'SHOWS_CONTEXT' => $statEntry['ShowsContext']);
                         $statCheckRes = static::getList(array('filter' => array('BANNER_ID' => $statFields['BANNER_ID'], 'DATE_DAY' => $statFields['DATE_DAY']), 'select' => array('ID')));
                         $statCheck = $statCheckRes->fetch();
                         if (!$statCheck) {
                             static::add($statFields);
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #9
0
     } elseif ($_REQUEST['action'] == 'link_create') {
         $dbRes = Adv\LinkTable::getByPrimary(array('LINK_TYPE' => $linkType, 'LINK_ID' => $linkId, 'BANNER_ID' => $bannerId));
         if (!$dbRes->fetch()) {
             $result = Adv\LinkTable::add(array('LINK_TYPE' => $linkType, 'LINK_ID' => $linkId, 'BANNER_ID' => $bannerId));
             $res = array('result' => $result->isSuccess());
         } else {
             $res = array('result' => true);
         }
     }
 }
 if ($res['result'] && $_REQUEST['get_list_html']) {
     Loader::includeModule('iblock');
     ob_start();
     if ($_REQUEST['get_list_html'] == '1') {
         $iblockElementInfo = array("ID" => $linkId, "IBLOCK" => array("ID" => 0));
         $dbRes = Adv\LinkTable::getList(array("filter" => array('=LINK_TYPE' => Adv\LinkTable::TYPE_IBLOCK_ELEMENT, '=LINK_ID' => $linkId, "=BANNER.ENGINE_ID" => $engine->getId()), "select" => array("BANNER_ID", "BANNER_NAME" => "BANNER.NAME", "BANNER_XML_ID" => "BANNER.XML_ID", "BANNER_CAMPAIGN_ID" => "BANNER.CAMPAIGN_ID", "LINK_IBLOCK_ID" => "IBLOCK_ELEMENT.IBLOCK_ID")));
         $arBanners = array();
         while ($banner = $dbRes->fetch()) {
             if (!isset($arBanners[$banner['BANNER_CAMPAIGN_ID']])) {
                 $arBanners[$banner['BANNER_CAMPAIGN_ID']] = array();
             }
             $arBanners[$banner['BANNER_CAMPAIGN_ID']][] = $banner;
             $iblockElementInfo['IBLOCK']['ID'] = $banner['LINK_IBLOCK_ID'];
         }
         $dbRes = Adv\YandexCampaignTable::getList(array("order" => array("NAME" => "asc"), "filter" => array("=ID" > array_keys($arBanners), '=ACTIVE' => Adv\YandexCampaignTable::ACTIVE, '=ENGINE_ID' => $engine->getId()), 'select' => array("ID", "NAME", "XML_ID")));
         $campaignList = array();
         while ($campaign = $dbRes->fetch()) {
             $campaignList[$campaign['ID']] = $campaign;
         }
         require dirname(__FILE__) . "/../admin/tab/seo_search_yandex_direct_list_link.php";
     } elseif ($_REQUEST['get_list_html'] == '2') {
Beispiel #10
0
use Bitrix\Main\Localization\Loc;
if ($APPLICATION->GetGroupRight("seo") > "D") {
    if (\Bitrix\Main\ModuleManager::isModuleInstalled('seo')) {
        IncludeModuleLangFile(__FILE__);
        $bShowYandexServices = COption::GetOptionString('main', 'vendor', '') == '1c_bitrix' && Loc::getDefaultLang(LANGUAGE_ID) == 'ru';
        $aMenu = array(array("parent_menu" => "global_menu_marketing", "section" => "seo", "sort" => 900, "text" => Loc::getMessage("SEO_MENU_MAIN"), "title" => Loc::getMessage("SEO_MENU_MAIN_TITLE"), "icon" => "seo_menu_icon", "page_icon" => "seo_page_icon", "module_id" => "seo", "items_id" => "menu_seo", "items" => array()));
        $arEngineList = array();
        $arAdvList = array();
        if ($bShowYandexServices) {
            $arEngineList[] = array('url' => 'seo_search_yandex.php?lang=' . LANGUAGE_ID, 'more_url' => array('seo_search_yandex_detail.php?lang=' . LANGUAGE_ID), 'text' => Loc::getMessage("SEO_MENU_YANDEX"));
            $yandexAdvItem = array('url' => 'seo_search_yandex_direct.php?lang=' . LANGUAGE_ID, 'more_url' => array('seo_search_yandex_direct_edit.php?lang=' . LANGUAGE_ID, 'seo_search_yandex_direct_banner.php?lang=' . LANGUAGE_ID, 'seo_search_yandex_direct_banner_edit.php?lang=' . LANGUAGE_ID), 'text' => Loc::getMessage("SEO_MENU_YANDEX_DIRECT"), "module_id" => "seo", 'items_id' => "seo_search_adv_items", "dynamic" => true, 'items' => array());
            if (method_exists($this, "IsSectionActive") && $this->IsSectionActive("seo_search_adv_items") || defined('BX_ADMIN_SEO_ADV_MENU_OPEN') && BX_ADMIN_SEO_ADV_MENU_OPEN == 1) {
                if (\Bitrix\Main\Loader::includeModule('seo')) {
                    $yandexAdvCampaigns = array();
                    $engine = new Engine\YandexDirect();
                    $dbRes = Adv\YandexCampaignTable::getList(array('order' => array('NAME' => 'ASC'), 'filter' => array('=ENGINE_ID' => $engine->getId(), '=ACTIVE' => Adv\YandexCampaignTable::ACTIVE), 'select' => array('ID', 'NAME')));
                    while ($campaign = $dbRes->fetch()) {
                        if (method_exists($this, "IsSectionActive") && $this->IsSectionActive("seo_search_adv_items/" . $campaign['ID']) || $GLOBALS["APPLICATION"]->GetCurPage() == '/bitrix/admin/seo_search_yandex_direct_banner_edit.php' && $_REQUEST['campaign'] == $campaign['ID']) {
                            $yandexAdvCampaigns[$campaign['ID']] = count($yandexAdvItem['items']);
                        }
                        $yandexAdvItem['items'][] = array('url' => 'seo_search_yandex_direct_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $campaign['ID'], 'more_url' => array('seo_search_yandex_direct_banner.php?lang=' . LANGUAGE_ID . '&campaign=' . $campaign['ID'], 'seo_search_yandex_direct_banner_edit.php?lang=' . LANGUAGE_ID . '&campaign=' . $campaign['ID']), 'text' => $campaign['NAME'], 'module_id' => 'seo', 'dynamic' => true, 'items_id' => "seo_search_adv_items/" . $campaign['ID'], 'items' => array());
                    }
                    if (count($yandexAdvCampaigns) > 0) {
                        $dbRes = Adv\YandexBannerTable::getList(array('order' => array('NAME' => 'ASC'), 'filter' => array('=ENGINE_ID' => $engine->getId(), '=CAMPAIGN_ID' => array_keys($yandexAdvCampaigns), '=ACTIVE' => Adv\YandexBannerTable::ACTIVE), 'select' => array('ID', 'CAMPAIGN_ID', 'NAME')));
                        while ($banner = $dbRes->fetch()) {
                            $yandexAdvItem['items'][$yandexAdvCampaigns[$banner['CAMPAIGN_ID']]]['items'][] = array('url' => 'seo_search_yandex_direct_banner_edit.php?lang=' . LANGUAGE_ID . '&campaign=' . $banner['CAMPAIGN_ID'] . '&ID=' . $banner['ID'], 'text' => $banner['NAME'], 'parent_menu' => "seo_search_adv_items/" . $banner['CAMPAIGN_ID'], 'items_id' => "seo_search_adv_items/" . $banner['CAMPAIGN_ID'] . "/" . $banner['ID']);
                        }
                    }
                }
            }
            $arAdvList[] = $yandexAdvItem;
Loc::loadMessages(dirname(__FILE__) . '/seo_adv.php');
if (!$USER->CanDoOperation('seo_tools')) {
    $APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
if (!Main\Loader::includeModule('seo')) {
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
    ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE"));
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
}
$engine = new Engine\YandexDirect();
$tableID = "tbl_yandex_direct_auto_log";
$oSort = new \CAdminSorting($tableID, "ID", "desc");
$adminList = new \CAdminList($tableID, $oSort);
$arHeaders = array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "TIMESTAMP_X", "content" => Loc::getMessage('SEO_AUTOLOG_TIMESTAMP_X'), "sort" => "TIMESTAMP_X", "default" => true), array("id" => "SUCCESS", "content" => Loc::getMessage('SEO_AUTOLOG_SUCCESS'), "sort" => "SUCCESS", "default" => true), array("id" => "CAMPAIGN", "content" => Loc::getMessage('SEO_AUTOLOG_CAMPAIGN'), "default" => true), array("id" => "BANNER", "content" => Loc::getMessage('SEO_AUTOLOG_BANNER'), "default" => true), array("id" => "DESCRIPTION", "content" => Loc::getMessage('SEO_AUTOLOG_DESCRIPTION'), "default" => true));
$adminList->AddHeaders($arHeaders);
$logEntriesList = Adv\AutologTable::getList(array('order' => array($by => $order), 'filter' => array('=ENGINE_ID' => $engine->getId())));
$data = new \CAdminResult($logEntriesList, $tableID);
$data->NavStart();
$adminList->NavText($data->GetNavPrint(Loc::getMessage("PAGES")));
while ($entry = $data->NavNext()) {
    $editUrl = "seo_search_yandex_direct_banner_edit.php?lang=" . LANGUAGE_ID . "&campaign=" . $entry["CAMPAIGN_ID"] . "&ID=" . $entry["BANNER_ID"];
    $row =& $adminList->AddRow($log["ID"], $entry, $editUrl, Loc::getMessage("SEO_BANNER_EDIT_TITLE", array("#ID#" => $entry["BANNER_ID"], "#XML_ID#" => $entry["BANNER_XML_ID"])));
    $row->AddViewField("ID", $entry['ID']);
    $row->AddViewField('TIMESTAMP_X', $entry['TIMESTAMP_X']);
    $row->AddViewField('SUCCESS', $entry["SUCCESS"] == Adv\AutologTable::SUCCESS ? '<div style="white-space:nowrap;"><div class="lamp-green" style="display:inline-block;"></div>&nbsp;' . Loc::getMessage("SEO_AUTOLOG_SUCCESS_" . $entry["SUCCESS"]) . '</div>' : '<div style="white-space:nowrap;"><div class="lamp-red" style="display:inline-block;"></div>&nbsp;' . Loc::getMessage("SEO_AUTOLOG_SUCCESS_" . $entry["SUCCESS"]) . '</div>');
    $row->AddViewField("CAMPAIGN", '<a href="seo_search_yandex_direct_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $entry["CAMPAIGN_ID"] . '">' . $entry["CAMPAIGN_ID"] . '</a> (<a href="https://direct.yandex.ru/registered/main.pl?cmd=editCamp&cid=' . $entry['CAMPAIGN_XML_ID'] . '" target="_blank" title="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_EDIT_EXTERNAL')) . '">' . Loc::getMessage('SEO_YANDEX_DIRECT_LINK_TPL', array('#XML_ID#' => $entry['CAMPAIGN_XML_ID'])) . '</a>)');
    $row->AddViewField("BANNER", '<a href="' . Converter::getHtmlConverter()->encode($editUrl) . '">' . $entry["BANNER_ID"] . '</a> (<a href="https://direct.yandex.ru/registered/main.pl?cmd=showCampMultiEdit&bids=' . $entry['BANNER_XML_ID'] . '&cid=' . $entry['CAMPAIGN_XML_ID'] . '" target="_blank" title="' . Converter::getHtmlConverter()->encode(Loc::getMessage('SEO_CAMPAIGN_EDIT_EXTERNAL')) . '">' . Loc::getMessage('SEO_YANDEX_DIRECT_LINK_TPL', array('#XML_ID#' => $entry['BANNER_XML_ID'])) . '</a>)');
    $row->AddViewField('DESCRIPTION', Loc::getMessage("SEO_AUTOLOG_ACTION_" . $entry["CAUSE_CODE"], array("#BANNER_ID#" => $entry["BANNER_ID"], "#BANNER_XML_ID#" => $entry["BANNER_XML_ID"], "#CAMPAIGN_ID#" => $entry["CAMPAIGN_ID"], "#CAMPAIGN_XML_ID#" => $entry["CAMPAIGN_XML_ID"])));
}
$adminList->CheckListMode();
$APPLICATION->SetTitle(Loc::getMessage("SEO_MENU_ADV_AUTOLOG"));