require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); CModule::IncludeModule('iblock'); $arSelect = Array("IBLOCK_ID", "ID", "NAME", "DATE_ACTIVE_FROM", "PROPERTY_*"); $res = CIBlockElement::GetList(Array("ID" => "ASC"), Array("IBLOCK_ID" => 32, "ACTIVE" => "Y"), false, Array(), $arSelect); $UserRes = CIBlockElement::GetList(Array("ID" => "ASC"), Array("IBLOCK_ID" => 33, "ACTIVE" => "Y"), false, Array(), $arSelect); $DocRes = CIBlockElement::GetList(Array("ID" => "ASC"), Array("IBLOCK_ID" => 34, "ACTIVE" => "Y"), false, Array(), $arSelect); while ($user = $UserRes->GetNextElement()) { $userFields = $user->GetFields(); $userProps = $user->GetProperties(); $STAFF[$userFields['ID']] = array(); $STAFF[$userFields['ID']]['NAME']=$userFields['NAME']; $STAFF[$userFields['ID']]['ID']=$userFields['ID']; } while ($Doc = $DocRes->GetNextElement()) { $DocFields = $Doc->GetFields(); $DocProps = $Doc->GetProperties(); $DocSTAFF[$DocFields['ID']]['NAME'] = $DocFields['NAME']; $DocSTAFF[$DocFields['ID']]['ID'] = $DocFields['ID']; } while ($file = $res->GetNextElement()) { $resFields = $file->GetFields(); $resProps = $file->GetProperties(); $cfile = CFile::GetFileArray($resProps['FILE']['VALUE']); if($cfile) { $STAFF[$resProps['USER']['VALUE']]['FILE'][$resProps['DOCUMENT']['VALUE']] = $cfile['SRC']; } } ?>
Сотрудник | ID | foreach($DocSTAFF AS $elFile){ echo ""; print $elFile['NAME']; echo " | "; } ?>
---|---|---|
"; echo "" . $elPROPS['NAME'] . ""; echo " | "; echo ""; print $elPROPS['ID']; echo " | "; foreach($DocSTAFF AS $elFile) { echo ""; if($elPROPS['FILE'][$elFile['ID']]){ echo "ФАЙЛ"; } echo " | "; } echo "