15 return "(".($negative==
"Y"?
" A.ITEM_MD5 IS NULL OR NOT ":
"").
"(A.ITEM_MD5 ".$operation.
" '".
$GLOBALS[
"DB"]->ForSql($val1).
"' )".
")";
19 public static function CheckAccess($userID, $itemMD5, $periodLength, $periodType)
23 $userID = intval($userID);
27 $itemMD5 = Trim($itemMD5);
31 $periodLength = intval($periodLength);
32 if ($periodLength <= 0)
35 $periodType = Trim($periodType);
36 $periodType = mb_strtoupper($periodType);
37 if ($periodType ==
'')
41 if ($periodType ==
"I")
42 $checkVal = mktime(date(
"H"), date(
"i") - $periodLength, date(
"s"), date(
"m"), date(
"d"), date(
"Y"));
43 elseif ($periodType ==
"H")
44 $checkVal = mktime(date(
"H") - $periodLength, date(
"i"), date(
"s"), date(
"m"), date(
"d"), date(
"Y"));
45 elseif ($periodType ==
"D")
46 $checkVal = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m"), date(
"d") - $periodLength, date(
"Y"));
47 elseif ($periodType ==
"W")
48 $checkVal = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m"), date(
"d") - 7 * $periodLength, date(
"Y"));
49 elseif ($periodType ==
"M")
50 $checkVal = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") - $periodLength, date(
"d"), date(
"Y"));
51 elseif ($periodType ==
"Q")
52 $checkVal = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") - 3 * $periodLength, date(
"d"), date(
"Y"));
53 elseif ($periodType ==
"S")
54 $checkVal = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") - 6 * $periodLength, date(
"d"), date(
"Y"));
55 elseif ($periodType ==
"Y")
56 $checkVal = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m"), date(
"d"), date(
"Y") - $periodLength);
65 "ITEM_MD5" => $itemMD5,
66 ">=DATE_INSERT" => Date(
$GLOBALS[
"DB"]->DateFormatToPHP(CSite::GetDateFormat(
"FULL",
SITE_ID)), $checkVal)
72 if ($arAuxiliary = $dbAuxiliary->Fetch())
83 $GLOBALS[
"APPLICATION"]->ThrowException(
"Empty user field",
"EMPTY_USER_ID");
88 $GLOBALS[
"APPLICATION"]->ThrowException(
"Empty item field",
"EMPTY_ITEM");
93 $GLOBALS[
"APPLICATION"]->ThrowException(
"Empty item md5 field",
"EMPTY_ITEM_MD5");
98 $GLOBALS[
"APPLICATION"]->ThrowException(
"Empty date insert field",
"EMPTY_DATE_INSERT");
107 $dbUser = CUser::GetByID(
$arFields[
"USER_ID"]);
108 if (!$dbUser->Fetch())
110 $GLOBALS[
"APPLICATION"]->ThrowException(str_replace(
"#ID#",
$arFields[
"USER_ID"],
GetMessage(
"SGMA_NO_USER")),
"ERROR_NO_USER_ID");
118 $arFields[
'~TIMESTAMP_X'] = $helper->getCurrentDateTimeFunction();
131 return $DB->Query(
"DELETE FROM b_sale_auxiliary WHERE ID = ".
$ID.
" ",
true);
138 $userID = intval($userID);
142 return $DB->Query(
"DELETE FROM b_sale_auxiliary WHERE USER_ID = ".$userID.
" ",
true);
148 $userID = intval($userID);
165 return 'CSaleAuxiliary::DeleteOldAgent('.$periodLength.
', "'.$periodType.
'");';
static PrepareItemMD54Where($val, $key, $operation, $negative, $field, &$arField, &$arFilter)
static DeleteOldAgent($periodLength, $periodType)
static DeleteByUserID($userID)
static CheckFields($ACTION, &$arFields, $ID=0)
static OnUserDelete($userID)
static CheckAccess($userID, $itemMD5, $periodLength, $periodType)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static DeleteByTime($periodLength, $periodType)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if(empty($signedUserToken)) $key
$GLOBALS['_____370096793']