

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

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

<style>

    .pengembalian-container{

        max-width:900px;

        margin:auto;
    }

    .card-box{

        background:
        rgba(255,255,255,.08);

        border:1px solid rgba(255,255,255,.08);

        backdrop-filter:blur(18px);

        border-radius:30px;

        padding:35px;

        box-shadow:
        0 10px 35px rgba(0,0,0,.25);
    }

    .title{

        font-size:34px;

        font-weight:800;

        color:white;

        margin-bottom:30px;
    }

    .detail-box{

        display:grid;

        grid-template-columns:
        repeat(auto-fit,minmax(250px,1fr));

        gap:20px;

        margin-bottom:30px;
    }

    .detail-item{

        background:
        rgba(255,255,255,.05);

        border-radius:20px;

        padding:20px;
    }

    .detail-item h5{

        color:#94a3b8;

        margin-bottom:10px;

        font-size:14px;
    }

    .detail-item p{

        color:white;

        font-size:20px;

        font-weight:700;
    }

    .form-group{

        margin-bottom:25px;
    }

    .form-group label{

        display:block;

        color:white;

        margin-bottom:12px;

        font-weight:600;
    }

    .form-control{

        width:100%;

        padding:16px;

        border:none;

        outline:none;

        border-radius:16px;

        background:
        rgba(255,255,255,.08);

        color:white;

        font-size:15px;
    }

    .form-control option{

        color:black;
    }

    .btn-submit{

        border:none;

        padding:16px 28px;

        border-radius:16px;

        background:
        linear-gradient(
            135deg,
            #8b5cf6,
            #2563eb
        );

        color:white;

        font-weight:700;

        cursor:pointer;

        transition:.3s;
    }

    .btn-submit:hover{

        transform:translateY(-3px);
    }

</style>

<div class="pengembalian-container">

    <div class="card-box">

        <div class="title">

            📚 Form Pengembalian Buku

        </div>

        <!-- DETAIL TRANSAKSI -->

        <div class="detail-box">

            <div class="detail-item">

                <h5>Nama Siswa</h5>

                <p>
                    <?php echo e($transaksi->siswa->nama_siswa); ?>

                </p>

            </div>

            <div class="detail-item">

                <h5>Judul Buku</h5>

                <p>
                    <?php echo e($transaksi->buku->judul_buku); ?>

                </p>

            </div>

            <div class="detail-item">

                <h5>Tanggal Pinjam</h5>

                <p>
                    <?php echo e($transaksi->tanggal_pinjam); ?>

                </p>

            </div>

            <div class="detail-item">

                <h5>Status</h5>

                <p>
                    <?php echo e(ucfirst($transaksi->status)); ?>

                </p>

            </div>

        </div>

        <!-- FORM -->

        <form action="/pengembalian/<?php echo e($transaksi->id_transaksi); ?>"
              method="POST">

            <?php echo csrf_field(); ?>

            <?php

    $telat =
        now()->gt(
            \Carbon\Carbon::parse(
                $transaksi->tanggal_kembali
            )
        );

?>

<?php if($telat): ?>

<div class="form-group">

    <label>

        ⚠️ Siswa Terlambat,
        Pilih Sanksi

    </label>

    <select name="id_sanksi"
            class="form-control"
            required>

        <option value="">
            -- Pilih Sanksi --
        </option>

        <?php $__currentLoopData = $sanksi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

        <option value="<?php echo e($s->id_sanksi); ?>">

            <?php echo e($s->jenis_sanksi); ?>


        </option>

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

    </select>

</div>

<?php else: ?>

<div style="
    background:rgba(34,197,94,.15);
    color:#86efac;
    padding:18px;
    border-radius:18px;
    margin-bottom:25px;
    font-weight:600;
">

    ✅ Buku dikembalikan tepat waktu,
    tidak ada sanksi.

</div>

<?php endif; ?>

                </select>

            </div>

            <button type="submit"
                    class="btn-submit">

                ✅ Proses Pengembalian

            </button>

        </form>

    </div>

</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.petugas', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\aplikasi-perpustakaan\resources\views/transaksi/pengembalian.blade.php ENDPATH**/ ?>