Beispiel #1
0
         sortByColumn($_SESSION["SEO_FORECASTS"], "TS");
         foreach ($_SESSION["SEO_FORECASTS"] as $k => $report) {
             $lifeTime = time() - $report["TS"];
             if ($lifeTime > Engine\YandexDirect::TTL_FORECAST_REPORT && $lifeTime < Engine\YandexDirect::TTL_FORECAST_REPORT_EXT || count($_SESSION["SEO_FORECASTS"]) >= Engine\YandexDirect::MAX_FORECAST_REPORTS) {
                 $reportId = $report["REPORT_ID"];
                 $engine->deleteForecastReport($reportId);
                 unset($_SESSION["SEO_FORECASTS"][$k]);
             }
         }
         if (!isset($_SESSION["SEO_FORECASTS"][$phraseHash])) {
             $reportId = $engine->createForecastReport($phraseList, $geoList);
             $_SESSION["SEO_FORECASTS"][$phraseHash] = array("REPORT_ID" => intval($reportId), "PHRASE" => $phraseList, "GEO" => $geoList, "TS" => time());
             $res = $_SESSION["SEO_FORECASTS"][$phraseHash];
         } else {
             $reportId = $_SESSION["SEO_FORECASTS"][$phraseHash]["REPORT_ID"];
             $res = $engine->getForecastReport($reportId);
         }
     }
     break;
 case 'campaign_update':
     $campaignId = intval($_REQUEST['campaign']);
     $res = $engine->updateCampaignManual($campaignId);
     break;
 case 'banner_update':
     $bannerId = intval($_REQUEST['banner']);
     $campaignId = intval($_REQUEST['campaign']);
     $res = $engine->updateBannersManual($campaignId, $bannerId);
     break;
 case 'link_delete':
 case 'link_create':
     $res = array('result' => false);