<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; ?>
	<div class="mb-2">
		<a href="admin/events/new" class="btn btn-primary">
			<i class="fas fa-plus"></i>
		</a>
	</div>
	<table id="myTable" class="table">
    <thead>
      <tr>
      	<th class="wd-5p">No</th>
      	<th>Tanggal</th>
		<th>Waktu</th>
		<th>Lokasi</th>
		<th>Tema</th>
		<th>Foto</th>
		<th>Opsi</th>
      </tr>
    </thead>
    <tbody>
    	<?php $i = 1; ?>
		<?php foreach($events as $ev): ?>
		<tr>
			<td><?php echo $i; ?>.</td>
			<td><?php echo date('d-m-Y', strtotime($ev['event_tgl'])); ?></td>
			<td><?php echo $ev['event_waktu']; ?></td>
			<td><?php echo $ev['event_lokasi']; ?></td>
			<td><?php echo $ev['event_tema']; ?></td>
			<td><img src="assets/home/img/event/<?php echo $ev['event_foto']; ?>" width="50" alt="<?php echo $ev['event_tema']; ?>"></td>
			<td>
				<a href="admin/events/edit/<?php echo $ev['event_id']; ?>" class="btn btn-sm btn-info"><i class="fa fa-edit"></i> edit</a>
				<a href="admin/events/hapus/<?php echo $ev['event_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 -->