<div id="change">
    <div class="col-sm-10 col-sm-offset-3 main col-md-10 col-md-offset-2 main">

        <div class="col-sm-4 col-md-6">
            <a href="<?php echo base_url(); ?>super_admin/add_menu" class="btn btn-sm btn-success">Add Menu</a>
        </div>
        
        <div class="container col-sm-8 col-sm-offset-2 col-md-offset-0 col-md-12" id="res">
            <hr>
            <div class="">
                <a href="<?php echo base_url(); ?>super_admin">Dashboard</a>->>
                <span>Manage Menu</span>
            </div>
            <hr>
            <!--User LIST-->

            <div class="table-responsive col-lg-12 col-md-10 col-sm-7" id="user_list">
                <form name="myform" action=""  method="post">
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th><input type="checkbox" name="all_list" id="all_list" onchange="toggleAllUserSelection(document.myform.menu_id)"/></th>
                                <th>Menu ID</th>
                                <th>Menu Type</th>
                                <th>Menu Name</th>
                                <th>Menu URL</th>
                                <th>Status</th>
                                <th>action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($menus as $v_menu) { ?>
                                <tr>
                                    <td>
                                        <input name="menu_id" id="menu_id<?php echo $v_menu->menu_id; ?>" type="checkbox"  value="<?php echo $v_menu->menu_id; ?>" onchange="setUserIdList(this.value);"/>
                                    </td>

                                    <td><?php echo $v_menu->menu_id ?></td>

                                    <td> <?php echo $v_menu->menu_type ?> </td>

                                    <td><?php echo $v_menu->menu_name ?></td>

                                    <td><?php echo $v_menu->menu_url ?></td>

                                    <td><?php
                                        if ($v_menu->menu_status == '1') {
                                            echo '<p style="color:limegreen;">Active</p>';
                                            ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_menu_inactive/<?php echo $v_menu->menu_id; ?>"><i class="fa fa-user-times" title="Inactive"></i></a>
                                            <?php
                                        } else if ($v_menu->menu_status == '0') {
                                            echo '<p style="color:red;">Inactive</p>';
                                            ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_menu_active/<?php echo $v_menu->menu_id; ?>">
                                                <i class="fa fa-user-plus" title="Active"></i></a>
                                            <?php
                                        } else if ($v_menu->menu_status == '2') {
                                            echo '<p style="color:blue;">Archived';
                                            ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_menu_active/<?php echo $v_menu->menu_id; ?>"><i class="fa fa-user-plus" title="Active"></i> </a>
                                        <?php } ?>
                                    </td>
                                    
                                    <td style="width: 200px;">
                                        <a href="<?php echo base_url(); ?>super_admin/edit_menu/<?php echo $v_menu->menu_id; ?>"><div class="span1"><i class="fa fa-edit">Edit</i></div></a>
                                        <?php if ($v_menu->menu_status != 2) { ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_menu_archive/<?php echo $v_menu->menu_id; ?>" onclick="return checkAction('delete');">
                                                <i class="fa fa-remove">Delete</i>
                                            </a><?php } ?>
                                    </td>
                                    
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                    <br>
                </form>
            </div>
        </div>  
    </div> 
</div>


<script>
    function checkAction(action) {
        message = 'do you want to ' + action + '!!';
        chk = confirm(message);
        if (chk) {
            return true;
        } else {
            return false;
        }
    }
</script>