<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">Komponen & Faktor</th>
                            <th class="text-center">Target KPI</th>
                            <th class="text-center">Realisasi KPI</th>
                            <th class="text-center">Persentase</th>
                            <th class="text-center">Nilai Angka</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $no = 1; ?>
                        <?php foreach ($detail_kpi as $Detail_kpi) : ?>
                        <tr>
                            <td class="text-left">
                                <?= $no ?>
                            </td>
                            <td class="text-left">
                                <?= $Detail_kpi->nm_komp ?> - <?= $Detail_kpi->nm_faktor ?>
                            </td>
                            <td class="text-right">
                                <?php
                                    if (strlen($Detail_kpi->target) > 6) :
                                        echo number_format($Detail_kpi->target, 0, ',', '.') . ',-';
                                    elseif (strlen($Detail_kpi->target) > 4) :
                                        echo $Detail_kpi->target . ' Menit / ( ' . ($Detail_kpi->target / 60 / 8) . ' Hari )';
                                    else:
                                        echo $Detail_kpi->target;
                                    endif;
                                    ?>
                            </td>
                            <td class="text-right">
                                <?php
                                    if (strlen($Detail_kpi->realisasi) > 6) :
                                        echo number_format($Detail_kpi->realisasi, 0, ',', '.') . ',-';
                                    elseif (strlen($Detail_kpi->realisasi) > 4) :
                                        echo $Detail_kpi->realisasi . ' Menit / ( ' . ($Detail_kpi->realisasi / 60 / 8) . ' Hari )';
                                    else:
                                        echo $Detail_kpi->realisasi;
                                    endif;
                                    ?>
                            </td>
                            <td class="text-center">
                                <?= $Detail_kpi->persentase ?>%
                            </td>
                            <td class="text-center">
                                <?= $Detail_kpi->nilai ?>
                            </td>
                        </tr>
                        <?php $no++; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>