<?php 
//print_r($blog_article_details);exit; 
?>
    <section class="content-header">
      <h1>
        Blacklists
      </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">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>#</th>
                  <th>Username</th>
                  <th>Email</th>
                  <th>No. of times send message</th>
                  <?php if(chkWritePermission('Manage_Blacklist',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                  <th>Action</th>
                  <?php } ?>
                </tr>
                </thead>
                 <?php if(count($blacklist)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($blacklist as $data) 
                {
                ?>
                <tr>
                    <td><?php echo $i;?></td>
                    <td><a target="_blank" href="<?php echo  base_url().'admin/users/edit/'.base64_encode($data['user_id']); ?>"><?php echo $data['username']; ?></a></td>
                    <td><?php echo $data['email']; ?></td>
          					<td><?php echo $data['count']; ?></td>
          					<?php if(chkWritePermission('Manage_Blacklist',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                    <td>
                      <?php if($data['blacklist']==0){?>
                        <a href="<?php echo base_url();?>admin/blacklist/mark/<?php echo base64_encode($data['user_id']);?>" title="Make as blacklisted" onclick="return confirm('Are you sure to blacklist ?');"><span class="fa fa-eye-slash"></span></a>
                      <?php } ?>
                    </td> 
                    <?php } ?>
                </tr>

               <?php $i++; } ?>

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

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