            <div class="col-xs-12">  
              <div class="box">
                <div class="box-header">
                  <h3 class="box-title">Semua Konsultasi</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table id="example1" class="table table-bordered table-striped">
                    <thead>
                      <tr>
                        <th style='width:20px'>No</th>
                        <th>Judul Topic</th>
                        <th>Pengirim</th>
                        <th>Status</th>
                        <th></th>
                        <th style='width:40px'>Action</th>
                      </tr>
                    </thead>
                    <tbody>
                  <?php 
                    $no = 1;
                    $records = $this->db->query("SELECT a.*, b.nama_kategori, b.kategori_seo, c.nama_lengkap FROM konsul a JOIN kategori_konsul b ON a.id_kategori_konsul=b.id_kategori_konsul 
                                                    JOIN users c ON a.username=c.username ORDER BY a.id_konsul DESC");
                    foreach ($records->result_array() as $row){
                    $komentar = $this->db->query("SELECT * FROM komentar_konsul where id_konsul='$row[id_konsul]' AND aktif='Y'")->num_rows();
                    if ($row['status']=='Y'){ $status = '<span style="color:green">Published</span> <br><small><i>Sudah Terbit</i></small>'; }else{ $status = '<span style="color:red">Unpublished</span> <br><small><i>Menunggu Validasi</i></small>'; }
                    $tgl_posting = tgl_indo($row['tanggal']);
                    echo "<tr><td>$no</td>
                              <td><small>$row[hari], $tgl_posting, $row[jam] WIB</small> <br><a target='_BLANK' href='".base_url()."konsultasi/detail/$row[judul_seo]'><b>$row[judul]</b></a></td>
                              <td>$row[nama_lengkap]</td>
                              <td>$status</td>
                              <td>$komentar Komentar</td>
                              <td><center>
                                <a class='btn btn-primary btn-xs' title='Edit Data' href='".base_url()."administrator/publish_konsul/$row[id_konsul]/$row[status]'><span class='glyphicon glyphicon-ok'></span></a>
                                <a class='btn btn-danger btn-xs' title='Delete Data' href='".base_url()."user/delete_konsul/$row[id_konsul]' onclick=\"return confirm('Apa anda yakin untuk hapus Data ini?')\"><span class='glyphicon glyphicon-remove'></span></a>
                              </center></td>
                          </tr>";
                      $no++;
                    }
                  ?>
                  </tbody>
                </table>
              </div>