<?php
if ($all_section) {
    foreach ($all_section as $section_value) {
        ?>
        <div class="col-sm-12 panel-group" 
             id="accordion" role="tablist" 
             aria-multiselectable="true">
            <div class="panel panel-default">
                <div class="panel-heading" role="tab" id="heading">
                    <i class="indicator fa fa-caret-down"></i>
                    <a class="accordion-toggle" data-toggle="collapse" 
                       href="#collapse<?php echo $section_value->upload_video_id; ?>" aria-expanded="true">
                           <?php echo $section_value->upload_video_section_name; ?>
                    </a>
                </div>

                <div id="collapse<?php echo $section_value->upload_video_id; ?>" class="panel-collapse collapse in" 
                     role="tabpanel" aria-labelledby="headingOne">

                    <div class="panel-body">
                        <?php
                        foreach ($upload_video_info[$section_value->upload_video_section_name] as $upload_video_value) {
                            if ($upload_video_value->upload_video_access_level == 1) {
                                ?>
                                <a href="javascript:void(0);" 
                                   onclick="videoLoad('<?php echo base_url() . 'get-single-video' ?>', '<?php echo $upload_video_value->upload_video_id ?>')" >
                                    <i class="fa fa-play-circle"></i>
                                    <?php echo $upload_video_value->upload_video_name ?>
                                    <span class="pull-right"></span>
                                </a>
                                <?php
                            } else if ($upload_video_value->upload_video_access_level == 2) {
                                ?>
                                <a href="javascript:void(0);">
                                    <i class="fa fa-lock"></i><?php echo $upload_video_value->upload_video_name ?>
                                    <span class="pull-right"></span>
                                </a>
                                <?php
                            }
                            ?>
                            <br>

                            <?php
                        }
                        ?>
                    </div>
                </div>
            </div>
        </div>
        <?php
    }
} else {
    echo 'No Video available';
}