5 public static function SetByReferer($referer1, $referer2, &$arrADV, &$ref1, &$ref2)
7 $DB = CDatabase::GetModuleConnection(
'statistic');
10 $referer1 = trim($referer1);
11 $referer1_sql = $referer1 <>
''?
"REFERER1='".$DB->ForSql($referer1, 255).
"'":
"(REFERER1 is null or ".$DB->Length(
"REFERER1").
"=0)";
12 $referer2 = trim($referer2);
13 $referer2_sql = $referer2 <>
''?
"REFERER2='".$DB->ForSql($referer2, 255).
"'":
"(REFERER2 is null or ".$DB->Length(
"REFERER2").
"=0)";
26 $w =
$DB->Query($strSql);
29 while ($wr = $w->Fetch())
33 $arrADV[] = intval($wr[
"ID"]);
34 $ref1 = $wr[
"REFERER1"];
35 $ref2 = $wr[
"REFERER2"];
41 if(COption::GetOptionString(
"statistic",
"ADV_NA") ==
"Y")
43 $NA_1 = COption::GetOptionString(
"statistic",
"AVD_NA_REFERER1");
44 $NA_2 = COption::GetOptionString(
"statistic",
"AVD_NA_REFERER2");
45 if (($NA_1 <>
'' || $NA_2 <>
'') && $referer1==$NA_1 && $referer2==$NA_2)
49 if((COption::GetOptionString(
"statistic",
"ADV_AUTO_CREATE") ==
"Y") || ($NA ==
"Y"))
51 if(COption::GetOptionString(
"statistic",
"REFERER_CHECK") ==
"Y")
53 $bGoodR = preg_match(
"/^([0-9A-Za-z_:;.,-])*$/", $referer1);
55 $bGoodR = preg_match(
"/^([0-9A-Za-z_:;.,-])*$/", $referer2);
66 "REFERER1" => $referer1 <>
'' ?
"'".
$DB->ForSql($referer1, 255).
"'" :
"null",
67 "REFERER2" => $referer2 <>
'' ?
"'".$DB->ForSql($referer2, 255).
"'" :
"null",
68 "DATE_FIRST" =>
$DB->GetNowFunction(),
69 "DATE_LAST" =>
$DB->GetNowFunction(),
81 $DB = CDatabase::GetModuleConnection(
'statistic');
90 INNER JOIN b_stat_adv_page AP ON (AP.ADV_ID = A.ID and AP.C_TYPE='".$DB->ForSQL(
$type).
"')
93 and ".
$DB->Length(
"AP.PAGE").
" > 0
94 and '".
$DB->ForSQL(
$page).
"' like ".
$DB->Concat(
"'%'",
"AP.PAGE",
"'%'").
"
97 $w =
$DB->Query($strSql);
98 while ($wr=$w->Fetch())
100 $arrADV[] = intval($wr[
"ID"]);
101 $ref1 = $wr[
"REFERER1"];
102 $ref2 = $wr[
"REFERER2"];
109 $DB = CDatabase::GetModuleConnection(
'statistic');
111 $arSqlSearch = Array();
114 case "SESSION_SUMMA":
117 case "VISITOR_SUMMA":
147 if( ((
string)
$val ==
'') || (
$val ===
"NOT_REF") )
150 $match_value_set = array_key_exists(
$key.
"_EXACT_MATCH",
$arFilter);
156 $arSqlSearch[] =
"D.DATE_STAT>=".$DB->CharToDateFunction(
$val,
"SHORT");
160 $arSqlSearch[] =
"D.DATE_STAT<=".$DB->CharToDateFunction(
$val.
" 23:59:59",
"FULL");
162 case "EVENT_TYPE_ID":
165 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
171 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
176 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
181 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
188 $arrLegend =
array();
193 $rsD =
$DB->Query($strSql);
194 while ($arD = $rsD->Fetch())
198 default: $cnt = intval($arD[
"SESSIONS"])+intval($arD[
"SESSIONS_BACK"]);
break;
199 case "SESSION": $cnt = intval($arD[
"SESSIONS"]);
break;
200 case "SESSION_BACK": $cnt = intval($arD[
"SESSIONS_BACK"]);
break;
201 case "VISITOR_SUMMA": $cnt = intval($arD[
"GUESTS"])+intval($arD[
"GUESTS_BACK"]);
break;
202 case "VISITOR": $cnt = intval($arD[
"GUESTS"]);
break;
203 case "VISITOR_BACK": $cnt = intval($arD[
"GUESTS_BACK"]);
break;
204 case "NEW_VISITOR": $cnt = intval($arD[
"NEW_GUESTS"]);
break;
205 case "FAV_SUMMA": $cnt = intval($arD[
"FAVORITES"])+intval($arD[
"FAVORITES_BACK"]);
break;
206 case "FAV": $cnt = intval($arD[
"FAVORITES"]);
break;
207 case "FAV_BACK": $cnt = intval($arD[
"FAVORITES_BACK"]);
break;
208 case "HOST_SUMMA": $cnt = intval($arD[
"C_HOSTS"])+intval($arD[
"HOSTS_BACK"]);
break;
209 case "HOST": $cnt = intval($arD[
"C_HOSTS"]);
break;
210 case "HOST_BACK": $cnt = intval($arD[
"HOSTS_BACK"]);
break;
211 case "HIT_SUMMA": $cnt = intval($arD[
"HITS"])+intval($arD[
"HITS_BACK"]);
break;
212 case "HIT": $cnt = intval($arD[
"HITS"]);
break;
213 case "HIT_BACK": $cnt = intval($arD[
"HITS_BACK"]);
break;
214 case "EVENT_SUMMA": $cnt = intval($arD[
"EVENTS"])+intval($arD[
"EVENTS_BACK"]);
break;
215 case "EVENT": $cnt = intval($arD[
"EVENTS"]);
break;
216 case "EVENT_BACK": $cnt = intval($arD[
"EVENTS_BACK"]);
break;
217 case "MONEY_SUMMA": $cnt = doubleval($arD[
"MONEY"])+doubleval($arD[
"MONEY_BACK"]);
break;
218 case "MONEY": $cnt = doubleval($arD[
"MONEY"]);
break;
219 case "MONEY_BACK": $cnt = doubleval($arD[
"MONEY_BACK"]);
break;
223 $arrDays[$arD[
"DATE_STAT"]][
"D"] = $arD[
"DAY"];
224 $arrDays[$arD[
"DATE_STAT"]][
"M"] = $arD[
"MONTH"];
225 $arrDays[$arD[
"DATE_STAT"]][
"Y"] = $arD[
"YEAR"];
226 $arrDays[$arD[
"DATE_STAT"]][$arD[
"ADV_ID"]] = $cnt;
227 $arrLegend[$arD[
"ADV_ID"]][
"ID"] = $arD[
"ADV_ID"];
228 $arrLegend[$arD[
"ADV_ID"]][
"R1"] = $arD[
"REFERER1"];
229 $arrLegend[$arD[
"ADV_ID"]][
"R2"] = $arD[
"REFERER2"];
230 $arrSum[$arD[
"ADV_ID"]] += $cnt;
237 $total =
sizeof($arrLegend);
238 foreach ($arrLegend as
$key =>
$arr)
241 $arr[
"CLR"] = $color;
243 $arrLegend[
$key][
"SM"] = $arrSum[
$key];
244 $summa += $arrSum[
$key];
254 $DB = CDatabase::GetModuleConnection(
'statistic');
259 $strSql =
"DELETE FROM b_stat_adv_page WHERE ADV_ID=$ID";
261 $strSql =
"DELETE FROM b_stat_adv WHERE ID=$ID";
270 $DB = CDatabase::GetModuleConnection(
'statistic');
274 $DB->StartTransaction();
275 $strSql =
"DELETE FROM b_stat_adv_guest WHERE ADV_ID=$ID";
277 $strSql =
"DELETE FROM b_stat_adv_event WHERE ADV_ID=$ID";
279 $strSql =
"DELETE FROM b_stat_adv_searcher WHERE ADV_ID=$ID";
281 $strSql =
"DELETE FROM b_stat_adv_day WHERE ADV_ID=$ID";
283 $strSql =
"DELETE FROM b_stat_adv_event_day WHERE ADV_ID=$ID";
285 $strSql =
"DELETE FROM b_stat_path_adv WHERE ADV_ID=$ID";
294 "DATE_FIRST" =>
"null",
295 "DATE_LAST" =>
"null",
297 "FAVORITES_BACK" => 0,
299 "SESSIONS_BACK" => 0,
302 $DB->Update(
"b_stat_adv",
$arFields,
"WHERE ID=$ID",
'',
false,
false,
false);
315 while (
$zr=
$z->Fetch()) $d++;
static GetAnalysisGraphArray_SQL($strSqlSearch, $DATA_TYPE)
static GetDynamicList($ADV_ID, $by='s_date', $order='desc', &$arMaxMin=[], $arFilter=[])
static SetByPage($page, &$arrADV, &$ref1, &$ref2, $type="TO")
static DynamicDays($ADV_ID, $date1="", $date2="")
static GetAnalysisGraphArray($arFilter, &$is_filtered, $DATA_TYPE="SESSION_SUMMA", &$arrLegend, &$summa, &$max)
static SetByReferer($referer1, $referer2, &$arrADV, &$ref1, &$ref2)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
GetNextRGB($base_color, $total)
CheckDateTime($datetime, $format=false)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"