<?php
$current_page = $this->set_current_page_link();
$csrf_token = Csrf::$token;
$field_name = $this->route->field_name;
$field_value = $this->route->field_value;
$view_data = $this->view_data;
$records = $view_data->records;
$record_count = $view_data->record_count;
$total_records = $view_data->total_records;
if (!empty($records)) {
?>
<!--record-->
<?php
$counter = 0;
foreach($records as $data){
$rec_id = (!empty($data['id']) ? urlencode($data['id']) : null);
$counter++;
?>
<tr>
    <th class="td-sno"><?php echo $counter; ?></th>
    <td class="td-nama"> <?php echo $data['nama']; ?></td>
    <td class="td-kelompok"> <?php echo $data['kelompok']; ?></td>
    <td class="td-waktu"> <?php echo $data['waktu']; ?></td>
    <td class="page-list-action td-btn">
        <div class="dropdown" >
            <button data-toggle="dropdown" class="dropdown-toggle btn btn-primary btn-sm">
                <i class="fa fa-bars"></i> 
            </button>
            <ul class="dropdown-menu">
                <a class="dropdown-item page-modal" href="<?php print_link("absen_remaja/view/$rec_id"); ?>">
                    <i class="fa fa-eye"></i> Lihat 
                </a>
                <a class="dropdown-item page-modal" href="<?php print_link("absen_remaja/edit/$rec_id"); ?>">
                    <i class="fa fa-edit"></i> Ubah
                </a>
                <a  class="dropdown-item record-delete-btn" href="<?php print_link("absen_remaja/delete/$rec_id/?csrf_token=$csrf_token&redirect=$current_page"); ?>" data-prompt-msg="Apakah yakin menghapus data?" data-display-style="modal">
                    <i class="fa fa-times"></i> Hapus 
                </a>
            </ul>
        </div>
    </td>
</tr>
<?php 
}
?>
<?php
} else {
?>
<td class="no-record-found col-12" colspan="100">
    <h4 class="text-muted text-center ">
        No Record Found
    </h4>
</td>
<?php
}
?>
