<!--<div class="panel panel-default">
    <div class="panel-headingnew"> View/Update Records </div>
    <div id="faq-1-3" class="panel-collapse collapse in" aria-expanded="false" >
        <div class="box">
            <div class="box-body table-responsive">
                <table id="myTable" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th><input type="checkbox"> All</th>
                            <th>S. No</th>
                            <th>Module Name</th>
                            <th>Sub Module Name</th>
                            <th>Controller Name</th>
                            <th>Action</th>
                            <th> Url</th>
                            <th> Menu Order</th>
                            <th>Icon Class</th>
                            <th>Status</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
<?php
/* if (!empty($modulelisting)) {

    $i = 1;
    $tempModuleId = "";
    $tempModuleName = "";
    foreach ($modulelisting as $data) {
        $parent_module = $data['module_name'];
        $sub_module = '-';
        if ($tempModuleId == $data['parent_id'] && $tempModuleId != "") {
            $sub_module = $data['module_name'];
            $parent_module = $tempModuleName;
        }
        ?>
                                        <tr>
                                            <td><input type="checkbox"></td>
                                            <td><?php echo $i; ?></td>
                                            <td><?php echo $parent_module; ?> </td>
                                            <td><?php echo $sub_module; ?> </td>
                                            <td><?php echo $data['controller']; ?></td>
                                            <td><?php echo $data['action']; ?></td>
                                            <td><?php echo $data['url']; ?></td>
                                            <td><?php echo $data['menu_order']; ?></td>
                                            <td><?php echo $data['icon_class']; ?></td>

                                            <td>
                                <div style="float:left;">
        <?php
        if ($data['status'] == 1): $buttonClass = "aprovestatus";
        else: $buttonClass = "unaprovestatus";
        endif;
        ?>
                                    <div id="changestatus" class="iconsize <?php echo $buttonClass; ?>" name="ChangeStatus"> </div>
                                </div>
                            </td>

                                            <td>
                                                <div class="hidden-sm hidden-xs action-buttons"> <a class="blue" href="#"> <i class="ace-icon fa fa-search-plus bigger-130"></i> </a>
                                                    <a class="red " title="Edit" href="<?php echo $this->url('master-module', array('action' => 'add-module'), array('query' => array('id' => $data['module_id']))); ?>" >
                                                        <i class="ace-icon fa fa-edit bigger-130"></i> </a>  <a class="red" href="#" title="Delete"> <i class="ace-icon fa fa-trash-o bigger-130"></i> </a> </div></td>

                                        </tr>

        <?php
        $i++;
        if ($data['parent_id'] == 0) {
            $tempModuleId = $data['module_id'];
            $tempModuleName = $data['module_name'];
        }
    }
}*/
?>

                    </tbody>
                    
                </table>
            </div>

        </div>

    </div>
</div>-->
<!--pt start -->
<div class="panel panel-default">
    <div class="panel-headingnew"> Menu Module Management</div>
    <div id="faq-1-3" class="panel-collapse collapse in" aria-expanded="false" >
        <div class="box">
            <div class="box-body table-responsive">
                
            <input type="hidden" id="id">
           
                <div class="dd" id="nestable">
                    <?php
                    $ref = [];
                    $items = [];


                    foreach ($modulelisting as $data) {

                        $thisRef = &$ref[$data['module_id']];

                        $thisRef['parent'] = $data['parent_id'];
                        $thisRef['label'] = $data['module_name'];
                        $thisRef['link'] = $data['url'];
                        $thisRef['id'] = $data['module_id'];

                        if ($data['parent_id'] == 0) {
                            $items[$data['module_id']] = &$thisRef;
                        } else {
                            $ref[$data['parent_id']]['child'][$data['module_id']] = &$thisRef;
                        }
                    }

                    function get_menu($items, $class = 'dd-list') {

                        $html = "<ol class=\"" . $class . "\" id=\"menu-id\">";

                        foreach ($items as $key => $value) {
                            $html .= '<li class="dd-item dd3-item" data-id="' . $value['id'] . '" >
                    <div class="dd-handle dd3-handle"></div>
                    <div class="dd3-content"><span id="label_show' . $value['id'] . '">' . $value['label'] . '</span> 
                        <span class="span-right">/<span id="link_show' . $value['id'] . '">' . $value['link'] . '</span> &nbsp;&nbsp; 
                            <a class="edit-button" id="' . $value['id'] . '" label="' . $value['label'] . '" link="' . $value['link'] . '" ><i class="fa fa-pencil"></i></a>
                            <a class="del-button" id="' . $value['id'] . '"><i class="fa fa-trash"></i></a></span> 
                    </div>';
                            if (array_key_exists('child', $value)) {
                                $html .= get_menu($value['child'], 'child');
                            }
                            $html .= "</li>";
                        }
                        $html .= "</ol>";

                        return $html;
                    }

                    print get_menu($items);
                    ?> 
                </div>

            <p></p>
            <input type="hidden" id="nestable-output">
    
            </div></div></div></div>

  <!--pt End -->
