<div class="row layout-spacing">
    <div class="col-lg-12">
        <div class="statbox widget box box-shadow">
            <div class="widget-content widget-content-area">
                <table id="style-3" class="table style-3  table-hover">
                    <thead>
                        <tr>
                            <th class="text-center">No</th>
                            <th class="text-center">Identitas</th>
                            <th class="text-center">Alamat</th>
                            <th class="text-center">Kontak</th>
                            <th class="text-center">Target</th>
                            <th class="text-center">Aksi</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $no = 1; ?>
                        <?php foreach ($target as $Target) : ?>
                        <tr>
                            <td class="text-left">
                                <?= $no ?>
                            </td>
                            <td class="text-left">
                                Nama : <?= $Target->nm_panggilan ?> <br>
                                Gabung : <?= date('d', strtotime($Target->tgl_gabung))  ?>
                                <?= $this->mycustom->bulanIndo(date('m', strtotime($Target->tgl_gabung)))  ?>
                                <?= date('Y', strtotime($Target->tgl_gabung))  ?> (
                                <?= date('Y') - date('Y', strtotime($Target->tgl_gabung)) ?> Tahun )
                            </td>
                            <td class="text-left">
                                Ds. <?= $Target->nm_desa ?>, Kec. <?= $Target->nm_kecamatan ?> <br>
                                <?= $Target->kot_kab ?> - <?= $Target->prov ?>
                            </td>
                            <td class="text-left">
                                No HP : <?= $Target->no_hp ?> <br> Email : <?= $Target->email ?>
                            </td>
                            <td class="text-right">
                                <?php
                                    if (strlen($Target->tgt_kinerja) > 6) :
                                        echo number_format($Target->tgt_kinerja, 0, ',', '.') . ',-';
                                    elseif (strlen($Target->tgt_kinerja) > 4) :
                                        echo $Target->tgt_kinerja . ' Menit / ( ' . ($Target->tgt_kinerja / 60 / 8) . ' Hari )';
                                    else:
                                        echo $Target->tgt_kinerja;
                                    endif;
                                    ?>
                            </td>
                            <td class="text-center">
                                <a class="btn btn-primary btn-sm"
                                    href="<?= base_url('manager/sistem/kpi_marketing/target_histori/' . $this->encrypt->encode($Target->faktor_marketing)) ?>">Histori</a>
                            </td>
                        </tr>
                        <?php $no++; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>