7function CheckFilterDates($date1, $date2, &$date1_wrong, &$date2_wrong, &$date2_less_date1)
10 $date1 = trim($date1);
11 $date2 = trim($date2);
14 $date2_less_date1 =
"N";
15 if ($date1 <>
'' && !
CheckDateTime($date1)) $date1_wrong =
"Y";
16 if ($date2 <>
'' && !
CheckDateTime($date2)) $date2_wrong =
"Y";
17 if ($date1_wrong!=
"Y" && $date2_wrong!=
"Y" && $date1 <>
'' && $date2 <>
'' &&
$DB->CompareDates($date2,$date1)<0) $date2_less_date1=
"Y";
22 $sessAdmin = Application::getInstance()->getSession()[
"SESS_ADMIN"];
23 if ($session && isset($sessAdmin[$varName]) && is_array($sessAdmin[$varName]))
25 $FILTER = $sessAdmin[$varName];
35 $FILTER[$FilterLogic] = $$FilterLogic;
39 $$FilterLogic = ($FILTER[$FilterLogic] ??
'');
45 $period = $arName[
$i].
"_FILTER_PERIOD";
47 $bdays = $arName[
$i].
"_DAYS_TO_BACK";
49 global $$name, $$direction, $$period, $$bdays;
53 $FILTER[
$name] = $$name;
54 if(isset($$period) || isset($FILTER[$period]))
55 $FILTER[$period] = $$period;
57 if(isset($$direction) || isset($FILTER[
$direction]))
60 if(isset($$bdays) || isset($FILTER[$bdays]))
62 $FILTER[$bdays] = $$bdays;
63 if ((
string)$$bdays <>
'' && $$bdays!=
"NOT_REF")
64 $$name =
GetTime(time()-86400*intval($FILTER[$bdays]));
70 $$name = $FILTER[
$name] ??
null;
71 if(isset($$period) || isset($FILTER[$period]))
72 $$period = $FILTER[$period];
74 if(isset($$direction) || isset($FILTER[
$direction]))
77 if (isset($FILTER[$bdays]) && (
string)$FILTER[$bdays] <>
'' && $FILTER[$bdays]!=
"NOT_REF")
79 $$bdays = $FILTER[$bdays];
80 $$name =
GetTime(time()-86400*intval($FILTER[$bdays]));
87 if(!is_array(Application::getInstance()->getSession()[
"SESS_ADMIN"]))
88 Application::getInstance()->getSession()->set(
"SESS_ADMIN", []);
89 Application::getInstance()->getSession()[
"SESS_ADMIN"][$varName] = $FILTER;
93function DelFilterEx($arName, $varName, $session=
true, $FilterLogic=
"FILTER_logic")
98 unset(Application::getInstance()->getSession()[
"SESS_ADMIN"][$varName]);
100 foreach ($arName as
$name)
102 $period =
$name.
"_FILTER_PERIOD";
104 $bdays =
$name.
"_DAYS_TO_BACK";
106 global $$name, $$period, $$direction, $$bdays;
114 $$FilterLogic =
"and";
120 $FILTER = Application::getInstance()->getSession()->get(
"SESS_ADMIN")[$md5Path];
122 foreach ($arName as
$name)
127 $FILTER[
$name] = $$name;
129 $$name = $FILTER[
$name];
132 Application::getInstance()->getSession()->get(
"SESS_ADMIN")[$md5Path] = $FILTER;
138 unset(Application::getInstance()->getSession()->
get(
"SESS_ADMIN")[$md5Path]);
140 foreach ($arName as
$name)
155 $arKeys = @array_merge(array_keys($_GET), array_keys($_POST));
156 if (is_array($arKeys) && !empty($arKeys))
158 foreach (array_unique($arKeys) as
$key)
173 if (is_array($arrVars) && !empty($arrVars))
176 foreach ($arrVars as $var_name)
180 if (is_array($value))
182 foreach($value as $v)
184 $res .=
'<input type="hidden" name="'.htmlspecialcharsbx($var_name).
'[]" value="'.
htmlspecialcharsbx($v).
'">';
187 elseif ((
string)$value <>
'' && $value!=
"NOT_REF")
189 $res .=
'<input type="hidden" name="'.htmlspecialcharsbx($var_name).
'" value="'.
htmlspecialcharsbx($value).
'">';
194 if(is_array($button))
218 $arKeys = @array_merge(array_keys($_GET), array_keys($_POST));
219 if(is_array($arKeys) && !empty($arKeys))
221 foreach (array_unique($arKeys) as
$key)
230 if(is_array($arrVars) && !empty($arrVars))
233 foreach($arrVars as $var_name)
239 foreach($value as $v)
240 $res .=
"&".urlencode($var_name).
"[]=".urlencode($v);
242 elseif((
string)$value <>
'' && $value!=
"NOT_REF")
244 $res .=
"&".urlencode($var_name).
"=".urlencode($value);
249 if(is_array($button))
253 $res .=
"&".$key.
"=".urlencode(
$val);
276 if (is_array($value))
280 foreach($value as $v)
282 $str .=
"&".urlencode(
$var).
"[]=".urlencode($v);
286 elseif ((
string)$value <>
'' && $value!=
"NOT_REF")
288 $str .=
"&".urlencode(
$var).
"=".urlencode($value);
291 return $str.
"&".$button.
"=Y";
299 return '<input type="hidden" name="'.$name.
'_exact_match" value="N">'.
InputType(
"checkbox",
$name.
"_exact_match",
"Y", $$var,
false,
"",
"title='".$title.
"'");
309 if (is_array($value))
311 foreach ($value as
$a)
313 $str .=
"&".$key.urlencode(
"[]").
"=".urlencode(
$a);
316 elseif((
string)$value <>
'' && $value!=
"NOT_REF")
318 $str .=
"&".$key.
"=".urlencode($value);
324function ShowAddFavorite($filterName=
false, $btnName=
"set_filter", $module=
"statistic", $alt=
false)
330 if ($filterName===
false)
332 $url = urlencode(
$_SERVER[
'SCRIPT_NAME'] .
"?" .
$_SERVER[
"QUERY_STRING"] .
GetUrlFromArray(Application::getInstance()->getSession()[
"SESS_ADMIN"][$filterName]).
"&".$btnName.
"=Y");
333 $str =
"<a target='_blank' href='".BX_ROOT.
"/admin/favorite_edit.php?lang=".LANG.
"&module=$module&url=$url'><img alt='".$alt.
"' src='".
BX_ROOT.
"/images/main/add_favorite.gif' width='16' height='16' border=0></a>";
339 return ($strSqlSearch <>
'' && $strSqlSearch!=
"(1=1)" && $strSqlSearch!=
"(1=2)");
344 $var = $FilterLogic.
"_reset";
353 if(LANGUAGE_ID ==
"ru")
354 $help_link =
"https://dev.1c-bitrix.ru/api_help/main/general/filter.php";
356 $help_link =
"https://www.bitrixsoft.com/help/index.html?page=".urlencode(
"source/main/help/en/filter.php.html");
357 if ($LogicHelp !=
"Y")
360 function LogicHelp() { window.open('".$help_link.
"', '','scrollbars=yes,resizable=yes,width=780,height=500,top='+Math.floor((screen.height - 500)/2-14)+',left='+Math.floor((screen.width - 780)/2-5)); }
363 $str .=
"<a title='".GetMessage(
"FILTER_LOGIC_HELP").
"' class='adm-input-help-icon' href='javascript:LogicHelp()'></a>";
370 global $$FilterLogic;
374 if ($$FilterLogic ==
"or")
379 $str =
"<tr><td>".GetMessage(
"FILTER_LOGIC").
"</td><td><input type='radio' name='$FilterLogic' value='and' ".$s_and.
">".
GetMessage(
"AND").
" <input type='radio' name='$FilterLogic' value='or' ".$s_or.
">".
GetMessage(
"OR").
"</td></tr>";
386 $f =
new CFilterQuery(
"and",
"yes", $procent, $ex_sep, $clob, $div_fields, $clob_upper);
399 $var = $FilterLogic.
"_reset";
401 $ResetFilterLogic = $$var;
402 $$FilterLogic = ($$FilterLogic==
"or") ?
"or" :
"and";
403 if($ResetFilterLogic==
"Y" && $$FilterLogic==
"or")
405 $$FilterLogic =
"and";
408 if($$FilterLogic==
"or")
409 $strSqlSearch =
"1=2";
411 $strSqlSearch =
"1=1";
412 if (is_array($arSqlSearch) && !empty($arSqlSearch))
414 foreach ($arSqlSearch as $condition)
416 if ($condition <>
'' && $condition!=
"0")
419 ".mb_strtoupper($$FilterLogic).
"
427 return "($strSqlSearch)";
441function showfilter(id)
443 var div = document.getElementById("flt_div_"+id);
444 var tbl = document.getElementById("flt_table_"+id);
445 var head = document.getElementById("flt_head_"+id);
446 var flts = "", curval = "", oldval="";
447 var aCookie = document.cookie.split("; ");
448 //document.cookie = "flts=X; expires=Thu, 31 Dec 1999 23:59:59 GMT; path='.BX_ROOT.
'/admin/;";return;
449 for (var i=0; i < aCookie.length; i++)
451 var aCrumb = aCookie[i].split("=");
452 if ("flts" == aCrumb[0])
454 if(aCrumb.length>1 && aCrumb[1].length>0)
457 var arFVals = val.split("&");
458 for (var j=0; j < arFVals.length; j++)
464 val = val.split("=");
465 if(val.length>1 && val[1].length>0)
470 flts = flts + escape(val[0] + "=" + val[1]) + "&";
477 if ("flt_"+id == aCrumb[0])
481 if(div.style.display!="none")
483 if(tbl.offsetWidth > 0)
484 head.style.width = tbl.offsetWidth;
486 document.cookie = "flt_"+id+"=X; expires=Fri, 31 Dec 1999 23:59:59 GMT; path='.
BX_ROOT.
'/admin/;";
487 document.cookie = "flts="+flts+escape(id+"=N"+(tbl.offsetWidth))+"; expires=Thu, 31 Dec 2020 23:59:59 GMT; path='.
BX_ROOT.
'/admin/;";
493 document.cookie = "flt_"+id+"=X; expires=Fri, 31 Dec 1999 23:59:59 GMT; path='.
BX_ROOT.
'/admin/;";
494 document.cookie = "flts="+flts+escape(id+"=Y)")+"; expires=Thu, 31 Dec 2020 23:59:59 GMT; path='.
BX_ROOT.
'/admin/;";
495 document.getElementById("flt_link_show_"+id).style.display = "none";
496 document.getElementById("flt_link_hide_"+id).style.display = "inline";
497 document.getElementById("flt_image_"+id).src = "'.
BX_ROOT.
'/images/admin/line_up.gif";
498 document.getElementById("flt_image_"+id).alt = "'.
GetMessage(
"admin_filter_hide").
'";
499 div.style.display = "block";
500 if(tbl.clientWidth > 0)
501 head.style.width = tbl.clientWidth+2;
504function hidefilter(id)
506 document.getElementById("flt_link_show_"+id).style.display = "inline";
507 document.getElementById("flt_link_hide_"+id).style.display = "none";
508 document.getElementById("flt_image_"+id).src = "'.
BX_ROOT.
'/images/admin/line_down.gif";
509 document.getElementById("flt_image_"+id).alt = "'.
GetMessage(
"admin_filter_show").
'";
510 document.getElementById("flt_div_"+id).style.display = "none";
512tmpImage = new Image();
513tmpImage.src = "'.
BX_ROOT.
'/images/admin/line_down.gif";
514tmpImage.src = "'.
BX_ROOT.
'/images/admin/line_up.gif";
520 parse_str($_COOKIE[
"flts"], $arFlts);
523 $fltval = $arFlts[$sID];
524 if(
is_set($_COOKIE,
"flt_".$sID))
525 unset($_COOKIE[
"flt_".$sID]);
528 $fltval = $_COOKIE[
"flt_".$sID];
531<table border="0" cellspacing="0" cellpadding="0" width="'.($fltval[0]==
"N"? intval(mb_substr($fltval, 1)):
'').
'"><tr><td>
532<table border="0" cellspacing="0" cellpadding="0" width="100%" id="flt_head_'.$sID.
'">
534 <td class="tablefilterhead">
535 <table width="100%" border="0" cellspacing="0" cellpadding="0">
541 <td width="0%"><img src="'.BX_ROOT.
'/images/admin/'.($bFilterSet?
"green.gif":
"grey.gif").
'" alt="" width="16" height="16" border="0" hspace="1" vspace="1"></td>
542 <td width="0%"><font class="tableheadtext"> </font></td>
543 <td width="100%" nowrap><font class="tableheadtext">'.($bFilterSet?
GetMessage(
"admin_filter_filter_set"):
GetMessage(
"admin_filter_filter_not_set")).
'</font></td>
544 <td width="0%"><font class="tableheadtext"> </font></td>
550 <td width="100%"><img src="/bitrix/images/1.gif" width="1" height="18" alt=""></td>
554 <td width="0%"><font class="tableheadtext"><div id="flt_link_hide_'.$sID.
'" style="display:inline;"><a href="javascript:showfilter(\''.$sID.
'\');
" title="'.GetMessage("admin_filter_hide").'">'.GetMessage("admin_filter_hide2
").'</a></div><div id="flt_link_show_
'.$sID.'" style="display:none;
"><a href="javascript:showfilter(\
''.$sID.
'\');
" title="'.GetMessage("admin_filter_show").'">'.GetMessage("admin_filter_show2
").'</a></div></font></td>
555 <td width="0%
"><font class="tableheadtext
"> </font><a href="javascript:showfilter(\
''.$sID.
'\');
"><img id="flt_image_
'.$sID.'" src="'.BX_ROOT.'/images/admin/line_up.gif
" alt="'.GetMessage("admin_filter_hide").'" width="30
" height="11
" border="0
" hspace="3
"></a></td>
561<div id="flt_div_
'.$sID.'">
562<table border="0
" cellspacing="1
" cellpadding="0
" class="filter
" id="flt_table_
'.$sID.'" width="100%
">
567function EndFilter($sID="")
578 parse_str($_COOKIE["flts
"], $arFlts);
579 if(is_set($arFlts, $sID))
580 $fltval = $arFlts[$sID];
582 $fltval = $_COOKIE["flt_
".$sID];
585 $s .= '<script>hidefilter(\''.CUtil::JSEscape($sID).'\');</script>'."\n
";
589function BeginNote($sParams = '', $sMessParams = '')
591 if (defined("PUBLIC_MODE
") && PUBLIC_MODE == 1)
593 \Bitrix\Main\UI\Extension::load("ui.alerts
");
594 return '<div class="ui-alert ui-alert-warning
" '.$sParams.'><div class="ui-btn-message
">';
598 return '<div class="adm-info-message-wrap
" '.$sParams.'><div class="adm-info-message
" '.$sMessParams.'>';
608function ShowSubMenu($aMenu)
611<table cellspacing=0 cellpadding=0 border=0 >
613<td width="6
"><img height=6 alt="" src="/bitrix/images/admin/mn_ltc.gif
" width=6></td>
614<td background=/bitrix/images/admin/mn_tline.gif><img height=1 alt="" src="/bitrix/images/1.gif
" width=1></td>
615<td width="6
"><img height=6 alt="" src="/bitrix/images/admin/mn_rtc.gif
" width=6></td></tr>
617<td width="6
" background=/bitrix/images/admin/mn_lline.gif><img height=1 alt="" src="/bitrix/images/1.gif
" width=1></td>
618<td valign=top class="submenutable
">
620<table border="0
" cellspacing="0
" cellpadding="0
">
622 <td><font class="submenutext
">
624foreach($aMenu as $menu)
626 if($menu["SEPARATOR
"]<>"")
630<td width=13 background="/bitrix/images/admin/mn_delim.gif
"><img height=1 alt="" src="/bitrix/images/1.gif
" width=13></td>
631<td><font class="submenutext
">
636<table border="0
" cellspacing="0
" cellpadding="0
">
638 <td width="7
"><img src="/bitrix/images/admin/arr_right
'.($menu["WARNING"]<>""? "_red":"").'.gif
" alt="" width="7
" height="7
" border="0
" vspace="4
"></td>
639 <td class="submenutext
"> </td>
640 <td><font class="submenutext
"><a class="submenutext
" title="'.$menu["TITLE"].'" href="'.$menu["LINK"].'" '.$menu["LINK_PARAM
"].'>'.$menu["TEXT
"].'</a>'.$menu["TEXT_PARAM
"].'</font></td>
649<td width="6
" background=/bitrix/images/admin/mn_rline.gif><img height=1 alt="" src="/bitrix/images/1.gif
" width=1></td></tr>
651<td width="6
"><img height=6 alt="" src="/bitrix/images/admin/mn_lbc.gif
" width=6></td>
652<td background=/bitrix/images/admin/mn_bline.gif><img height=1 alt="" src="/bitrix/images/1.gif
" width=1></td>
653<td width="6
"><img height=6 alt="" src="/bitrix/images/admin/mn_rbc.gif
" width=6></td></tr>
659function InitSorting($Path=false, $sByVar="by
", $sOrderVar="order
")
661 global $APPLICATION, $$sByVar, $$sOrderVar;
664 $Path = $APPLICATION->GetCurPage();
666 $md5Path = md5($Path);
669 Application::getInstance()->getSession()["SESS_SORT_BY
"][$md5Path] = $$sByVar;
671 $$sByVar = Application::getInstance()->getSession()["SESS_SORT_BY
"][$md5Path] ?? '';
673 if($$sOrderVar <> '')
674 Application::getInstance()->getSession()["SESS_SORT_ORDER
"][$md5Path] = $$sOrderVar;
676 $$sOrderVar = Application::getInstance()->getSession()["SESS_SORT_ORDER
"][$md5Path] ?? '';
678 $$sByVar = strtolower($$sByVar);
679 $$sOrderVar = strtolower($$sOrderVar);
682function SortingEx($By, $Path = false, $sByVar="by
", $sOrderVar="order
", $Anchor="nav_start
")
686 $sImgDown = "<img src=\
"".BX_ROOT.
"/images/icons/up.gif\" width=\"15\" height=\"15\" border=\"0\" alt=\"".
GetMessage(
"ASC_ORDER").
"\">";
687 $sImgUp =
"<img src=\"".BX_ROOT.
"/images/icons/down.gif\" width=\"15\" height=\"15\" border=\"0\" alt=\"".
GetMessage(
"DESC_ORDER").
"\">";
689 global $$sByVar, $$sOrderVar;
693 if(mb_strtoupper($By) == mb_strtoupper($by))
695 if(mb_strtoupper(
$order) ==
"DESC")
696 $sImgUp =
"<img src=\"".BX_ROOT.
"/images/icons/down-$$$.gif\" width=\"15\" height=\"15\" border=\"0\" alt=\"".
GetMessage(
"DESC_ORDER").
"\">";
698 $sImgDown =
"<img src=\"".BX_ROOT.
"/images/icons/up-$$$.gif\" width=\"15\" height=\"15\" border=\"0\" alt=\"".
GetMessage(
"ASC_ORDER").
"\">";
706 $found = mb_strpos($Path,
"?");
707 if ($found ===
false) $strAdd2URL =
"?";
708 else $strAdd2URL =
"&";
710 $Path = preg_replace(
"/([?&])".$sByVar.
"=[^&]*[&]*/i",
"\\1", $Path);
711 $Path = preg_replace(
"/([?&])".$sOrderVar.
"=[^&]*[&]*/i",
"\\1", $Path);
713 $strTest = mb_substr($Path, mb_strlen($Path) - 1);
714 if($strTest==
"&" OR $strTest ==
"?")
717 return "<nobr><a href=\"".htmlspecialcharsbx($Path.$strAdd2URL.$sByVar.
"=".$By.
"&".$sOrderVar.
"=asc#".$Anchor).
"\">".$sImgDown.
"</a>".
718 "<a href=\"".htmlspecialcharsbx($Path.$strAdd2URL.$sByVar.
"=".$By.
"&".$sOrderVar.
"=desc#".$Anchor).
"\">".$sImgUp.
"</a></nobr>";
change_password_forgot_link login popup forget pas AUTH_GOTO_FORGOT_FORM login btn wrap change_password_button login popup link login popup return auth javascript
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
$_SERVER["DOCUMENT_ROOT"]
GetPagePath($page=false, $get_index_page=null)
InputType($strType, $strName, $strValue, $strCmp, $strPrintValue=false, $strPrint="", $field1="", $strId="")
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
GetTime($timestamp, $type="SHORT", $site=false, $bSearchInSitesOnly=false)
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."%"
adm detail iblock types adm detail iblock list tr_SITE_ID display