<?php //print_r($usertype);exit; ?>
    <section class="content-header">
      <h1>
        Newsletter 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>
                <a target="_blank" class="btn btn-primary margin-right pull-right" href="<?php echo base_url()?>newsletter">Start Newsletter Send</a>
              </div>
               
              <div></div>
            <!-- /.box-header -->
            <div class="box-body">
            <!--<form action="<?php echo base_url().'admin/newsletterlog/alllist'?>" 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="submit" class="btn btn-primary" value="Search" style="float: right;">
            </form>-->
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>Send Date</th>
                  <th>Newsletters to send</th>
                  <th>Newsletters sent</th>
                </tr>
                </thead>
                 <?php if(count($users)>0)
                {?>
                <tbody>
               <?php
                $sent=0;
                $total = $totalusers;
                foreach ($users as $data) 
                {
                  
                ?>
                <tr>
                    <td><?php echo $data['subscription_mail_send_date']." ( ".date('l', strtotime($data['subscription_mail_send_date']))." )";?></td>
                    <td><?php echo $total; ?></td>
                    <td><?php echo $data['count']; ?></td>
                    
                </tr>

               <?php $total=$total - $data['count']; } ?>

                </tbody>
                <?php } ?>
                <tfoot>
               
                </tfoot>
              </table>
              
                <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>

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

    $('.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>