Answer the question
In order to leave comments, you need to log in
How to set up a list array filtering on a page?
I am attaching the source
https://cloud.mail.ru/public/FKHa/So2UeNPsa
The problem is the following, lists of magnetic cards are formed on the page. Unfortunately, magnetic cards are displayed only for today's date. Regardless of setting the date manually. However, if you remove $arFilter in this place of the filter, then cards for previous dates will appear, although not in full.
$res = CIBlockElement::GetList(Array("PROPERTY_P_FIO"=>"ASC"), $arFilter, false, false, $arSelect);
Answer the question
In order to leave comments, you need to log in
The decision turned out to be banal. It was necessary to remove a few lines and correct the page for a normal look.
Added:
$res = CIBlockElement::GetList(Array("DATE_ACTIVE_FROM"=>"DESC"), $arFilter, false, false, $arSelect);
$res->NavStart(10);
$res->bShowAll = true;
$res->GetPageNavString('Привет!');
echo $res->GetPageNavStringEx($navComponentObject, 'Заголовок', '', 'Y');
if(!empty($_REQUEST['date_from'])){
if (new DateTime($_REQUEST['date_from'] . ' 23:59') < new DateTime($r['DATE_ACTIVE_FROM']))
continue;
if (new DateTime($_REQUEST['date_from'] . ' 00:00') > new DateTime($r['DATE_ACTIVE_TO']))
continue;
}else {
if (new DateTime(date('d.m.Y') . ' 23:59') < new DateTime($r['DATE_ACTIVE_FROM']))
continue;
if (new DateTime(date('d.m.Y') . ' 00:00') > new DateTime($r['DATE_ACTIVE_TO']))
continue;
}
if(empty($r['PROPERTY_P_DATE_VALUE']) || $DB->CompareDates($r['PROPERTY_P_DATE_VALUE'], ConvertTimeStamp() . '00:00') >=0 ) {}
You need to specify the desired condition in arFilter . For example:$arFilter['>=ACTIVE_FROM'] = date(\DATE_ATOM);
Add code
echo '<pre>';
print_r($arFilter);
echo '</pre>';
$res = CIBlockElement::GetList(Array("PROPERTY_P_FIO"=>"ASC"), $arFilter, false, false, $arSelect);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question