$arSelect = Array("ID", "NAME", "CREATED_BY", "PROPERTY_DATAFROM", "PROPERTY_DATATO", "PROPERTY_DISCIPLINA", "PROPERTY_ETAP", "PROPERTY_VIDSOREVNOV", "PROPERTY_MESTOPROV");
$arFilter = Array("IBLOCK_ID"=>IntVal($CALENDAR_ID), "<=DATE_ACTIVE_FROM"=>"$date", ">=DATE_ACTIVE_TO"=>"$date" );
$res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
$cnt = $res->SelectedRowsCount();
while($ob = $res->GetNextElement())
{
$arFields = $ob->GetFields();
$us = CUser::GetByID( $arFields["CREATED_BY"] );
if ( $aus = $us->Fetch() )
{
$ug = CUser::GetUserGroup($arFields["CREATED_BY"]);
if ( in_array(1,$ug) )
$sus = "Администрация сайта";
else
$sus = $aus["LAST_NAME"]." ".$aus["NAME"];
}
echo "<p>";
echo "Соревнования по ".$arFields["PROPERTY_VIDSOREVNOV_VALUE"]."<br>";
echo $arFields["PROPERTY_DISCIPLINA_VALUE"]."<br>";
echo "Этап №".$arFields["PROPERTY_ETAP_VALUE"]."<br>";
echo "Название: ".$arFields["NAME"]."<br>";
echo "Категории: ";
$properties = CIBlockProperty::GetList(Array("sort"=>"asc", "name"=>"asc"), Array("IBLOCK_ID"=>$CALENDAR_ID));
while ($prop_fields = $properties->GetNext())
{
echo $prop_fields["ID"]." - ".$prop_fields["NAME"]."<br>";
}
$reskat = CIBlockElement::GetProperty($CALENDAR_ID, $arFileds["ID"], "sort", "asc", Array("CODE"=>"KATEGOR"));
if ($ob2 = $reskat->Fetch())
{
// $fd = $ob2->GetFields();
echo "<br>";
print_r ($ob2);
echo "<br>";
// $arKat = $ob2->GetFields();
// echo $ob2["VALUE"]." ";
}
|