

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

<?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">
                Jadwal Mengajar
            </h3>

            <p class="text-muted mb-0">
                Kelola seluruh jadwal mengajar guru.
            </p>

        </div>

        <a href="<?php echo e(route('jadwal.create')); ?>"
           class="btn btn-primary btn-modern">

            <i class="fas fa-plus-circle mr-1"></i>

            Tambah Jadwal

        </a>

    </div>

    
    <div class="row mb-4">

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

            <div class="small-card">

                <div>

                    <small>Total Jadwal</small>

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

                </div>

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

                    <i class="fas fa-calendar-alt"></i>

                </div>

            </div>

        </div>

    </div>

    
    <div class="card card-modern">

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

            <h5 class="mb-0">

                <i class="fas fa-table text-primary mr-2"></i>

                Data Jadwal Mengajar

            </h5>

        </div>

        <div class="card-body">

            <div class="table-responsive">

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

                    <thead>

                        <tr>

                            <th>Guru</th>

                            <th>Mata Pelajaran</th>

                            <th>Kelas</th>

                            <th>Hari</th>

                            <th>Jam</th>

                            <th>Total</th>

                            <th width="140" class="text-center">

                                Aksi

                            </th>

                        </tr>

                    </thead>

                    <tbody>

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

                    <tr>

                        <td>

                            <div class="d-flex align-items-center">

                                <img
                                    src="https://ui-avatars.com/api/?name=<?php echo e(urlencode($j->guru->nama)); ?>&background=2563eb&color=fff"
                                    class="rounded-circle mr-2"
                                    width="40">

                                <div>

                                    <strong>

                                        <?php echo e($j->guru->nama); ?>


                                    </strong>

                                </div>

                            </div>

                        </td>

                        <td>

                            <span class="badge badge-primary px-3 py-2">

                                <?php echo e($j->mataPelajaran->nama_mapel); ?>


                            </span>

                        </td>

                        <td>

                            <span class="badge badge-success px-3 py-2">

                                <?php echo e($j->kelas->nama_kelas); ?>


                            </span>

                        </td>

                        <td>

                            <?php

                                $warna = [

                                    'Senin'=>'primary',
                                    'Selasa'=>'success',
                                    'Rabu'=>'warning',
                                    'Kamis'=>'info',
                                    'Jumat'=>'danger',
                                    'Sabtu'=>'secondary'

                                ];

                            ?>

                            <span class="badge badge-<?php echo e($warna[$j->hari] ?? 'dark'); ?>">

                                <?php echo e($j->hari); ?>


                            </span>

                        </td>

                        <td>

                            <i class="far fa-clock text-primary"></i>

                            <?php echo e(substr($j->jam_mulai,0,5)); ?>


                            -

                            <?php echo e(substr($j->jam_selesai,0,5)); ?>


                        </td>

                        <td>

                            <span class="badge badge-info">

                                <?php echo e($j->jam_mengajar); ?> Jam

                            </span>

                        </td>

                        <td class="text-center">

                            <a href="<?php echo e(route('jadwal.edit',$j->id)); ?>"
                               class="btn btn-warning btn-sm rounded-circle"
                               title="Edit">

                                <i class="fas fa-pencil-alt"></i>

                            </a>

                            <form
                                action="<?php echo e(route('jadwal.destroy',$j->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 jadwal ini?')">

                                    <i class="fas fa-trash"></i>

                                </button>

                            </form>

                        </td>

                    </tr>

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

                    </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/jadwal/index.blade.php ENDPATH**/ ?>