Answer the question
In order to leave comments, you need to log in
How to set a condition for displaying personal user account data?
It is necessary to display data of 2 types on the page, depending on what kind of user opened the page:
1) if a regular user, then the data of this user (accounting Bitrix) is displayed
2) if the user is from the ICS list (by ID), then the data of all users is displayed (bitrix account)
I display the data of one user by ID:
<?
global $USER;
$filter = Array('ID' => '28096');
$rsUsers = CUser::GetList(($by="PERSONAL_STATE"), ($order="desc"), $filter);
while($rsUsers->NavNext(true, "f_"));
echo $f_PERSONAL_NOTES;
echo $f_WORK_STATE;
endwhile;
?>
Answer the question
In order to leave comments, you need to log in
You can pass several IDs to the CUser::GetList filter, for this you need to separate them with a symbol |
. You can do it, for example, like this:
$arId = array(1,2,3);
$filter = Array('ID' => implode('|', $arId));
$rsUsers = CUser::GetList(($by="PERSONAL_STATE"), ($order="desc"), $filter);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question