<?php $__env->startSection('title', 'Kriteria Penilaian'); ?>

<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-header d-flex justify-content-between align-items-center">
        <h3 class="card-title">Master Kriteria Penilaian</h3>
        <a href="<?php echo e(route('kriteria.create')); ?>" class="btn btn-primary btn-sm">Tambah Kriteria</a>
    </div>
    <div class="card-body">
        <?php if(session('success')): ?>
            <div class="alert alert-success"><?php echo e(session('success')); ?></div>
        <?php endif; ?>
        
        <div class="alert alert-info">
            Total Bobot Saat Ini: <strong><?php echo e($totalBobot); ?>%</strong> 
            (Sistem penilaian ideal jika total bobot = 100%)
        </div>

        <table class="table table-bordered table-striped" id="example1">
            <thead>
                <tr>
                    <th width="50">No</th>
                    <th>Nama Kriteria</th>
                    <th>Bobot (%)</th>
                    <th width="150">Aksi</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $kriteria; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $k): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($index + 1); ?></td>
                    <td><?php echo e($k->nama_kriteria); ?></td>
                    <td><?php echo e($k->bobot); ?></td>
                    <td>
                        <a href="<?php echo e(route('kriteria.edit', $k->id)); ?>" class="btn btn-warning btn-sm">Edit</a>
                        <form action="<?php echo e(route('kriteria.destroy', $k->id)); ?>" method="POST" style="display:inline-block;">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Yakin ingin menghapus kriteria ini?')">Hapus</button>
                        </form>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /opt/lampp/htdocs/skripsifh/resources/views/penilaian/kriteria/index.blade.php ENDPATH**/ ?>