<?php 
//print_r($blog_article_details);exit; 
?>
    <section class="content-header">
      <h1>
        Testimonials
      </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>Name</th>
                  <th>Text</th>
        		  <th>Display Order</th>
                  <th>Action</th>
                 
                </tr>
                </thead>
                 <?php if(count($adverts)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($adverts as $data) 
                {
                ?>
                <tr>
                    <td><?php echo $i;?></td>
                    <td><?php echo $data['name']; ?></td>
          					<td><?php echo $data['text'] ?></td>
          					<td>
          					<?php
          					  if($data['display_order']>1 && $data['display_order'] < count($adverts)+1){
                                ?>
                                <a href="<?php echo base_url();?>admin/testimonial/display_order/<?php echo $data['display_order'];?>/1/<?php echo $data['id'];?>" title="Up"><span class="fa fa-arrow-up"></span></a>
                                <?php
                                }
          					  if($data['display_order']>0 && $data['display_order'] < count($adverts)){
                                ?>
                                <a href="<?php echo base_url();?>admin/testimonial/display_order/<?php echo $data['display_order'];?>/2/<?php echo $data['id'];?>" title="Down"><span class="fa fa-arrow-down"></span></a>
                                <?php
                                }
                                ?>
          					</td>
                    <td>
                      <a href="<?php echo base_url();?>admin/testimonial/edit/<?php echo base64_encode($data['id']);?>" title="Edit"><span class="fa fa-pencil-square"></span></a>
					  <a href="<?php echo base_url();?>admin/testimonial/delete/<?php echo base64_encode($data['id']);?>" title="Delete" onclick="return confirm('Are you sure ?');"><span class="fa fa-ban" ></span></a>
                      
					 <?php if($data['status']==0){?>
                        <a href="<?php echo base_url();?>admin/testimonial/visibility/<?php echo base64_encode($data['id']);?>/1" title="Approve" onclick="return confirm('Are you sure ?');"><span class="fa fa-eye-slash"></span></a>
                      <?php } else { ?>
                        <a href="<?php echo base_url();?>admin/testimonial/visibility/<?php echo base64_encode($data['id']);?>/0" title="Reject" onclick="return confirm('Are you sure ?');"><span class="fa fa-eye"></span></a>
                      <?php } ?>
                    </td> 
                </tr>

               <?php $i++; } ?>

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

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