
<?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('main'); ?></span>
            </div>

        </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">

                    <?php if (get_ap('bill_report', $this->operator_id) == 1) { ?>
                        <div class="dropdown dropdown-inline">
                            <a href="<?= base_url('producer/bill_report') ?>"><button  class="btn btn-default btn-icon-sm dropdown-toggle"  aria-haspopup="true" aria-expanded="false">
                                    <i class="la la-download"></i> <?php echo $this->lang->line('report') ?>
                                </button></a>
                        </div>
                    <?php } ?>
                    &nbsp;
                    <?php if (get_ap('bill_add', $this->operator_id) == 1) { ?><a href="<?= base_url() ?>/orders/add/" class="btn btn-brand btn-elevate btn-icon-sm">
                            <i class="la la-plus"></i>
                            <?php echo $this->lang->line('add-an-invoice') ?>
                        </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-product') ?></th>
                    <th><?php echo $this->lang->line('current-bills') ?></th>
                    <th><?php echo $this->lang->line('invoices-ended') ?></th>
                    <th><?php echo $this->lang->line('fees') ?></th>
                    <th ><?php echo $this->lang->line('total-fees') ?></th>
                    <th ><?php echo $this->lang->line('total-discount') ?></th>
                    <th ><?php echo $this->lang->line('total') ?></th>
                    <th ><?php echo $this->lang->line('paid-up') ?>  </th>
                    <th><?php echo $this->lang->line('action') ?></th>
                    <!-- <th><?php echo $this->lang->line('edit') ?></th>
                    <th><?php echo $this->lang->line('delete') ?></th> -->
                </tr>
            </thead>
            <tbody>

                <?php
                $count = 0;
                foreach ($all_groups as $row) {
                    ?>
                    <tr>
                        <td><?php echo $count++; ?></td>
                        <td><?= $row['name']; ?></td>

                        <td><a  class="update btn btn-sm btn-success pull-right" href="<?= base_url('orders/all/1/' . $row['id'] . '/2') ?>"><?= $row['bills_orders']; ?></a></td>
                        <td><a  class="update btn btn-sm btn-danger pull-right" href="<?= base_url('orders/all/1/' . $row['id'] . '/1') ?>"><?= $row['bills_orders2']; ?></a></td>


                        <td><?= $row['valuess']; ?></td>

                        <td><?= $row['payment']; ?></td>
                        <td><?= $row['discount']; ?></td>

                        <td><?= $row['payment'] - $row['discount']; ?></td>
                        <td><?= $row['discount']; ?></td>




                        <td> 
                            <?php if (get_ap('bill_invoices', $this->operator_id) == 1) { ?>
                                <a  class="update btn btn-sm btn-success pull-right" href="<?= base_url('orders/all/1/' . $row['id']) ?>"><i class="material-icons"><?php echo $this->lang->line('invoices') ?></i></a>
                                <?php } ?>
                        </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>

<!--end::Global Theme Bundle -->

<!--begin::Page Vendors(used by this page) -->
<!-- <script src="<?php echo base_url() ?>public/plugins/custom/datatables/datatables.bundle.js" type="text/javascript"></script> -->

<!--end::Page Vendors -->

<!--begin::Page Scripts(used by this page) -->
<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>