<?php 
$settingMenuData=menu_hmis_setting($link1);
if(isset($settingMenuData) && count($settingMenuData)>0){ 
?>
<li class="dropdown u-action">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i aria-hidden="true" class="fa fa-cogs noti"></i> </a>
    <ul role="menu" id="accordion" class="dropdown-menu">
        <?php 
        foreach ($settingMenuData as $key => $value) { 
          $mod=str_replace('0','&',trim($key));
          $mod=str_replace('_',' ',trim($mod));
        ?>
        <li><a data-parent="#accordion" class="accordion-toggle" data-target="#<?php echo $key; ?>"><?php echo $mod; ?> <span class="arrow"></span></a></li>
            <ul role="tabpanel" id="<?php echo $key; ?>" class="sub-menu collapse <?php if(trim($mod)==trim($GLOBALS['Module'])){ echo 'in'; } ?>">
                <?php 
                foreach ($value as $key1 => $value1) { 
                    $catArr=explode('|',$key1);
                  $cat=str_replace('0','&',trim($catArr[1]));
                  $cat=str_replace('_',' ',trim($cat));
                ?>
                <li><a data-parent="#<?php echo $key; ?>" class="accordion-toggle" data-target="#<?php echo $catArr[0].$catArr[1]; ?>"><?php echo $cat; ?></a></li>
                    <ul id="<?php echo $catArr[0].$catArr[1]; ?>" class="sub-child-menu collapse <?php if(trim($cat)==trim($GLOBALS['Category'])){ echo 'in'; } ?>">
                        <?php
                        foreach ($value1 as $key2 => $value2) { 
                            $data=explode('%', $value2);
                        ?>
                        <li><a href="<?php echo _ROOT.$data[1]; ?>" <?php if(trim($data[0])==trim($GLOBALS['Form'])){ echo 'class="active" '; } ?> ><?php echo $data[0]; ?></a></li>
                        <?php } ?>
                    </ul>
                <?php } ?>
            </ul>
        <?php } ?>
    </ul>
</li>
<?php } ?>