<div class="tab-pane fade" id="tabs_kpi" role="tabpanel" aria-labelledby="kpi_tabs">
    <table id="style-10" class="table style-10  table-hover">
        <h4>Penilaian KPI Marketing</h4>
        <thead>
            <tr>
                <th class="text-center">No</th>
                <th class="text-center">Bulan KPI</th>
                <th class="text-center">Nilai Angka</th>
                <th class="text-center">Nilai Huruf</th>
                <th class="text-center">Status</th>
                <th class="text-center">Aksi</th>
            </tr>
        </thead>
        <tbody>
            <?php $no = 1; ?>
            <?php foreach ($kpi as $Kpi) : ?>
            <tr>
                <td>
                    <center><?= $no ?></center>
                </td>
                <td class="text-right">
                    <?= $this->mycustom->bulanIndo(date('m', strtotime($Kpi->bln_kpi)))  ?>
                    <?= date('Y', strtotime($Kpi->bln_kpi))  ?>
                </td>
                <td class="text-center">
                    <?= $Kpi->nilai_angka ?>
                </td>
                <td class="text-center">
                    <?= $Kpi->nilai_huruf ?>
                </td>
                <td class="text-center">
                    <?php
                        if ($Kpi->sts_hasil == 'PROSES') : ?>
                    <span class="shadow-none badge badge-danger">PROSES</span>
                    <?php else : ?>
                    <span class="shadow-none badge badge-success">SELESAI</span>
                    <?php endif; ?>
                </td>
                <td class="text-center">
                    <?php
                        if ($Kpi->sts_hasil == 'PROSES') : ?>
                    <div class="btn-group mr-2">
                        <button class="btn btn-primary btn-sm dropdown-toggle" style="width: 100px;" type="button"
                            data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            Pilih Aksi <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
                                stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
                                <polyline points="6 9 12 15 18 9"></polyline>
                            </svg>
                        </button>
                        <div class="dropdown-menu">
                            <a class="dropdown-item"
                                href="<?= base_url('manager/identitas/kpi_update/' . $this->encrypt->encode($Kpi->id)) ?>">Update</a>
                            <a class="dropdown-item"
                                href="<?= base_url('manager/sistem/kpi_detail/' . $this->encrypt->encode($Kpi->id)) ?>">Detail</a>
                            <!-- <a class="dropdown-item" href="javascript:void(0);" id="detail_kpi"
                                data-target="#kpi_detail" class="bs-tooltip" data-toggle="modal" data-placement="top"
                                title="" data-original-title="Detail KPI"
                                <?php
                                foreach ($kpi_detail as $Detail_kpi) :
                                    if ($Kpi->id == $Detail_kpi->hasil_id) : ?>
                                data-faktor_id="<?= $Detail_kpi->faktor_id ?>" data-target="<?= $Detail_kpi->target ?>"
                                data-realisasi="<?= $Detail_kpi->realisasi ?>" data-nilai="<?= $Detail_kpi->nilai ?>"
                                data-nm_faktor="<?= $Detail_kpi->nm_faktor ?>"
                                data-nm_komp="<?= $Detail_kpi->nm_komp ?>" <?php endif;
                                                                    endforeach;
                                                                            ?>>Detail</a> -->
                        </div>
                    </div>
                    <?php else : ?>
                    <a class="btn btn-primary btn-sm"
                        href="<?= base_url('manager/identitas/kpi_detail/' . $this->encrypt->encode($Kpi->id)) ?>"
                        style="color: white;">Detail</a>
                    <!-- <a class="btn btn-primary btn-sm" href="javascript:void(0);" id="detail_aturan" data-target="#aturan_detail" class="bs-tooltip" data-toggle="modal" data-placement="top" title="" data-original-title="Detail Aturan" data-aturan_id="<?= $Aturan_koperasi->id ?>" data-produk_id="<?= $Aturan_koperasi->produk_id ?>" data-administrasi="<?= $Aturan_koperasi->administrasi ?>" data-rk="<?= $Aturan_koperasi->rk ?>" data-jasa="<?= $Aturan_koperasi->jasa ?>" data-simpanan="<?= $Aturan_koperasi->simpanan ?>" data-tempo="<?= $Aturan_koperasi->tempo ?>">Detail</a> -->
                    <?php endif; ?>
                </td>
            </tr>
            <?php $no++; ?>
            <?php endforeach; ?>
        </tbody>
    </table>
</div>
<?php $this->load->view('manager/identitas/karyawan/m_detail'); ?>