<div class="content-header">
  <div>
    <h4 class="content-title"><?php echo $title; ?></h4>
  </div>
</div><!-- content-header -->
<div class="content-body">
	<?php if($this->session->flashdata('flash')): ?>
	<div class="alert alert-success"><?php echo $this->session->flashdata('flash'); ?></div>
	<?php endif; ?>
	<a href="admin/postingan/artikel/new" class="btn btn-primary mb-2"><i class="fas fa-plus"></i></a>
	<table id="myTable" class="table">
    <thead>
      <tr>
      	<th class="wd-5p">No</th>
      	<th>Tgl</th>
		<th>Judul</th>
		<th>Foto</th>
		<th>Kategori</th>
		<th>Opsi</th>
      </tr>
    </thead>
    <tbody>
    	<?php $i = 1; ?>
		<?php foreach($artikel as $art): ?>
		<tr>
			<td><?php echo $i; ?>.</td>
			<td><?php echo date('d-m-Y', strtotime($art['post_tgl'])); ?></td>
			<td><?php echo $art['post_judul']; ?></td>
			<td><img src="assets/home/img/<?php echo $art['post_foto']; ?>" width="50" alt="<?php echo $art['post_foto']; ?>"></td>
			<td><?php echo $art['kat_nama']; ?></td>
			<td>
				<a href="admin/postingan/artikel/edit/<?php echo $art['post_id']; ?>" class="btn btn-sm btn-warning"><i class="fa fa-edit"></i> Edit</a>
				<a href="admin/postingan/artikel/hapus/<?php echo $art['post_id']; ?>" class="btn btn-sm btn-danger" onclick="return confirm('Yakin data ini akan dihapus?');"><i class="fa fa-trash"></i> Hapus</a>
			</td>
		</tr>
		<?php $i++; ?>
		<?php endforeach; ?>
    </tbody>
  </table>
</div><!-- content-body -->