<?php $__env->startSection('title'); ?>
Pelanggaran
<?php $__env->stopSection(); ?>

<?php $__env->startPush('before-script'); ?>

<?php if(session('status')): ?>
<?php if (isset($component)) { $__componentOriginal6bb91b748cddfa526a1e6a6c5efd3ee0dde567e5 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Sweetalertsession::class, ['tipe' => ''.e(session('tipe')).'','status' => ''.e(session('status')).'']); ?>
<?php $component->withName('sweetalertsession'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6bb91b748cddfa526a1e6a6c5efd3ee0dde567e5)): ?>
<?php $component = $__componentOriginal6bb91b748cddfa526a1e6a6c5efd3ee0dde567e5; ?>
<?php unset($__componentOriginal6bb91b748cddfa526a1e6a6c5efd3ee0dde567e5); ?>
<?php endif; ?>
<?php endif; ?>
<?php $__env->stopPush(); ?>


<?php $__env->startSection('content'); ?>
<section class="section">
    <div class="section-header">
        <h1><?php echo $__env->yieldContent('title'); ?></h1>
        <div class="section-header-breadcrumb">
            <div class="breadcrumb-item active"><a href="<?php echo e(route('dashboard')); ?>">Dashboard</a></div>
            <div class="breadcrumb-item"><a href="<?php echo e(route('pelanggaran')); ?>">Pelanggaran</a></div>
            <div class="breadcrumb-item"><?php echo $__env->yieldContent('title'); ?></div>
        </div>
    </div>

    <div class="row">
        <div class="col-12 col-md-5 col-lg-5">

            <div class="section-body">
                <div class="card">
                    <div class="card-body" >

                        <div id="babeng-bar" class="text-center mt-2">

                            <div id="babeng-row ">

                                <form action="<?php echo e(route('siswa.cari')); ?>" method="GET" class="d-inline">
                                    <input type="text" class="babeng babeng-select  ml-0" name="cari">

                                    <span>
                                        <input class="btn btn-info ml-1 mt-2 mt-sm-0" type="submit" id="babeng-submit"
                                            value="Cari">
                                    </span>

                                 </form>

                                 <a href="<?php echo e(route('pelanggaran.detail',$kelas->id)); ?>" type="submit" value="Import"
                                 class="btn btn-icon btn-primary btn-sm ml-2"><span class="pcoded-micon"> <i
                                         class="fas fa-download"></i> Tambah </span></a> </form>


                            </div>
                        </div>

                            <?php if (isset($component)) { $__componentOriginal7f6fe7bbf5512b742c0bcffa8025ccbaf91ac921 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Jsmultidel::class, ['link' => ''.e(route('siswa.multidel')).'']); ?>
<?php $component->withName('jsmultidel'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7f6fe7bbf5512b742c0bcffa8025ccbaf91ac921)): ?>
<?php $component = $__componentOriginal7f6fe7bbf5512b742c0bcffa8025ccbaf91ac921; ?>
<?php unset($__componentOriginal7f6fe7bbf5512b742c0bcffa8025ccbaf91ac921); ?>
<?php endif; ?>

                        <?php if($datas->count()>0): ?>
                            <?php if (isset($component)) { $__componentOriginalbea8fd2875612672ec60fa7e39941fa4202cfa75 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Jsdatatable::class, []); ?>
