<?php $__env->startSection('content'); ?>
    <div class="container-fluid px-xxl-65 px-xl-20 mt-20">
        <div class="hk-pg-header">
            <h4 class="hk-pg-title"><span class="pg-title-icon"><i class="material-icons">groups</i></span>Petugas Perpustakaan</h4>
        </div>

        <?php if(session('success')): ?>
            <div class="alert alert-success alert-wth-icon fade show" role="alert">
                <span class="alert-icon-wrap"><i class="zmdi zmdi-check-circle"></i></span>
                <?php echo e(session('success')); ?>

            </div>
        <?php elseif(session('fail')): ?>
            <div class="alert alert-danger alert-wth-icon fade show" role="alert">
                <span class="alert-icon-wrap"><i class="zmdi zmdi-block"></i></span>
                <?php echo e(session('fail')); ?>

            </div>
        <?php endif; ?>
        <div class="row">
            <div class="col-xl-12">
                <section class="hk-sec-wrapper">
                    <h5 class="hk-sec-title">Data Petugas</h5>
                    <p class="mb-20">Data Petugas Yang Penanggung Jawab Pada Sistem Perpustakaan SD Muhammadiyah 6 Palembang</p>
                    <a href="<?php echo e(route('petugas.create')); ?>" class="btn btn-success btn-wth-icon btn-sm mb-20">
                        <span class="icon-label">
                            <span class="material-icons">
                                person_add
                            </span>
                        </span>
                        <span class="btn-text">Tambah Petugas</span>
                    </a>
                    <div class="row">
                        <div class="col-sm">
                            <div class="table-wrap">
                                <table id="datable_1" class="table table-hover w-100 display pb-30">
                                    <thead>
                                        <tr>
                                            <th>NIP</th>
                                            
                                            <th>Nama Pegawai</th>
                                            <th>Tipe</th>
                                            <th>Foto</th>
                                            <th class="text-center">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__currentLoopData = $petugas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td><b><?php echo e($data->nip); ?></b></td>
                                                
                                                <td><?php echo e(Str::title($data->name)); ?></td>
                                                <td><?php echo e(Str::upper($data->type)); ?></td>
                                                <td>
                                                    <?php if($data->foto == null): ?>
                                                        <img src="/perpus/default.jpg" height="30" width="35"
                                                            alt="">
                                                    <?php else: ?>
                                                        <img src="/foto_petugas/<?php echo e($data->foto); ?>" height="30"
                                                            width="35" alt="">
                                                    <?php endif; ?>
                                                </td>
                                                <td class="text-center">
                                                    <?php if($data->id == Auth::user()->id): ?>

                                                    <?php else: ?>
                                                    <a href="<?php echo e(route('petugas.edit', $data->id)); ?>"
                                                        class="btn btn-icon btn-icon-circle btn-blue btn-icon-style-3"
                                                        data-toggle="tooltip" data-placement="top" title="Edit">
                                                        <span class="btn-icon-wrap">
                                                            <span class="material-icons">
                                                                edit
                                                            </span>
                                                        </span>
                                                    </a>
                                                    <a href="<?php echo e(route('petugas.destroy', $data->id)); ?>"
                                                        class="btn btn-icon btn-icon-circle btn-blue btn-icon-style-3"
                                                        data-toggle="tooltip" data-placement="top" title="Hapus"
                                                        onclick="event.preventDefault();
                                                        document.getElementById('petugas-delete-form-<?php echo e($data->id); ?>').submit();">
                                                        <span class="btn-icon-wrap">
                                                            <span class="material-icons">
                                                                delete
                                                            </span>
                                                        </span>
                                                    </a>
                                                    <form id="petugas-delete-form-<?php echo e($data->id); ?>"
                                                        action="<?php echo e(route('petugas.destroy', $data->id)); ?>"
                                                        method="POST" class="d-none">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('delete'); ?>
                                                    </form>
                                                    <?php endif; ?>
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('css'); ?>
    <!-- Data Table CSS -->
    <link href="/theme/vendors/datatables.net-dt/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
    <link href="/theme/vendors/datatables.net-responsive-dt/css/responsive.dataTables.min.css" rel="stylesheet"
        type="text/css" />
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
    <script>
        window.setTimeout(function() {
            $(".alert").fadeTo(700, 0).slideUp(500, function() {
                $(this).remove();
            });
        }, 2500);
    </script>
    <!-- Data Table JavaScript -->
    <script src="/theme/vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="/theme/vendors/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
    <script src="/theme/vendors/datatables.net-dt/js/dataTables.dataTables.min.js"></script>
    <script src="/theme/vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="/theme/vendors/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js"></script>
    <script src="/theme/vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="/theme/vendors/jszip/dist/jszip.min.js"></script>
    <script src="/theme/vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="/theme/vendors/pdfmake/build/vfs_fonts.js"></script>
    <script src="/theme/vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="/theme/vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="/theme/vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="/theme/dist/js/dataTables-data.js"></script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('petugas.theme.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\perpustakaan\resources\views/petugas/petugas/petugas.blade.php ENDPATH**/ ?>