$arFilter = Array
(
"IBLOCK_ID"=>13,
"PROPERTY_ROOM"=>intval($room_id),
array
(
"LOGIC" => "OR",
array
(
"LOGIC" => "AND",
"<=DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
"<DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
">=DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
"<DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
),
array
(
"LOGIC" => "AND",
">DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
"<DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
">DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
"<DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
),
array
(
"LOGIC" => "AND",
">DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
"<=DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
">DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
">=DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
),
array
(
"LOGIC" => "AND",
"<=DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
"<DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
">DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_begin_mon,$date_begin_day,$date_begin_year)),
">=DATE_ACTIVE_TO"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date_end_mon,$date_end_day,$date_end_year)),
),
),
);
$res = CIBlockElement::GetList(Array("PROPERTY_VARIANTES"=>"ASC","ID"=>"ASC","PROPERTY_PRICE"=>"ASC","PROPERTY_ROOM"=>"ASC"), $arFilter,false, false, Array());
|