Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $rs_Section = CIBlockSection::GetList(array('left_margin' => 'asc'), array('IBLOCK_ID' => 5));
- while ( $ar_Section = $rs_Section->Fetch() )
- {
- $ar_Result[] = array(
- 'ID' => $ar_Section['ID'],
- 'NAME' => $ar_Section['NAME'],
- 'IBLOCK_SECTION_ID' => $ar_Section['IBLOCK_SECTION_ID'],
- 'IBLOCK_SECTION_ID' => $ar_Section['IBLOCK_SECTION_ID'],
- 'LEFT_MARGIN' => $ar_Section['LEFT_MARGIN'],
- 'RIGHT_MARGIN' => $ar_Section['RIGHT_MARGIN'],
- 'DEPTH_LEVEL' => $ar_Section['DEPTH_LEVEL'],
- );
- }
- ?>
- <select>
- <option> - Выбрать - </option>
- <?
- foreach( $ar_Result as $ar_Value )
- {
- $s = '';
- for($i = 1; $i <= $ar_Value['DEPTH_LEVEL']; $i++ )
- $s .= '.';
- $s .= ' '.$ar_Value['NAME'];
- ?><option value="<?=$ar_Value['ID']?>"><?=$s?></option><?
- }
- ?>
- </select>
Add Comment
Please, Sign In to add comment