6 public static function Delete(
$ID, $DELETE_EVENT=
"Y")
8 $DB = CDatabase::GetModuleConnection(
'statistic');
11 $strSql =
"SELECT ID FROM b_stat_event_list WHERE EVENT_ID='$ID'";
12 $a =
$DB->Query($strSql);
13 while (
$ar =
$a->Fetch())
18 $DB->Query(
"DELETE FROM b_stat_event_day WHERE EVENT_ID='$ID'");
19 if ($DELETE_EVENT==
"Y")
21 $DB->Query(
"DELETE FROM b_stat_event WHERE ID='$ID'");
25 $DB->Query(
"UPDATE b_stat_event SET DATE_ENTER=null WHERE ID='$ID'");
33 $DB = CDatabase::GetModuleConnection(
'statistic');
34 $arSqlSearch = Array();
47 if( ((
string)
$val ==
'') || (
$val ===
"NOT_REF") )
50 $match_value_set = array_key_exists(
$key.
"_EXACT_MATCH",
$arFilter);
55 $match = (
$arFilter[
$key.
"_EXACT_MATCH"]==
"N" && $match_value_set) ?
"Y" :
"N";
60 $arSqlSearch[] =
"D.DATE_STAT>=".$DB->CharToDateFunction(
$val,
"SHORT");
64 $arSqlSearch[] =
"D.DATE_STAT<=".$DB->CharToDateFunction(
$val.
" 23:59:59",
"FULL");
72 $summa =
$arFilter[
"SUMMA"]==
"Y" ?
"Y" :
"N";
74 $rsD =
$DB->Query($strSql);
75 while ($arD = $rsD->Fetch())
77 $arrDays[$arD[
"DATE_STAT"]][
"D"] = $arD[
"DAY"];
78 $arrDays[$arD[
"DATE_STAT"]][
"M"] = $arD[
"MONTH"];
79 $arrDays[$arD[
"DATE_STAT"]][
"Y"] = $arD[
"YEAR"];
82 $arrDays[$arD[
"DATE_STAT"]][$arD[
"EVENT_ID"]][
"COUNTER"] = $arD[
"COUNTER"];
83 $arrDays[$arD[
"DATE_STAT"]][$arD[
"EVENT_ID"]][
"MONEY"] = $arD[
"MONEY"];
84 $arrLegend[$arD[
"EVENT_ID"]][
"COUNTER_TYPE"] =
"DETAIL";
85 $arrLegend[$arD[
"EVENT_ID"]][
"NAME"] = ($arD[
"NAME"] <>
'') ? $arD[
"NAME"] : $arD[
"EVENT1"].
" / ".$arD[
"EVENT2"];
89 $arrDays[$arD[
"DATE_STAT"]][
"COUNTER"] += $arD[
"COUNTER"];
90 $arrDays[$arD[
"DATE_STAT"]][
"MONEY"] += $arD[
"MONEY"];
91 $arrLegend[0][
"COUNTER_TYPE"] =
"TOTAL";
96 $total =
sizeof($arrLegend);
100 $arrLegend[
$key][
"COLOR"] = $color;
108 $err_mess =
"File: ".__FILE__.
"<br>Line: ";
109 $DB = CDatabase::GetModuleConnection(
'statistic');
111 $arEventType = $w->Fetch();
112 $EVENT_ID = intval($arEventType[
"EVENT_ID"]);
116 if ($event1 <>
'' || $event2 <>
'')
120 "EVENT1" => ($event1 <>
'') ?
"'".
$DB->ForSql($event1,200).
"'" :
"null",
121 "EVENT2" => ($event2 <>
'') ?
"'".$DB->ForSql($event2,200).
"'" :
"null",
122 "DATE_ENTER" =>
"null"
124 $EVENT_ID =
$DB->Insert(
"b_stat_event",
$arFields, $err_mess.__LINE__);
127 return intval($EVENT_ID);
132 $DB = CDatabase::GetModuleConnection(
'statistic');
133 $event1 =
$DB->ForSql(trim($event1),200);
134 $event2 =
$DB->ForSql(trim($event2),200);
135 $where1 = ($event1 ==
'') ?
"(EVENT1='' or EVENT1 is null)" :
"(EVENT1 = '$event1')";
136 $where2 = ($event2 ==
'') ?
"(EVENT2='' or EVENT2 is null)" :
"(EVENT2 = '$event2')";
144 ".$DB->DateToCharFunction(
"DATE_ENTER").
" DATE_ENTER_STR
147 WHERE $where1 and $where2
149 $w =
$DB->Query($strSql);
153 public static function DynamicDays($EVENT_ID, $date1=
"", $date2=
"")
159 while(
$zr =
$z->Fetch())
160 if(intval(
$zr[
"COUNTER"]) > 0)
170 $aMsg[] =
array(
"id"=>
"EVENT1",
"text"=>
GetMessage(
"STAT_FORGOT_EVENT1"));
172 $aMsg[] =
array(
"id"=>
"EVENT2",
"text"=>
GetMessage(
"STAT_FORGOT_EVENT2"));
177 $aMsg[] =
array(
"id"=>
"EVENT1",
"text"=>
GetMessage(
"STAT_WRONG_EVENT"));
183 $GLOBALS[
"APPLICATION"]->ThrowException($e);
static Delete($ID, $DELETE_EVENT="Y")
CheckFields($arFields, $ID)
static ConditionSet($event1, $event2, &$arEventType)
static GetByEvents($event1, $event2)
static DynamicDays($EVENT_ID, $date1="", $date2="")
static GetGraphArray($arFilter, &$arrLegend)
static GetGraphArray_SQL($strSqlSearch)
static GetDynamicList($EVENT_ID, $by='s_date', $order='desc', &$arMaxMin=[], $arFilter=[])
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
GetNextRGB($base_color, $total)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
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']