
<?php $this->load->view('site/layout'); ?>
<link
    href="<?php echo base_url() ?>public/plugins/custom/datatables/datatables.bundle.css"
    rel="stylesheet" type="text/css" />

<link href="<?php echo base_url() ?>public/css/custom_css.css"
      rel="stylesheet" type="text/css" />
      <?php $this->load->view('site/navbar'); ?>
<div
    class="kt-content  kt-grid__item kt-grid__item--fluid kt-grid kt-grid--hor"
    id="kt_content">
    <!-- begin:: Content Head -->
    <div class="kt-subheader  kt-grid__item" id="kt_subheader">
        <div class="kt-container  kt-container--fluid ">
            <div class="kt-subheader__main">
                <h3 class="kt-subheader__title">
                    <a href="<?php echo base_url() ?>Dashboard/"><?php echo $this->lang->line('dashboard'); ?></a>
                </h3>
                <span class="kt-subheader__separator kt-subheader__separator--v"></span>
                <span class="kt-subheader__desc"><?php echo $this->lang->line('group'); ?></span>
            </div>

        </div>
    </div>
</div>
<div
    class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid">
    <div class="kt-portlet kt-portlet--mobile">
        <div class="kt-portlet__head kt-portlet__head--lg">
            <div class="kt-portlet__head-label">
                <span class="kt-portlet__head-icon"> <i
                        class="kt-font-brand flaticon2-line-chart"></i>
                </span>
                <h3 class="kt-portlet__head-title">
                    <?php echo $this->lang->line('group');
                    echo ' ';
                    echo $this->lang->line('list'); ?>
                </h3>
            </div>
<?php if (get_ap('group_add', $this->operator_id) == 1) { ?>
                <div class="kt-portlet__head-toolbar">
                    <div class="kt-portlet__head-wrapper">
                        <div class="kt-portlet__head-actions">
                            &nbsp; <a href="<?= base_url() ?>/<?= $this->thispage ?>/add/"
                                      class="btn btn-brand btn-elevate btn-icon-sm"> <i
                                    class="la la-plus"></i>
    <?php echo $this->lang->line('add') ?> <?php echo $this->lang->line('group') ?>
                            </a>
                        </div>
                    </div>
                </div>
<?php } ?>
        </div>
        <div class="kt-portlet__body">

            <!--begin: Datatable -->
            <table
                class="table table-striped- table-bordered table-hover table-checkable"
                id="kt_table_1">
                <thead>
                    <tr>
                        <th><?php echo $this->lang->line('sno') ?></th>
                        <th><?php echo $this->lang->line('groups') ?></th>
                        <th class="text-center"><?php echo $this->lang->line('action'); ?></th>
                    </tr>
                </thead>
                <tbody>     <?php $count = 1;
foreach ($result as $row) { ?>

                        <tr>
                            <td><?php echo $count++; ?></td>
                            <td><?php echo $row->groups; ?></td>
                            <td class="text-center">
    <?php if (get_ap('group_permission', $this->operator_id) == 1) { ?>
                                    <a
                                        href="<?= base_url('' . $this->thispage . '/permission/' . $row->id) ?>"
                                        class="btn btn-icon btn-success btn-sm"
                                        title="<?php echo $this->lang->line('permission'); ?>"> <i
                                            class="la la-key"></i>
                                    </a>
    <?php } 
    if (get_ap('group_edit', $this->operator_id) == 1) { ?>
                                    <a
                                        href="<?= base_url('' . $this->thispage . '/edit/' . $row->id) ?>"
                                        class="btn btn-icon btn-primary btn-sm"
                                        title="<?php echo $this->lang->line('edit'); ?>"> <i
                                            class="la la-edit"></i>
                                    </a> 
    <?php
    }
    if (get_ap('group_del', $this->operator_id) == 1) {
        if ($row->id != 1) {
            ?>
                                        <a href="" onclick="alert_box(<?php echo $row->id ?>)"
                                           class="btn btn-icon btn-danger btn-sm"
                                           title="<?php echo $this->lang->line('delete'); ?>"> <i
                                                class="la la-trash"></i>
                                        </a>
        <?php }
    }
    ?>
                            </td>
                        </tr><?php } ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<?php $this->load->view('site/footer_2'); ?>

<script
    src="<?php echo base_url() ?>public/plugins/global/plugins.bundle.js"
type="text/javascript"></script>
<script src="<?php echo base_url() ?>public/js/scripts.bundle.js"
type="text/javascript"></script>
<script
    src="<?php echo base_url() ?>public/js/pages/crud/datatables/basic/basic.js"
type="text/javascript"></script>

<script>function alert_box(id) {
                                                        var result = confirm("Are You Confirm!")
                                                        if (result) {
                                                            window.location.href = "<?= base_url('' . $this->thispage . '/delete/') ?>" + id;

                                                        }

                                                    }</script>