  <?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;">ITEM <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_product_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 master_table">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Item Name</th>
                                        <th>HSN Code</th>
                                        <th>Rate</th>
                                        <th>CGST %</th>
                                        <th>SGST %</th>
                                        <th>IGST %</th>
                                        <th>Status</th>
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody>
                            <?php
                                foreach ($product as $key => $value):
                            ?>
                                    <tr>
                                        <td><?php echo $key+1?></td>
                                        <td><?php echo $value['pro_name']?></td>
                                        <td><?php echo $value['pro_hsn_code']?></td>
                                        <td><?php echo $value['pro_rate']?></td>
                                        <td><?php echo $value['pro_cgst']?></td>
                                        <td><?php echo $value['pro_sgst']?></td>
                                        <td><?php echo $value['pro_igst']?></td>
                                        <td><?php if($value['pro_status'] == 1){ echo "Active"; }else if($value['pro_status'] == 0){ echo "Inactive"; } ?></td>
                                        <td><span class="glyphicon glyphicon-pencil" style="cursor:pointer;" onClick="add_update_product_popup(<?php echo $value['pro_id']?>)"></span> 
                                        <span class="glyphicon glyphicon-trash" style="cursor:pointer;" onClick="delete_master_item(<?php echo $value['pro_id']?>,'product_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> 
 
  