<?php $component->withName('jsdatatable'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalbea8fd2875612672ec60fa7e39941fa4202cfa75)): ?>
<?php $component = $__componentOriginalbea8fd2875612672ec60fa7e39941fa4202cfa75; ?>
<?php unset($__componentOriginalbea8fd2875612672ec60fa7e39941fa4202cfa75); ?>
<?php endif; ?>
                        <?php endif; ?>

                        <table id="example" class="table table-striped table-bordered mt-1 table-sm" style="width:100%" >
                            <thead>
                                <tr style="background-color: #F1F1F1">
                                    <th width="8%" class="text-center py-2">
                                        No</th>
                                    <th >Nama Siswa</th>
                                    <th class="text-center" width="18%">Total</th>
                                    <th class="text-center" width="8%">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $datas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <tr id="sid<?php echo e($data->id); ?>">
                                        <td class="text-center">
                                            <?php echo e(((($loop->index)+1)+(($datas->currentPage()-1)*$datas->perPage()))); ?></td>
                                        <td>
                                            <?php echo e(Str::limit($data->nama,25,' ...')); ?>

                                        </td>
                                        <td class="text-center"><?php echo e($data->pelanggaran!=null ? $data->pelanggaran->count() : '0'); ?> </td>
                                        <td class="text-center">
                                            <button type="button" class="btn btn-outline-info btn-sm" data-toggle="tooltip" data-placement="top" title="Lihat Pelanggaran Siswa!" id="lihat<?php echo e($data->id); ?>">
                                            <i class="fas fa-id-card-alt"></i>
                                        </button>

                                        </td>
                                    </tr>
                                    <?php $__env->startPush('before-script'); ?>
                                        <script>
                                            $(function () {
                                                $('#lihat<?php echo e($data->id); ?>').click(function (e) {
                                                    e.preventDefault();
                                                    let detailsiswa=`

                        <div class="card-header">
                            <h5><?php echo e($data->nama); ?></h5>
                        </div>
                        <div class="row">
                        <table id="example" class="table table-striped table-bordered mt-1 table-sm" style="width:100%" >
                            <thead>
                                <tr style="background-color: #F1F1F1">
                                    <th width="8%" class="text-center py-2">
                                        No</th>
                                    <th> Pelanggaran</th>
                                    <th class="text-center" width="18%">Skor</th>
                                    <th class="text-center" width="8%">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                              `;

                                        <?php $__currentLoopData = $data->pelanggaran; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            detailsiswa+=`
                                            <tr>
                                                <td class="text-center" ><?php echo e($loop->index+1); ?></td>
                                                <td><?php echo e($p->nama); ?></td>
                                                <td class="text-center" ><?php echo e($p->skor); ?></td>
                                                <td class="text-center" >
                                                    <?php if (isset($component)) { $__componentOriginalc82eaddaef5db682d36356a1ab70f5eabde644c5 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\ButtonDelete::class, ['link' => '/admin/'.e($pages).'/'.e($data->id).'']); ?>
<?php $component->withName('button-delete'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc82eaddaef5db682d36356a1ab70f5eabde644c5)): ?>
<?php $component = $__componentOriginalc82eaddaef5db682d36356a1ab70f5eabde644c5; ?>
<?php unset($__componentOriginalc82eaddaef5db682d36356a1ab70f5eabde644c5); ?>
<?php endif; ?>
                                                </td>
                                            </tr>
                                                `;
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                detailsiswa+=`
                            </tbody>
                            </table>
                        </div>

                                                    `;
                                                        $('#contentmain').html(detailsiswa);

                                                });
                                            });
                                        </script>
                                    <?php $__env->stopPush(); ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="5" class="text-center">Data tidak ditemukan</td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>

        <?php
        $cari=$request->cari;
        ?>
        <?php echo e($datas->onEachSide(1)
          ->links()); ?>

                    </div>
                </div>
            </div>


        </div>
        <div class="col-12 col-md-7 col-lg-7">


            <div class="section-body">
                <div class="card">
                    <div class="card-body" id="contentmain">

                        <div class="card-header">
                            <h5>Tambah Pelanggaran</h5>
                        </div>
                        <form action="<?php echo e(route('pelanggaran.store',$kelas->id)); ?>" method="post">
                        <?php echo csrf_field(); ?>
                        <div class="row">

                            <div class="form-group col-md-2 col-12 mt-0 ml-5">
                                <label class="form-label">Pilih Siswa</label>
                            </div>
                            <div class="form-group col-md-8 col-12 mt-0 ml-5" >
                                <select class="js-example-basic-single form-control-sm <?php $__errorArgs = ['siswa_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                is-invalid
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="siswa_id"  style="width: 75%" required>
                                <option disabled selected value=""> Pilih Siswa</option>
                                <?php $__currentLoopData = $datas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($t->id); ?>"> <?php echo e($t->nama); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                              </select>
                              </div>
                              <?php $__env->startPush('before-script'); ?>
                              <?php $__env->stopPush(); ?>


                            <div class="form-group col-md-2 col-12 mt-0 ml-5">
                                <label class="form-label">Nama Pelanggaran</label>
                            </div>
                            <div class="form-group col-md-8 col-12 mt-0 ml-5" >
                                <input type="text" name="nama" id="nama" class="form-control <?php $__errorArgs = ['nama'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('nama') ? old('nama') : ''); ?>" required>
                                <?php $__errorArgs = ['nama'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"> <?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                              </div>


                            <div class="form-group col-md-2 col-12 mt-0 ml-5">
                                <label class="form-label">Skor Pelanggaran</label>
                            </div>
                            <div class="form-group col-md-8 col-12 mt-0 ml-5" >
                                <input type="number" name="skor" id="skor" class="form-control <?php $__errorArgs = ['skor'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('skor') ? old('skor') : '1'); ?>" required min="0" max="100">
                                <?php $__errorArgs = ['skor'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"> <?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                              </div>
                            <div class="form-group col-md-2 col-12 mt-0 ml-5">
                                <label class="form-label">Tanggal Pelanggaran</label>
                            </div>
                            <div class="form-group col-md-8 col-12 mt-0 ml-5" >
                                    <input type="date" name="tgl" id="tgl" class="form-control <?php $__errorArgs = ['tgl'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('tgl')? old('tgl') : date('Y-m-d')); ?>" required>
                                    <?php $__errorArgs = ['tgl'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"> <?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                              </div>

                        </div>

                    <div class="card-footer text-right mr-5">
                        <button class="btn btn-primary">Simpan</button>
                    </div>
                </form>
                    </div>
                </div>
            </div>


        </div>
    </div>



</section>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.default', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Xampp 8.2\htdocs\sim\resources\views/pages/admin/pelanggaran/detail.blade.php ENDPATH**/ ?>