
<?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" />
<style>
    .select2_plug{
        width: 100%;
    }
    .alert.alert-light .alert-text hr{
        border-top-color: #ccc;
    }
    .rtl .dt-buttons{
        float: left;
    }
</style>

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

        </div>   </div>
    </div> -->


<div class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid" >
    <button class="btn btn-primary mb-3" onclick="toggle_filter()"><?= $this->lang->line('show_hide_filter') ?></button>
    <div class="alert alert-light alert-elevate" role="alert" id="filter_container">
        <div class="alert-text">
            <form method="post" action="" >
                <div class="form-group row">
                    <label for="example-text-input" class="col-2 col-form-label"><?php echo $this->lang->line('date') ?></label>
                    <div class="col-9">
                        <input type="text" name="start_expiry" id="start_expiry" class="form-control" value="<?= set_value('start_expiry') ?>"> 
                    </div>
                    <div class="col-1" style="padding-left: 0px">
                        <a onclick="clear_date()" class="btn btn-light btn-text-primary btn-hover-text-primary font-weight-bold"><?= $this->lang->line('clear') ?></a>
                    </div>
                </div>

                <div class="row" >
                    <div  class="col-md-6">
                        <div class="form-group">
                            <button class="btn btn-primary" ><?php echo $this->lang->line('search') ?></button> 
                        </div>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<div class="kt-portlet kt-portlet--mobile">
    <?php if ($this->session->flashdata('msg')) { ?>
        <div class="alert alert-success">
            <a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
            <?= $this->session->flashdata('msg') ?>
        </div>
    <?php } ?>
    <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 $title; ?>
            </h3>
        </div> 
    </div>
    <div class="kt-portlet__body">

        <!--begin: Datatable -->
        <table class="table table-bordered table-hover" id="list_table" > <!-- style="display: inline-block;overflow-x: scroll" -->
            <thead>
                <tr>
                    <th><?php echo $this->lang->line('sno') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('name') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('the_type') ?></th>
                    <th><?php echo $this->lang->line('action') ?></th>
                    <th class="text-center"><?php echo $this->lang->line('date') ?></th>
                </tr>
            </thead>
            <tbody>     <?php
                $count = 1;
                foreach ($all_groups as $row) {
                    ?>
                    <tr>
                        <td><?= $count++; ?></td>
                        <td class="text-center"><?= $row->name ? $row->name : $row->driver_name ?></td>
                        <td class="text-center"><?= $row->user_type ? $this->lang->line('driver') : $this->lang->line('admin') ?></td>
                        <td><?= $row->action ?></td>
                        <td class="text-center"><?= str_replace(' ', '<br/>', $row->date) ?></td>
                    </tr>
                <?php } ?>
            </tbody>
        </table>

        <!--end: Datatable -->
    </div>
</div>
</div>




<?php $this->load->view('site/footer_2'); ?>

<script>function clear_date() {
        $("#start_expiry").val('');
    }
</script>
<script>
    $("#filter_container").hide();
    function toggle_filter() {
        $("#filter_container").toggle();
        $(".select2_plug").select2();
    }
    $(function () {
        $("#list_table").DataTable({dom: 'Bfrtip',
            destroy: true,
            buttons: [
                {
                    extend: 'excelHtml5',
                    charset: 'UTF-16LE',
                    fieldSeparator: '\t',
                    bom: true
                },
                {
                    extend: 'csvHtml5',
                    charset: 'UTF-16LE',
                    fieldSeparator: '\t',
                    bom: true
                },
                {
                    extend: 'pdfHtml5',
                    charset: 'UTF-16LE',
                    fieldSeparator: '\t',
                    bom: true
                },
                {
                    extend: 'print',
                    autoPrint: false,
                    footer: true
                }

            ]
        });
//            buttons: [
//                'copyHtml5',
//                'excelHtml5',
//                'csvHtml5',
//                'pdfHtml5'
//            ]
    });


</script>