$saved_graph_type=$graph_type;
InitFilterEx($arSettings, $sTableID."_settings", "set");

$arFilter = Array(
	"date1"		=> $find_date1,
	"date2"		=> $find_date2,
	"id"	=> $find_counter_id,
	"group" => $graph_type
);

$lAdmin->BeginPrologContent();

/***************************************************************************
		   HTML form
****************************************************************************/
$arrData=CLOLYandexMetrika::GetTrafficSummary($arFilter);

if (count($arrData["data"])<=1):
	CAdminMessage::ShowMessage(GetMessage("LOL_METRIKA_NOT_ENOUGH_DATA"));

elseif (!function_exists("ImageCreate")) :
	CAdminMessage::ShowMessage(GetMessage("LOL_METRIKA_GD_NOT_INSTALLED"));
elseif (count($lAdmin->arFilterErrors)==0) :
		$width = 500;
		$height = 400;
	?>
<div class="graph">
<h2><?echo $arrParams[$graph_type][2]?></h2>
<div class="metrika_graph">
<table cellspacing="0" cellpadding="0" class="graph" border="0" align="center">
<tr>
Exemplo n.º 2
0
		$arrResult[$arData["phrase"]]["LINK"]=$arData["search_engines"][0]["se_url"];
		$arrResult[$arData["phrase"]]["B_YESTERDAY"]=$arData["visits"];
	}
	
	$arFilter["date1"]=$yesterday_date;
	$arFilter["date2"]=$yesterday_date;
	$arrData=CLOLYandexMetrika::GetSourcesPhrases($arFilter);
	foreach($arrData["data"] as $arData)
	{
		$arrResult[$arData["phrase"]]["LINK"]=$arData["search_engines"][0]["se_url"];
		$arrResult[$arData["phrase"]]["YESTERDAY"]=$arData["visits"];
	}	
	
	$arFilter["date1"]=$now_date;
	$arFilter["date2"]=$now_date;
	$arrData=CLOLYandexMetrika::GetSourcesPhrases($arFilter);
	foreach($arrData["data"] as $arData)
	{
		$arrResult[$arData["phrase"]]["LINK"]=$arData["search_engines"][0]["se_url"];
		$arrResult[$arData["phrase"]]["TODAY"]=$arData["visits"];
	}	
		
	?>
	<table class="bx-gadgets-table">
	<tbody>
	<tr>
		<th><?php 
echo GetMessage("GD_STAT_SERVER");
?>
</th>
		<th><a href="/bitrix/admin/lol_metrika_sources_sites.php?lang=<?php 
if(isset($graph_type))
{
	if($graph_type!="depth")
		$graph_type="time";
}
else
	$graph_type="time";

$arFilter = Array(
	"date1"				=> $find_date1,
	"date2"				=> $find_date2,
	"id"				=> $find_counter_id,
);

$arrData=CLOLYandexMetrika::GetTrafficDeepness($arFilter);

if($graph_type=="depth")
	$data_key="data_depth";
else
	$data_key="data_time";

$total = count($arrData[$data_key]);
$arChart=array();
foreach($arrData[$data_key] as $key => $arVal)
{
	$color = GetNextRGB($color, $total);
	$arChart[] = array("COUNTER"=>$arVal["visits"], "COLOR"=>$color);
}

$ImageHandle = CreateImageHandle($diameter, $diameter);
$FilterArr = array(
	"find_counter_id",
	"find_date1",
	"find_date2",
);

$lAdmin->InitFilter($FilterArr);

$arFilter = Array(
	"date1"		=> $find_date1,
	"date2"		=> $find_date2,
	"id"	=> $find_counter_id
);

$arrData=CLOLYandexMetrika::GetSourcesDirectSummary($arFilter);
//print_r($arrData);

$rsData = new CDBResult;
$rsData->InitFromArray($arrData["data"]);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(""));

$arHeaders = array();

$arHeaders[]=
	array(	"id"		=>"name",
		"content"	=>GetMessage("LOL_METRIKA_NAME"),
		"sort"		=>false,
$FilterArr = array(
	"find_counter_id",
	"find_date1",
	"find_date2",
);

$lAdmin->InitFilter($FilterArr);

$arFilter = Array(
	"date1"		=> $find_date1,
	"date2"		=> $find_date2,
	"id"	=> $find_counter_id
);

$arrData=CLOLYandexMetrika::GetSourcesSearchEngines($arFilter);
//print_r($arrData);

$rsData = new CDBResult;
$rsData->InitFromArray($arrData["data"]);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(""));

$arHeaders = array();

$arHeaders[]=
	array(	"id"		=>"name",
		"content"	=>GetMessage("LOL_METRIKA_SEARCHENGINE"),
		"sort"		=>false,
$FilterArr = array(
	"find_counter_id",
	"find_date1",
	"find_date2",
);

$lAdmin->InitFilter($FilterArr);

$arFilter = Array(
	"date1"		=> $find_date1,
	"date2"		=> $find_date2,
	"id"	=> $find_counter_id
);

$arrData=CLOLYandexMetrika::GetSourcesSites($arFilter);
//print_r($arrData);

$rsData = new CDBResult;
$rsData->InitFromArray($arrData["data"]);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(""));

$arHeaders = array();

