<?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>

    <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>Written by</th>
                  <th>Text</th>
                  <th>Action</th>
                 
                </tr>
                </thead>
                 <?php if(count($profile_text)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($profile_text as $data) 
                {
                ?>
                <tr>
                    <td><?php echo $data['username']; ?></td>
					<td><?php echo html_entity_decode(strip_tags($data['comment'])); ?></td>
                    <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> 
                </tr>

               <?php $i++; } ?>

                </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>