$str.= GetMessage("MAIN_FROM_TILL_LAST_LOGIN")."<br>"; } $strError .= $str; if(strlen($str)>0) { global $lAdmin; $lAdmin->AddFilterError($str); return false; } return true; } $arFilter = Array(); if(CheckFilter($arFilterFields)) { $arFilter = Array( "ID" => $find_id, "TIMESTAMP_1" => $find_timestamp_1, "TIMESTAMP_2" => $find_timestamp_2, "LAST_LOGIN_1" => $find_last_login_1, "LAST_LOGIN_2" => $find_last_login_2, "ACTIVE" => $find_active, "LOGIN" => ($find!='' && $find_type == "login"? $find: $find_login), "NAME" => ($find!='' && $find_type == "name"? $find: $find_name), "EMAIL" => ($find!='' && $find_type == "email"? $find: $find_email), "KEYWORDS" => $find_keywords, "GROUPS_ID" => $find_group_id ); }
} } function CheckFilter() { global $FilterArr, $lAdmin; foreach ($FilterArr as $f) { global ${$f}; } return count($lAdmin->arFilterErrors) == 0; } $FilterArr = array("find_email", "find_name", "find_mailing", "find_mailing_chain_id", "find_sent", "find_read", "find_click", "find_unsub"); $lAdmin->InitFilter($FilterArr); $arRuntime = array(); $arGroup = array(); $arSelect = array('NAME', 'EMAIL'); if (CheckFilter() || $ID > 0) { $arFilter = array("%NAME" => $find_name, "%EMAIL" => $find_email, "=POSTING.MAILING_ID" => $MAILING_ID, "=POSTING.MAILING_CHAIN_ID" => $ID); foreach ($arFilter as $k => $v) { if (empty($v)) { unset($arFilter[$k]); } } if ($find_sent && in_array($find_sent, array_keys(\Bitrix\Sender\PostingRecipientTable::getStatusList()))) { $arFilter["=STATUS"] = $find_sent; } if ($find_read == 'Y') { $arRuntime[] = new \Bitrix\Main\Entity\ReferenceField('READ_TBL', 'Bitrix\\Sender\\PostingReadTable', array('=this.ID' => 'ref.RECIPIENT_ID'), array('join_type' => 'INNER')); $arGroup = $arSelect; } elseif ($find_read == 'N') { $arRuntime[] = new \Bitrix\Main\Entity\ReferenceField('READ_TBL', 'Bitrix\\Sender\\PostingReadTable', array('=this.ID' => 'ref.RECIPIENT_ID'), array('join_type' => 'LEFT')); $arFilter['READ_TBL.RECIPIENT_ID'] = null;
} $needGroup = false; $arFilter = array(); $oSort = new CAdminSorting($sTableID, "ID", "desc"); $lAdmin = new CAdminList($sTableID, $oSort); function CheckFilter() { global $FilterArr, $lAdmin; foreach ($FilterArr as $f) { global ${$f}; } return count($lAdmin->arFilterErrors) == 0; } $FilterArr = array("find_name", "find_email", "find_list", "find_subscribed", "find_unsubscribed"); $lAdmin->InitFilter($FilterArr); if (CheckFilter()) { $arFilter = array("%NAME" => $find_name, "%EMAIL" => $find_email); if ($find_list > 0) { $arFilter["=CONTACT_LIST.LIST_ID"] = $find_list; } elseif (!empty($find_list)) { $arFilter["=CONTACT_LIST.LIST_ID"] = $find_list; } if (!empty($find_subscribed)) { if ($find_subscribed == 'ALL') { $arFilter[">MAILING_SUBSCRIPTION.MAILING_ID"] = 0; $needGroup = true; } else { $arFilter["=MAILING_SUBSCRIPTION.MAILING_ID"] = $find_subscribed; } } if (!empty($find_unsubscribed)) {
$sess_filter = "FORM_RESULT_LIST_" . $WEB_FORM_NAME; if (strlen($set_filter) > 0) { InitFilterEx($FilterArr, $sess_filter, "set"); } else { InitFilterEx($FilterArr, $sess_filter, "get"); } if (strlen($del_filter) > 0) { DelFilterEx($FilterArr, $sess_filter); } else { InitBVar($find_id_exact_match); InitBVar($find_status_id_exact_match); InitBVar($find_user_id_exact_match); InitBVar($find_guest_id_exact_match); InitBVar($find_session_id_exact_match); $str_error = ""; if (CheckFilter($str_error)) { $arFilter = array("ID" => $find_id, "ID_EXACT_MATCH" => $find_id_exact_match, "STATUS" => $find_status, "STATUS_ID" => $find_status_id, "STATUS_ID_EXACT_MATCH" => $find_status_id_exact_match, "TIMESTAMP_1" => $find_timestamp_1, "TIMESTAMP_2" => $find_timestamp_2, "DATE_CREATE_1" => $find_date_create_1, "DATE_CREATE_2" => $find_date_create_2, "REGISTERED" => $find_registered, "USER_AUTH" => $find_user_auth, "USER_ID" => $find_user_id, "USER_ID_EXACT_MATCH" => $find_user_id_exact_match, "GUEST_ID" => $find_guest_id, "GUEST_ID_EXACT_MATCH" => $find_guest_id_exact_match, "SESSION_ID" => $find_session_id, "SESSION_ID_EXACT_MATCH" => $find_session_id_exact_match); if (is_array($arrFORM_FILTER)) { foreach ($arrFORM_FILTER as $arrF) { foreach ($arrF as $arr) { if ($arr["FILTER_TYPE"] == "date" || $arr["FILTER_TYPE"] == "integer") { $arFilter[$arr["FID"] . "_1"] = ${"find_" . $arr["FID"] . "_1"}; $arFilter[$arr["FID"] . "_2"] = ${"find_" . $arr["FID"] . "_2"}; $arFilter[$arr["FID"] . "_0"] = ${"find_" . $arr["FID"] . "_0"}; } elseif ($arr["FILTER_TYPE"] == "text") { $arFilter[$arr["FID"]] = ${"find_" . $arr["FID"]}; $exact_match = ${"find_" . $arr["FID"] . "_exact_match"} == "Y" ? "Y" : "N"; $arFilter[$arr["FID"] . "_exact_match"] = $exact_match; } else { $arFilter[$arr["FID"]] = ${"find_" . $arr["FID"]}; }