  <?php 
    $this->load->view('templates/header');

    if(isset($_GET['search_field']) || isset($_GET['search_keyword']) || isset($_GET['order']))
    {
        $search_field      = $_GET['search_field'];
        $search_keyword    = $_GET['search_keyword'];
        $order             = $_GET['order'];
    }
    else
    {
        $search_field      = "";
        $search_keyword    = "";
        $order             = "";   
    }
  ?>
    <script>
        var link     = "master";
        var sub_link =  "group_account" ;
    </script>
    <!-- Content Header (Page header) -->

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-4">
                <p style="font-size: 22px;font-weight: bold;">GROUP <small style="font-weight: normal;">Master</small></p>
            </div>
            <div class="col-md-1 col-md-offset-7">
                <button class="btn btn-primary" onClick="add_update_group_popup(0);" style="width: 100%;">Add New</button>
            </div>
        </div>  
        <div class="row">
            <div class="col-md-12">     
                <div class="box">
                    <div class="box-body">
                        <table class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Group Name</th>
                                    <th>Group Belongs to</th>
                                    <th>Balance Sheet</th>
                                    <th>Profit & Loss</th>
                                    <th>Default Value</th>
                                    <th>Edit</th>    
                                    <!-- <th>Delete</th> -->
                                </tr>
                            </thead>
                            <tbody>
                        <?php
                            foreach ($group_data as $key => $value):
                                // echo '<pre>';print_r($value);exit;
                        ?>
                                <tr>
                                    <td><?php echo $key+1?></td>
                                    <td><?php echo $value['grp_name']?></td>
                                    <td><?php echo $value['grp_belong']?></td>
                                    
                                    <td><?php echo ($value['grp_bs'] == 1) ? "YES" : "NO"; ?></td>
                                    <td><?php echo ($value['grp_pl'] == 1) ? "YES" : "NO"; ?></td>

                                    <td><?php echo $value['grp_default']?></td>
                                    <td><span class="glyphicon glyphicon-pencil" style="cursor:pointer;" onClick="add_update_group_popup(<?php echo $value['grp_id']?>)"></span></td>
                                    <!-- <td><span class="glyphicon glyphicon-trash" onClick="delete_item(<?php echo $value['grp_id']?>,'group_delete');"></span></td> -->
                                </tr> 
                        <?php
                            endforeach;
                        ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <?php 
    $this->load->view('templates/footer');
   ?>
    <script src="<?php echo assets('js/master.js')?>"></script> 
 
  