2require_once(
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/statistic/classes/general/stoplist.php");
8 $DB = CDatabase::GetModuleConnection(
'statistic');
9 $arSqlSearch = Array();
21 if( ((
string)
$val ==
'') || (
$val ===
"NOT_REF") )
24 $match_value_set = array_key_exists(
$key.
"_EXACT_MATCH",
$arFilter);
29 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
34 $arSqlSearch[] =
"S.DATE_START >= ".$DB->CharToDateFunction(
$val,
"SHORT");
38 $arSqlSearch[] =
"S.DATE_START < ".CStatistics::DBDateAdd(
$DB->CharToDateFunction(
$val,
"SHORT"), 1);
42 $arSqlSearch[] =
"S.DATE_END >= ".$DB->CharToDateFunction(
$val,
"SHORT");
46 $arSqlSearch[] =
"S.DATE_END < ".CStatistics::DBDateAdd(
$DB->CharToDateFunction(
$val,
"SHORT"), 1);
49 case "SAVE_STATISTIC":
50 $arSqlSearch[] = (
$val==
"Y") ?
"S.".
$key.
"='Y'" :
"S.".$key.
"='N'";
56 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
60 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
66 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
70 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
74 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"Y" && $match_value_set) ?
"N" :
"Y";
79 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
90 $strSqlOrder =
"ORDER BY S.ID $order";
91 elseif ($by ==
"s_date_start")
92 $strSqlOrder =
"ORDER BY S.DATE_START $order";
93 elseif ($by ==
"s_site_id")
94 $strSqlOrder =
"ORDER BY S.SITE_ID $order";
95 elseif ($by ==
"s_date_end")
96 $strSqlOrder =
"ORDER BY S.DATE_END $order";
98 $strSqlOrder =
"ORDER BY S.ACTIVE $order";
99 elseif ($by ==
"s_save_statistic")
100 $strSqlOrder =
"ORDER BY S.SAVE_STATISTIC $order";
102 $strSqlOrder =
"ORDER BY S.IP_1 $order, S.IP_2 $order, S.IP_3 $order, S.IP_4 $order";
104 $strSqlOrder =
"ORDER BY S.MASK_1 $order, S.MASK_2 $order, S.MASK_3 $order, S.MASK_4 $order";
105 elseif ($by ==
"s_url_to")
106 $strSqlOrder =
"ORDER BY S.URL_TO $order";
107 elseif ($by ==
"s_url_from")
108 $strSqlOrder =
"ORDER BY S.URL_FROM $order";
111 $strSqlOrder =
"ORDER BY S.ID $order";
117 S.ID, S.ACTIVE, S.SAVE_STATISTIC,
118 S.IP_1, S.IP_2, S.IP_3, S.IP_4,
119 S.MASK_1, S.MASK_2, S.MASK_3, S.MASK_4,
120 S.USER_AGENT, S.USER_AGENT_IS_NULL,
121 S.URL_TO, S.URL_FROM, S.MESSAGE, S.MESSAGE_LID,
122 S.URL_REDIRECT, S.COMMENTS, S.TEST, S.SITE_ID,
123 ".$DB->DateToCharFunction(
"S.TIMESTAMP_X").
" TIMESTAMP_X,
124 ".
$DB->DateToCharFunction(
"S.DATE_END").
" DATE_END,
125 ".
$DB->DateToCharFunction(
"S.DATE_START").
" DATE_START,
127 (S.DATE_START<=now() or S.DATE_START is null) and
128 (S.DATE_END>=now() or S.DATE_END is null) and
137 LIMIT ".intval(COption::GetOptionString(
'statistic',
'RECORDS_LIMIT')).
"
147 $DB = CDatabase::GetModuleConnection(
'statistic');
149 $test = ($test==
"Y") ?
"Y" :
"N";
151 $arStopRecord =
false;
161 $ip =
array(0, 0, 0, 0);
165 if (!empty(
$_SERVER[
"REMOTE_ADDR"]))
167 $ip = explode(
".",
$_SERVER[
"REMOTE_ADDR"]);
169 $user_agent = trim(
$_SERVER[
"HTTP_USER_AGENT"] ??
'');
170 $url_from =
$_SERVER[
"HTTP_REFERER"] ??
'';
172 if (defined(
"SITE_ID"))
178 $user_agent = trim(
$arParams[
"USER_AGENT"]);
184 $user_agent_len = mb_strlen($user_agent);
185 $user_agent =
$DB->ForSql($user_agent, 500);
186 $url_from =
$DB->ForSql($url_from, 2000);
187 $url_to =
$DB->ForSql($url_to, 2000);
190 $site_where =
"and (SITE_ID = '".$DB->ForSql(
$site_id, 2).
"' or SITE_ID is null or length(SITE_ID)<=0)";
207 and (DATE_START<=now() or DATE_START is null)
208 and (DATE_END>=now() or DATE_END is null)
209 and ((((MASK_1 & ".intval($ip[0]).
")=IP_1 and
210 (MASK_2 & ".intval($ip[1]).
")=IP_2 and
211 (MASK_3 & ".intval($ip[2]).
")=IP_3 and
212 (MASK_4 & ".intval($ip[3]).
")=IP_4)
213 or (IP_1 is null and IP_2 is null and IP_3 is null and IP_4 is null))
214 and (upper('".
$DB->ForSql($user_agent).
"') like concat('%',upper(USER_AGENT),'%')
215 or length(USER_AGENT)<=0 or USER_AGENT is null)
216 and ($user_agent_len=0 or USER_AGENT_IS_NULL<>'Y')
217 and (upper('$url_from') like concat('%',upper(URL_FROM),'%')
218 or length(URL_FROM)<=0 or URL_FROM is null)
219 and (upper('$url_to') like concat('%',upper(URL_TO),'%')
220 or length(URL_TO)<=0 or URL_TO is null)
224 $z =
$DB->Query($strSql);
225 if(
$zr =
$z->Fetch())
227 $arStopRecord =
array(
229 "STOP_SAVE_STATISTIC" =>
$zr[
"SAVE_STATISTIC"],
230 "STOP_MESSAGE" =>
$zr[
"MESSAGE"],
231 "STOP_REDIRECT_URL" =>
$zr[
"URL_REDIRECT"],
232 "STOP_MESSAGE_LID" =>
$zr[
"MESSAGE_LID"],
233 "STOP_LIST_ID" =>
$zr[
"ID"],
238 $arStopRecord =
array(
240 "STOP_SAVE_STATISTIC" =>
"Y",
241 "STOP_MESSAGE" =>
"",
242 "STOP_REDIRECT_URL" =>
"",
243 "STOP_MESSAGE_LID" =>
"",
260 foreach($arStopRecord as
$key => $value)
269 return intval(
$zr[
"ID"]);
static Check($test="N", $arParams=false)
static GetList($by='s_id', $order='desc', $arFilter=[])
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
CheckDateTime($datetime, $format=false)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
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."%"
$GLOBALS['_____370096793']