Bitrix There is a field selector in which you can select the status of the application. I give an example of a function that processes the selected value, assigns text to it and highlights it in the admin part:

function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName) { $html = ''; if ($value['VALUE'] == '1'){ $html = '<div style="background: red; color: #fff; text-align: center"> ΠŸΠΎΠ΄Π³ΠΎΡ‚ΠΎΠ²ΠΊΠ° </div>'; }elseif ($value['VALUE'] == '2'){ $html = '<div style="background: green; color: #fff; text-align: center"> ΠžΠΏΡƒΠ±Π»ΠΈΠΊΠΎΠ²Π°Π½ </div>'; }elseif ($value['VALUE'] == '3'){ $html = '<div style="background: silver; color: #000; text-align: center"> ΠžΠΆΠΈΠ΄Π°Π΅Ρ‚ ΠΏΡƒΠ±Π»ΠΈΠΊΠ°Ρ†ΠΈΠΈ </div>'; } elseif ($value['VALUE'] == '4'){ $html = '<div style="background: lawngreen; color: #fff; text-align: center"> На рассмотрСнии </div>'; } elseif ($value['VALUE'] == '5'){ $html = '<div style="background: blue; color: #fff; text-align: center"> Π—Π°Π²Π΅Ρ€ΡˆΠ΅Π½ </div>'; } return $html; } 

There is a form for displaying general information about the application in the user part:

 <div class="text-block"> <p>Π”Π°Ρ‚Π° ΠΏΡƒΠ±Π»ΠΈΠΊΠ°Ρ†ΠΈΠΈ: <strong><?= $arResult['DISPLAY_ACTIVE_FROM'] ?></strong></p> <p>Бтатус заявки: <?= $arProps['STATYS']['VALUE'] ?></p> <p>Π”Π°Ρ‚Π° принятия ВСхничСской части: <strong><?= $arProps['PRIT']['VALUE'] ?></strong></p> <? if ($arProps['PRODT']['VALUE']) { ?> <p> Π”Π°Ρ‚Π° продлСния ВСхничСской части: <strong><?= $arProps['PRODT']['VALUE'] ?></strong></p> <? } ?> <p>Π”Π°Ρ‚Π° принятия ΠšΠΎΠΌΠΌΠ΅Ρ€Ρ‡Π΅ΡΠΊΠΎΠΉ части: <strong><?= $arProps['PRIK']['VALUE'] ?></strong></p> <? if ($arProps['PRODK']['VALUE']) { ?> <p> Π”Π°Ρ‚Π° продлСния ΠšΠΎΠΌΠΌΠ΅Ρ€Ρ‡Π΅ΡΠΊΠΎΠΉ части: <strong><?= $arProps['PRODK']['VALUE'] ?></strong></p> <? } ?> <p>БпСциалист Π¦Π’ΠŸ: <strong><?= $arProps['SPEC']['VALUE'] ?></strong>, Ρ‚Π΅Π»Π΅Ρ„ΠΎΠ½: <?= $arProps['PHONE']['VALUE'] ?>, e-mail: <a href="mailto:<?= $arProps['EMAIL']['VALUE'] ?>"><?= $arProps['EMAIL']['VALUE'] ?></a></p> </div> 

When displaying the property <p>Бтатус заявки: <?= $arProps['STATYS']['VALUE'] ?></p> , the array value is equal to two, and the text and color should be assigned to this value. Help who can.

    1 answer 1

    You need to do almost the same thing:

     <div class="text-block"> <p>Π”Π°Ρ‚Π° ΠΏΡƒΠ±Π»ΠΈΠΊΠ°Ρ†ΠΈΠΈ: <strong><?= $arResult['DISPLAY_ACTIVE_FROM'] ?></strong></p> <p>Бтатус заявки: <?php switch ($arProps['STATYS']['VALUE']) { case '1': echo '<span style="background: red; color: #fff; text-align: center"> ΠŸΠΎΠ΄Π³ΠΎΡ‚ΠΎΠ²ΠΊΠ° </span>'; break; case '2': echo '<span style="background: green; color: #fff; text-align: center"> ΠžΠΏΡƒΠ±Π»ΠΈΠΊΠΎΠ²Π°Π½ </span>'; break; case '3': echo '<span style="background: silver; color: #000; text-align: center"> ΠžΠΆΠΈΠ΄Π°Π΅Ρ‚ ΠΏΡƒΠ±Π»ΠΈΠΊΠ°Ρ†ΠΈΠΈ </span>'; break; case '4': echo '<span style="background: lawngreen; color: #fff; text-align: center"> На рассмотрСнии </span>'; break; case '5': echo '<span style="background: blue; color: #fff; text-align: center"> Π—Π°Π²Π΅Ρ€ΡˆΠ΅Π½ </span>'; break; } ?> </p> <p>Π”Π°Ρ‚Π° принятия ВСхничСской части: <strong><?= $arProps['PRIT']['VALUE'] ?></strong></p> <? if ($arProps['PRODT']['VALUE']) { ?> <p> Π”Π°Ρ‚Π° продлСния ВСхничСской части: <strong><?= $arProps['PRODT']['VALUE'] ?></strong></p> <? } ?> <p>Π”Π°Ρ‚Π° принятия ΠšΠΎΠΌΠΌΠ΅Ρ€Ρ‡Π΅ΡΠΊΠΎΠΉ части: <strong><?= $arProps['PRIK']['VALUE'] ?></strong></p> <? if ($arProps['PRODK']['VALUE']) { ?> <p> Π”Π°Ρ‚Π° продлСния ΠšΠΎΠΌΠΌΠ΅Ρ€Ρ‡Π΅ΡΠΊΠΎΠΉ части: <strong><?= $arProps['PRODK']['VALUE'] ?></strong></p> <? } ?> <p>БпСциалист Π¦Π’ΠŸ: <strong><?= $arProps['SPEC']['VALUE'] ?></strong>, Ρ‚Π΅Π»Π΅Ρ„ΠΎΠ½: <?= $arProps['PHONE']['VALUE'] ?>, e-mail: <a href="mailto:<?= $arProps['EMAIL']['VALUE'] ?>"><?= $arProps['EMAIL']['VALUE'] ?></a></p> </div> 
    • Thank you very much, it helped)) with php I have so far hard)) - Evgeny Pivovarov