

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

<?php $__env->startSection('content'); ?>

<div class="container-fluid">

    
    <div class="d-flex justify-content-between align-items-center mb-4">

        <div>

            <h3 class="font-weight-bold mb-1">
                Penggajian Guru & Staff
            </h3>

            <p class="text-muted mb-0">
                Periode <?php echo e(\Carbon\Carbon::parse($periode.'-01')->translatedFormat('F Y')); ?>

            </p>

        </div>

        <div>

            <a href="/penggajian/generate" class="btn btn-success btn-modern">
                <i class="bi bi-gear-fill"></i>
                Generate
            </a>

            <a href="/penggajian/create" class="btn btn-primary btn-modern">
                <i class="bi bi-plus-circle"></i>
                Tambah
            </a>

            <a href="/penggajian/export" class="btn btn-dark btn-modern">
                <i class="bi bi-file-earmark-excel"></i>
                Export
            </a>

        </div>

    </div>

    
    <div class="card card-modern mb-4">

        <div class="card-body">

            <form method="GET">

                <div class="row">

                    <div class="col-md-3">

                        <input
                            type="month"
                            name="periode"
                            value="<?php echo e($periode); ?>"
                            class="form-control">

                    </div>

                    <div class="col-md-2">

                        <button class="btn btn-primary btn-modern w-100">

                            <i class="bi bi-funnel-fill"></i>

                            Filter

                        </button>

                    </div>

                </div>

            </form>

        </div>

    </div>

    
    <div class="row mb-4">

        <div class="col-md-4">

            <div class="small-card">

                <div>

                    <small>Total Guru</small>

                    <h2><?php echo e($totalGuru); ?></h2>

                </div>

                <div class="small-icon bg-primary">

                    <i class="bi bi-mortarboard-fill"></i>

                </div>

            </div>

        </div>

        <div class="col-md-4">

            <div class="small-card">

                <div>

                    <small>Total Penggajian</small>

                    <h4>

                        Rp <?php echo e(number_format($totalGaji,0,',','.')); ?>


                    </h4>

                </div>

                <div class="small-icon bg-success">

                    <i class="bi bi-cash-stack"></i>

                </div>

            </div>

        </div>

        <div class="col-md-4">

            <div class="small-card">

                <div>

                    <small>Total Data</small>

                    <h2><?php echo e($penggajian->count()); ?></h2>

                </div>

                <div class="small-icon bg-warning">

                    <i class="bi bi-clipboard-data-fill"></i>

                </div>

            </div>

        </div>

    </div>

    
    <div class="card card-modern">

        <div class="card-header bg-white border-0">

            <h5 class="mb-0">

                <i class="bi bi-wallet2 text-success mr-2"></i>

                Data Penggajian

            </h5>

        </div>

        <div class="card-body">

            <div class="table-responsive">

                <table class="table table-modern datatable">

                    <thead>

                    <tr>

                        <th>Nama</th>

                        <th>Jam</th>

                        <th>Tarif</th>

                        <th>Insentif</th>

                        <th>Gaji Staff</th>

                        <th>Potongan</th>

                        <th>Gaji Bersih</th>

                        <th class="text-center">

                            Aksi

                        </th>

                    </tr>

                    </thead>

                    <tbody>

                    <?php $__empty_1 = true; $__currentLoopData = $penggajian; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>

                    <tr>

                        <td>

                            <strong>

                                <?php echo e($p->guru?->nama ?? $p->staff?->nama ?? '-'); ?>


                            </strong>

                        </td>

                        <td>

                            <?php echo e($p->total_jam); ?> Jam

                        </td>

                        <td>

                            Rp <?php echo e(number_format($p->tarif,0,',','.')); ?>


                        </td>

                        <td>

                            <span class="badge badge-success badge-pill">

                                Rp <?php echo e(number_format($p->tunjangan,0,',','.')); ?>


                            </span>

                        </td>

                        <td>

                            Rp <?php echo e(number_format($p->gaji_staff,0,',','.')); ?>


                        </td>

                        <td>

                            <span class="badge badge-danger badge-pill">

                                Rp <?php echo e(number_format($p->potongan,0,',','.')); ?>


                            </span>

                        </td>

                        <td>

                            <strong class="text-primary">

                                Rp <?php echo e(number_format($p->gaji_bersih,0,',','.')); ?>


                            </strong>

                        </td>

                        <td class="text-center">

                            <a href="/penggajian/<?php echo e($p->id); ?>"
                               class="btn btn-info btn-sm rounded-circle"
                               title="Detail">

                                <i class="bi bi-eye"></i>

                            </a>

                            <a href="/penggajian/<?php echo e($p->id); ?>/edit"
                               class="btn btn-warning btn-sm rounded-circle"
                               title="Edit">

                                <i class="bi bi-pencil"></i>

                            </a>

                            <a href="/penggajian/slip/<?php echo e($p->id); ?>"
                               target="_blank"
                               class="btn btn-success btn-sm rounded-circle"
                               title="Slip">

                                <i class="bi bi-printer"></i>

                            </a>

                            <form
                                action="/penggajian/<?php echo e($p->id); ?>"
                                method="POST"
                                class="d-inline">

                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>

                                <button
                                    class="btn btn-danger btn-sm rounded-circle"
                                    onclick="return confirm('Hapus data penggajian?')">

                                    <i class="bi bi-trash"></i>

                                </button>

                            </form>

                        </td>

                    </tr>

                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>

                    <tr>

                        <td colspan="8" class="text-center text-muted py-5">

                            <i class="bi bi-wallet2 display-4 d-block mb-3"></i>

                            Belum ada data penggajian.

                        </td>

                    </tr>

                    <?php endif; ?>

                    </tbody>

                </table>

            </div>

        </div>

    </div>

</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\Presguru\resources\views/penggajian/index.blade.php ENDPATH**/ ?>