<?php //print_r($usertype);exit; ?>
    <section class="content-header">
      <h1>
        Party Feedback
      </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="" 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">
            <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>#</th>
                  <th></th>
                  <th>Created</th>
                  <th>Profile image</th>
                  <th>Username</th>
                  <th>Event Title</th>
                  <th>Feedback</th>
                </tr>
                </thead>
                 <?php if(count($party_comments)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($party_comments as $key=>$data) 
                {
                    $fileData = getFiles($data['avatar_file_id']);
                    if(!empty($fileData))
                    {
                      if(file_exists(FCPATH.'assets/userfiles/'.$fileData['path'].'/'.$fileData['filename'].'.'.$fileData['extension']))
                      {
                        $imageFile = base_url().'assets/userfiles/'.$fileData['path'].'/'.$fileData['filename'].'.'.$fileData['extension'];
                      }
                      else
                      {
                        $imageFile = base_url().'assets/images/default-avatar.jpg';
                      }
                    }
                    else
                    {
                        $imageFile = base_url().'assets/images/default-avatar.jpg';
                    }
                ?>
                <tr>
                    <td><?php echo $key+1; ?></td>
                    <td><?php if($data['approved']==0){?><input type="checkbox" class="ids" name="ids[]" value="<?php echo $data['id']; ?>"><?php } ?></td>
                    <td><?php echo date('d-m-Y h:i:s',$data['created']);?></td>
                    <td><img class="direct-chat-img" src="<?php echo $imageFile; ?>" title=""></td>
                    <td><?php echo $data['username']; ?></td>
                    <td><?php echo $data['title'];?></td>
                    <td><?php echo $data['comment'];?></td>
                </tr>

               <?php $i++; } ?>

                </tbody>
                <?php } ?>
                <tfoot>
               
                </tfoot>
              </table>

              <div class="">
                <input type="submit" class="btn btn-info " value="Approve" id="add" onclick="return confirm('Are you sure you want to approve?')">
              </div>

              <?php if($this->uri->segment(3)!='expiredusers'){ ?>
                <div class="custom_pagination"><?php echo $link; ?></div>
              <?php } ?>  
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    </form>
    
<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>