<?php //print_r($usertype);exit; ?>
    <section class="content-header">
      <h1>
        Members
      </h1>
      <ol class="breadcrumb">
        <li><a href="<?php echo base_url();?>"><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>
              <a class="btn btn-primary margin-right pull-right" href="<?php echo base_url()?>users/add">Add</a>
			        </div>
               
              <div></div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>#</th>
                  <th>Email</th>
                  <th>Registered</th>
                  <th>Last Login</th>
                  <th>Account Type</th>
                  <th>Status</th>
                  <th>Action</th>
                 
                </tr>
                </thead>
                 <?php if(count($users)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($users as $data) 
                {
                ?>
                <tr>
                    <td><?php echo $i;?></td>
                    <td><?php echo $data['email']; ?></td>
                    <td><?php echo date('d-m-Y h:i:s',$data['created']);?></td>
                    <td><?php if($data['last_login'] > 0) { echo date('d-m-Y h:i:s',$data['last_login']); } else { echo 0; };?></td>
                    <td><?php echo $data['accounttype'];?></td>
                    <td><?php if($data['email_confirmed'] == 1) { echo 'Active'; } elseif($data['email_confirmed'] ==0 ) { echo 'Email not confirmed'; } else { echo 'Inactive'; }?></td>
                    <td>
                      <a href="<?php echo base_url();?>users/edit/<?php echo base64_encode($data['id']);?>" title="Edit"><span class="fa fa-pencil-square"></span></a>
                      <a href="<?php echo base_url();?>users/delete/<?php echo base64_encode($data['id']);?>" title="Delete" onclick="return confirm('Are you sure to delete ?');"><span class="fa fa-ban"></span></a>
                      <a href="<?php echo base_url();?>users/email_confirm/<?php echo base64_encode($data['id']);?>" title="Email Confirm" onclick="return confirm('Are you sure to confirm ?');"><span class="fa fa-plus"></span></a>
                    </td> 
                </tr>

               <?php $i++; } ?>

                </tbody>
                <?php } ?>
                <tfoot>
               
                </tfoot>
              </table>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    

    
<script>
  $(function () {
    $("#example1").DataTable();
  });
</script>