<?php //print_r($usertype);exit; ?>
    <section class="content-header">
      <h1>
        Pin Text
      </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>
    <form action="<?php echo base_url().'admin/users/pin_text_deleteall'?>" method="post">
    <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 keyword" 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 written by" 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></th>
                  <th>Written by</th>
                  <th>Text</th>
                  <?php if(chkWritePermission('Manage_Pin_Text',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                  <th>Action</th>
                  <?php } ?>
                </tr>
                </thead>
                 <?php if(count($profile_text)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($profile_text as $data) 
                {
                ?>
                <tr>
                    <td><input type="checkbox" class="ids" name="ids[]" value="<?php echo $data['id']; ?>"></td>
                    <td><?php echo $data['username']; ?></td>
					          <td><?php echo html_entity_decode(strip_tags($data['comment'])); ?></td>
                    <?php if(chkWritePermission('Manage_Pin_Text',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                    <td>
                      <a href="<?php echo base_url();?>admin/users/pinedit/<?php echo base64_encode($data['id']);?>" title="Edit"><span class="fa fa-pencil-square"></span></a>
                      <a href="<?php echo base_url();?>admin/users/pindelete/<?php echo base64_encode($data['id']);?>" title="Delete" onclick="return confirm('Are you sure to delete ?');"><span class="fa fa-ban"></span></a>
                    </td>
                    <?php } ?> 
                </tr>

               <?php $i++; } ?>

                </tbody>
                <?php } ?>
                <tfoot>
               
                </tfoot>
              </table>
              <div class="">
                <input type="submit" class="btn btn-info " value="Delete" id="delete" onclick="return confirm('Are you sure to delete?')">
              </div>
                <div class="custom_pagination"><?php echo $link; ?></div>
              
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
  </form>
    <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>