<?php //print_r($usertype);exit; ?>
    <section class="content-header">
      <h1>
        Members login log
      </h1>
      <ol class="breadcrumb">
        <li><a href="<?php echo base_url().'admin';?>"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">List</li>
      </ol>
    </section>

    <section class="content">
      <div class="row">
        <?php echo $this->utility->showMsg();?>
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">Management</h3>
              
              </div>
               
              <div></div>
            <!-- /.box-header -->
            <div class="box-body">
            <form action="" id="search_frm" method="post" style="margin-bottom: 5%;">
              <input type="text" name="search" class="form-control" placeholder="Search by email" value="<?php if($this->input->post('search')) { echo $this->input->post('search'); }?>" style="width: 25%; float: right;">
              <input type="text" name="search_name" class="form-control" placeholder="Search by pseudonym" value="<?php if($this->input->post('search_name')) { echo $this->input->post('search_name'); }?>" style="width: 25%; float: right;">
              <input type="text" name="fromDate" class="form-control" id="fromDate" placeholder="Search by date"  value="<?php if($this->input->post('fromDate')){ echo date('Y/m/d', strtotime($this->input->post('fromDate'))); }?>" style="width: 25%; float: right;">
              
              <input type="submit" class="btn btn-primary" value="Search" style="float: right;">
            </form>
            <div class="table-responsive">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>Email</th>
                  <th>Pseudonym</th>
                  <th>Last Login</th>
                </tr>
                </thead>
                 <?php if(count($users)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($users as $data) 
                {
                ?>
                <tr>
                    <td><?php echo $data['email']; ?></td>
                    <td><?php echo $data['username']; ?></td>
                    <td><?php echo date('d-m-Y h:i:s',$data['log_time']);?></td>
                    
                </tr>

               <?php $i++; } ?>

                </tbody>
                <?php } ?>
                <tfoot>
               
                </tfoot>
              </table>
            </div>
              <div class="custom_pagination"><?php echo $link; ?></div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>



    <style type="text/css">
      .dataTables_info, .dataTables_paginate {   
      display: none;
      }
    </style>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.6/css/intlTelInput.css">
<script src="<?php echo base_url(); ?>assets/js/intlTelInput.js"></script>    
<script>
  $(function () {
    //$("#example1").DataTable();
    $("#fromDate").datetimepicker();
    $('.custom_pagination a').click(function(e){
      e.preventDefault();
      $('#search_frm').attr('action',$(this).attr('href'));
      $('#search_frm').submit();
    })
  });
</script>
<style type="text/css">
  .dataTables_length, .dataTables_filter{ display: none; }
</style>