Heirarchy Maintain Using Parent Id

Hello friends I am doing project in Yii. where I am using jstree to maintain heirarchy. But at some moment I m getting problem. I hope you guys will help me out.

Please see the problem and thanks in advance.

this is code


                    <li>Chapter 18 New HCO

                    <?php  foreach($data['sidebar2000_data'] as $list){ 


                       echo '<ul>';


                           echo '<li><a>'. $list['section_number'].'</a></li>';

                        echo '</ul>';



                     } ?>

                                </li><li>Chapter 19 Existing HCO


                            <li data-jstree='{ "selected" : true }'><a href="#">Section 19.1 General Requrement</a></li>

                            <li data-jstree='{ "opened" : true }'>Section 19.2 Means of Egress Components


                                    <li>Section 19.2.1 General</li>

                                    <li>Section 19.2.2 Means of Egress Com</li>





                    <li><a href="#">Chapter 20 New Amulatory HCO</a></li>

                    <li><a href="#">Chapter 21 Existing Amulatory HCO</a></li>

                    <li><a href="#">Chapter 32 New Residential board</a></li>

                    <li><a href="#">Tentative Interim Amendments (TIAs)</a></li>


In list where I get

$list[‘id’],$list['section_number] and $[‘parent_section_id’]. Now I want to main a tree for it…can you people help me with the code?

Thanks in advance.