<!-- Page Content -->
<div class="page-content">
    <!-- Page Header -->
    <div class="page-header position-relative">
        <div class="header-title">
            <h1>
                <?php echo $this->lang->line("REPORTS"); ?>
            </h1>
        </div>
        <!--Header Buttons-->
        <div class="header-buttons">
            <a class="sidebar-toggler" href="#">
                <i class="fa fa-arrows-h"></i>
            </a>
            <a class="refresh" id="refresh-toggler" href="">
                <i class="glyphicon glyphicon-refresh"></i>
            </a>
            <a class="fullscreen" id="fullscreen-toggler" href="#">
                <i class="glyphicon glyphicon-fullscreen"></i>
            </a>
        </div>
        <!--Header Buttons End-->
    </div>
    <!-- /Page Header -->
    <!-- Page Body -->
    <div class="page-body">
        <div class="row">
            <div class="col-xs-12 col-md-12">
                <div class="widget">
                    <div class="widget-body no-padding">
                        <div class="widget-main ">
                            <div class="panel-group accordion" id="accordion">
                                <div class="panel panel-default">

                                   
                                    
                                    
                                    
                                    <?php
                if ($reportsmenu) {

                    $xml = simplexml_load_string(htmlspecialchars_decode($reportsmenu));
                    
                    $level1 = 0;
                    $level2 = 0;
                    $count = 0;
                    foreach ($xml as $key0 => $value) {
                        $count++;
                        foreach ($value->attributes() as $attributeskey0 => $attributesvalue1) {
                            if ($key0 == 'level1') {
                                
                                
                                if ($level2 == 1) {
                                    $level2 = 0;
                                    echo '</div></div>';
                                } else if ($level1 == 1) {
                                    $level1 = 0;
                                    echo '</div></div>';
                                }
                                
                                $level1 = 1;
                                echo '<div class="panel-heading ">
                                        <h4 class="panel-title">
                                            <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#'.$value.'">
                                                '.$value.'
                                            </a>
                                        </h4>
                                    </div>';
                                if($count==1)
                                {
                                echo '<div id="'.$value.'" class="panel-collapse collapse in">';
                                }
                                else
                                {
                                    echo '<div id="'.$value.'" class="panel-collapse collapse">';
                                }
                                echo '<div class="panel-body border-red">';
                                
                                
                           } else if ($key0 == 'level2') {
                                
                                
                                if ($level2 == 1) {
                                    $level2 = 0;
                                    
                                } else if ($level1 == 1) {
                                    $level1 = 0;
                                   
                                }
                                
                                $level2 = 1;
                                echo '<a href="'.base_url($value).'" target="_blank">
                                                <div class="col-lg-3 col-sm-6 col-xs-12">
                                                    <div class="databox radius-bordered databox-shadowed databox-graded" style="height: auto;">
                                                        <div class="databox-left bg-azure">
                                                            <div class="databox-piechart">
                                                                <i class="fa fa-file" style="font-size: 29px;margin-top: 8px;"></i>
                                                            </div>
                                                        </div>
                                                        <div class="databox-right" style="height: auto;">
                                                            <div class="databox-text" style="height: auto;">'.$attributesvalue1.'</div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </a>';
                                
//                           
                            } 
                        }
                    }
                    
                }
                ?>
                                    
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /Page Body -->
    </div>
    <!-- /Page Content -->
</div>
    <!-- /Page Container -->
    <!-- Main Container -->
</div>