<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th><input type="checkbox" class="selectall">All</th>
            <th>ID</th>
            <th width="30%">Description</th>
            <th>Created Date</th>
            <th>Created By</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $userName='';
      
        if($datalist){
                $i=1;
        foreach($datalist as $listing){ 
            if(count($datalist)>0){
            $userName   =   $this->mainMenu()->fetchUserName($listing['created_by']);
            }
            ?>
        
        
        
        <tr>
            <td class="center"><label class="pos-rel">
                        <input type="checkbox" rel="<?php echo $listing['id']; ?>" class="ace list-checkbox check" />
                            <span class="lbl"></span> </label>
                    </td>
            <td><?php echo $i;?></td>

            <td><?php echo $listing['description'];?></td>
            <td><?php echo date('d-m-Y h:m:s',strtotime($listing['created_date'])); ?></td>
            <td><?php echo $userName;?></td>
            
           <td><div id="changestatus1" class="<?php if($listing['status']==1){echo "aprovestatus";} else {echo "unaprovestatus";} ?> iconsize" name="ChangeStatus"> </div></td>
  
           <td><div class="hidden-sm hidden-xs action-buttons"><a class="red " title="Edit" href="<?php echo $this->url('testimonial', array('action'=>'edit-testimonial'),['query'=>['id'=>$listing['id']]]);?>"> <i class="ace-icon fa fa-edit bigger-130"></i> </a>  
           <a class="red" href="<?php echo $this->url('testimonial', array('action' => 'delete'), array('query' => array('id' => $listing['id']))); ?>" title="Delete"> <i class="ace-icon fa fa-trash-o bigger-130"></i> </a> </div></td>
        </tr>
        <?php $i++;} }else{?>
               <tr><td colspan="7" style="text-align: center;">No Records Found</td></tr>                               
        <?php }?>
               
               
       

    </tbody>
</table>