
<?php $this->load->view('site/layout'); ?>
<link href="<?php echo base_url() ?>public/plugins/custom/datatables/datatables.bundle.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('products'); ?></span>
            </div>

        </div>
    </div>
</div>
<!-- 
        <div class="row">
     <div class="col-md-12">
<div  style="float:right">
<?php if (get_ap('product_add', $this->operator_id) == 1) { ?>
           <div  style="margin-left:10px"><a href="<?= base_url() ?>/<?= $this->thispage ?>/add/" class="btn btn-block btn-primary"  style="margin-bottom:5px"><i class="icon-pencil  icon-white"> </i><?php echo $this->lang->line('add-a-product') ?></a> 	</div>
<?php } ?>
        </div>   </div>
    </div> -->
<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('products'); ?>
            </h3>
        </div>
        <div class="kt-portlet__head-toolbar">
            <div class="kt-portlet__head-wrapper">
                <div class="kt-portlet__head-actions">
                    <!--  <div class="dropdown dropdown-inline">
                       <button type="button" class="btn btn-default btn-icon-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                         <i class="la la-download"></i> Export
                       </button>
                       <div class="dropdown-menu dropdown-menu-right">
                         <ul class="kt-nav">
                           <li class="kt-nav__section kt-nav__section--first">
                             <span class="kt-nav__section-text">Choose an option</span>
                           </li>
                           <li class="kt-nav__item">
                             <a href="#" class="kt-nav__link">
                               <i class="kt-nav__link-icon la la-print"></i>
                               <span class="kt-nav__link-text">Print</span>
                             </a>
                           </li>
                           <li class="kt-nav__item">
                             <a href="#" class="kt-nav__link">
                               <i class="kt-nav__link-icon la la-copy"></i>
                               <span class="kt-nav__link-text">Copy</span>
                             </a>
                           </li>
                           <li class="kt-nav__item">
                             <a href="#" class="kt-nav__link">
                               <i class="kt-nav__link-icon la la-file-excel-o"></i>
                               <span class="kt-nav__link-text">Excel</span>
                             </a>
                           </li>
                           <li class="kt-nav__item">
                             <a href="#" class="kt-nav__link">
                               <i class="kt-nav__link-icon la la-file-text-o"></i>
                               <span class="kt-nav__link-text">CSV</span>
                             </a>
                           </li>
                           <li class="kt-nav__item">
                             <a href="#" class="kt-nav__link">
                               <i class="kt-nav__link-icon la la-file-pdf-o"></i>
                               <span class="kt-nav__link-text">PDF</span>
                             </a>
                           </li>
                         </ul>
                       </div>
                     </div> -->
                    &nbsp;
                    <?php if (get_ap('product_add', $this->operator_id) == 1) { ?><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-a-product') ?>
                        </a><?php } ?>
                </div>
            </div>
        </div>
    </div>
    <div class="kt-portlet__body">

        <!--begin: Datatable -->
        <table class="table table-striped- table-bordered table-hover table-checkable dataTable no-footer dir-inline" id="kt_table_1">
            <thead>
                <tr>
                    <th><?php echo $this->lang->line('sno') ?></th>
                    <th><?php echo $this->lang->line('the-name') ?></th>
                    <th><?php echo $this->lang->line('the-value') ?></th>
                    <th><?php echo $this->lang->line('status') ?></th>
                    <th ><?php echo $this->lang->line('note') ?></th>
                    <th ><?php echo $this->lang->line('attendance') ?></th>
                    <th><?php echo $this->lang->line('show') ?></th>
                    <th><?php echo $this->lang->line('edit') ?></th>
                    <th><?php echo $this->lang->line('delete') ?></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <?php if ($all_groups) {
                        $count = 1;
                        foreach ($all_groups as $row) {
                            ?>
                        <tr>
                            <td><?php echo $count++; ?></td>
                            <td><?= $row['name']; ?></td>
                            <td><?= $row['valuess']; ?></td>
                            <td><?php if ($row['active'] == '2') echo '<span class="btn btn-sm btn-danger" style="border-radius: 2rem;padding: 0.15rem 5px; color: #fff;!important">' . $this->lang->line('closed') . '</span>';
                            else echo '<span class="btn btn-sm btn-success" style="border-radius: 2rem;padding: 0.15rem 5px ;color: #fff;!important" >' . $this->lang->line('open') . '</span>'; ?></td>
                            <td><?= $row['note']; ?> </td>
                            <td ><a href="<?= base_url('absent/add/' . $row['id']) ?>"  ><button class="btn btn-sm btn-info" style="border-radius: 2rem;padding: 0.15rem 0.75rem;color: #ffffff;background: #5578eb;"><i class="kt-menu__link-icon flaticon-plus"></i>attendance</button></a></td>
                            <td> <a href="<?= base_url('' . $this->thispage . '/show/' . $row['id']) ?>" class="btn btn-sm btn-clean btn-icon btn-icon-md" title="view details">
                                    <i class="fa fa-eye"></i>
                                </a>  </td>
                            <td>
                                <a href="<?= base_url('' . $this->thispage . '/edit/' . $row['id']) ?>" class="btn btn-sm btn-clean btn-icon btn-icon-md" title="Edit details">
                                    <i class="la la-edit"></i>
                                </a></td>
                            <td>
                                <a href=""  onclick="alert_box(<?php echo $row['id'] ?>)" class="btn btn-sm btn-clean btn-icon btn-icon-md" title="Delete">
                                    <i class="la la-trash"></i>
                                </a>
                            </td> 
                        </tr>
    <?php }
}
?>
            </tbody>
        </table>

        <!--end: Datatable -->
    </div>
</div><!-- /.row -->
<!-- <?php $this->load->view('site/footer'); ?> -->

<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 . '/del/') ?>" + id;

                        }

                    }</script>