$arHeaders[]=
	array(	"id"		=>"url",
		"content"	=>GetMessage("LOL_METRIKA_URL"),
		"sort"		=>false,
$arColors = array();
if($find_avg_visits == "Y")
	$arColors[] = array($arrColor["VISITS"]);
if($find_denial == "Y")
	$arColors[] = array($arrColor["DENIAL"]);
if($find_depth == "Y")
	$arColors[] = array($arrColor["DEPTH"]);
if($find_visit_time == "Y")
	$arColors[] = array($arrColor["VISIT_TIME"]);

$arGraphData = array();

$arrY = array();
$arrX = array();

$arrData=CLOLYandexMetrika::GetTrafficHourly($arFilter);

$i=0;
foreach($arrData["data"] as $arItem)
{
	$arRec = array();

	if($find_avg_visits == "Y")
		$arrY[] = $arRec[] = $arItem["avg_visits"];
	if($find_denial == "Y")
		$arrY[] = $arRec[] = intval($arItem["denial"]*100);
	if($find_depth == "Y")
		$arrY[] = $arRec[] = $arItem["depth"];
	if($find_visit_time == "Y")
		$arrY[] = $arRec[] = $arItem["visit_time"]/60;
$FilterArr = array(
	"find_counter_id",
	"find_date1",
	"find_date2",
);

$lAdmin->InitFilter($FilterArr);

$arFilter = Array(
	"date1"		=> $find_date1,
	"date2"		=> $find_date2,
	"id"	=> $find_counter_id
);

$arrData=CLOLYandexMetrika::GetSourcesMarketing($arFilter);
//print_r($arrData);

$rsData = new CDBResult;
$rsData->InitFromArray($arrData["data"]);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(""));

$arHeaders = array();

$arHeaders[]=
	array(	"id"		=>"name",
		"content"	=>GetMessage("LOL_METRIKA_SYSTEM"),
		"sort"		=>false,
$FilterArr = array(
	"find_counter_id",
	"find_date1",
	"find_date2",
);

$lAdmin->InitFilter($FilterArr);

$arFilter = Array(
	"date1"		=> $find_date1,
	"date2"		=> $find_date2,
	"id"	=> $find_counter_id
);

$arrData=CLOLYandexMetrika::GetContentPopular($arFilter);
//print_r($arrData);

$rsData = new CDBResult;
$rsData->InitFromArray($arrData["data"]);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(""));

$arHeaders = array();

$arHeaders[]=
	array(	"id"		=>"url",
		"content"	=>GetMessage("LOL_METRIKA_URL"),
		"sort"		=>false,
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
$STAT_RIGHT = $APPLICATION->GetGroupRight("lol.metrika");
if($STAT_RIGHT=="D") $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/lol.metrika/colors.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/img.php");
CModule::IncludeModule("lol.metrika");

$diameter = 200;

$arFilter = Array(
	"date1"				=> $find_date1,
	"date2"				=> $find_date2,
	"id"				=> $find_counter_id,
);

$arrData=CLOLYandexMetrika::GetSourcesDirectRegions($arFilter);

$total = count($arrData["data"])<10 ? count($arrData["data"]) : 10;
$arChart=array();
$i=0;
$o=0;
foreach($arrData["data"] as $key => $arVal)
{
	if($i<9)
	{
		$color = GetNextRGB($color, $total);
		$arChart[] = array("COUNTER"=>$arVal["visits"], "COLOR"=>$color);
	}
	else
	{
		$o+=$arVal["visits"];
$FilterArr = array(
	"find_counter_id",
	"find_date1",
	"find_date2",
);

$lAdmin->InitFilter($FilterArr);

$arFilter = Array(
	"date1"		=> $find_date1,
	"date2"		=> $find_date2,
	"id"	=> $find_counter_id
);

$arrData=CLOLYandexMetrika::GetSourcesDirectPlatforms($arFilter);
//print_r($arrData);

$rsData = new CDBResult;
$rsData->InitFromArray($arrData["data"]);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(""));

$arHeaders = array();

$arHeaders[]=
	array(	"id"		=>"name",
		"content"	=>GetMessage("LOL_METRIKA_NAME"),
		"sort"		=>false,
Exemplo n.º 12
0
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

if(!CModule::IncludeModule("lol.metrika"))
	return false;

$arSites = array(
);
$arrCounter=CLOLYandexMetrika::GetCounterList();
foreach($arrCounter as $arCounter)
{
	$arSites[$arCounter["ID"]] = "[".$arCounter["SITE"]."] ".$arCounter["NAME"];
}	
	

$arGraphParams = array(
	"PAGE_VIEWS" => GetMessage("GD_STAT_P_PAGE_VIEWS"),
	"VISITORS" => GetMessage("GD_STAT_P_VISITORS"),
	"VISITS" => GetMessage("GD_STAT_P_VISITS"),
	"NEW_VISITORS" => GetMessage("GD_STAT_P_NEW_VISITORS"),
);

$arParameters = Array(
	"PARAMETERS"=> Array(),
	"USER_PARAMETERS"=> Array(
		"SITE_ID" => Array(
			"NAME" => GetMessage("GD_STAT_P_COUNTER_ID"),
			"TYPE" => "LIST",
			"VALUES" => $arSites,
			"MULTIPLE" => "N",
			"DEFAULT" => ""