<table class="table table-striped table-mailcard">
    <thead>
        <tr>
            <th class="w-1 text-center">No</th>
            <th class="w-10">Nama Toko</th>
            <th class="w-15">Pemilik Toko</th>
            <th class="w-10">Telp Toko</th>
            <th class="w-25">Email Toko</th>
            <th class="w-20 text-right">Aksi</th>
        </tr>
    </thead>
    <tbody>
        <?php if (!empty($result)) {
            $no = 1;
            foreach ($result as $row) {
                if ($row->active == 'Y') {
                    $aktif = '<i class="fa fa-check-circle"></i>';
                    $text = 'text-white';
                } else {
                    $aktif = '<i class="fa fa-minus-circle"></i>';
                    $text = 'text-white-50';
                }
                $id = encrypt_url($row->id);
                $hapus = '<button type="button" class="btn btn-danger btn-sm text-white"  data-id="'.$id.'" data-toggle="modal" data-target="#confirm-delete" href="#"><i class="fa fa-trash "></i> Hapus</button>';
                echo "<tr><td class='text-center'>$no</td>
											<td class='pl-1'><a class='btn-sm add_dropship text-info' title='Edit Data' data-id='{$id}' href='#'>{$row->nama_toko}</a></td>
											<td class='text-left'>{$row->nama_pemilik}</td>
											<td class='text-left'>{$row->telp_toko}</td>
											<td class='text-left'>{$row->email_toko}</td>
											<td class='text-right'>
											<div class='btn-group btn-group-sm' role='group'>
											<button type='button' class='btn btn-info btn-sm' data-id='".$id."'><span class='icon $text'>$aktif</span></button>
											<button type='button' class='btn btn-info btn-sm add_dropship' data-id='".$id."'><i class='fa fa-edit'></i> Edit</button>
											$hapus
											</div>
											</td>
											</tr>";
                ++$no;
            }
        } else { ?>
        <tr>
            <td colspan="5">Data belum ada</td>
        </tr>
        <?php } ?>
    </tbody>
</table>
<nav aria-label="Page navigation" class="mt-2">
    <?php
            echo $this->ajax_pagination->create_links();
        ?>
</nav>