

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

<div class="container">

    
    <?php if(session('success')): ?>
        <div class="alert alert-success">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>

    <?php if(session('error')): ?>
        <div class="alert alert-danger">
            <?php echo e(session('error')); ?>

        </div>
    <?php endif; ?>

    
    <div class="row mb-4">

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

        <div class="card border-0 shadow-sm h-100">

            <div class="card-body text-center">

                <div class="mb-2">
                    <i class="fas fa-check-circle fa-2x text-success"></i>
                </div>

                <h2 class="font-weight-bold text-success">
                    <?php echo e($riwayat->where('status','Hadir')->count()); ?>

                </h2>

                <p class="text-muted mb-0">
                    Total Hadir
                </p>

            </div>

        </div>

    </div>

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

        <div class="card border-0 shadow-sm h-100">

            <div class="card-body text-center">

                <div class="mb-2">
                    <i class="fas fa-clock fa-2x text-primary"></i>
                </div>

                <h2 class="font-weight-bold text-primary">
                    <?php echo e($riwayat->sum('jam_kerja')); ?>

                </h2>

                <p class="text-muted mb-0">
                    Total Jam Mengajar
                </p>

            </div>

        </div>

    </div>

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

        <div class="card border-0 shadow-sm h-100">

            <div class="card-body text-center">

                <div class="mb-2">
                    <i class="fas fa-calendar-check fa-2x text-warning"></i>
                </div>

                <h2 class="font-weight-bold text-warning">
                    <?php echo e($riwayat->count()); ?>

                </h2>

                <p class="text-muted mb-0">
                    Total Absensi
                </p>

            </div>

        </div>

    </div>

</div>

    
<div class="card shadow-sm border-0 mb-4">

    <div class="card-header bg-white">
        <h4 class="mb-0">
            <i class="fas fa-fingerprint text-success"></i>
            Absensi Mengajar Hari Ini
        </h4>
    </div>

    <div class="card-body">

        <p>
            <strong>Tanggal :</strong>
            <?php echo e(date('d F Y')); ?>

        </p>

        <?php if($jadwalHariIni->count()): ?>

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

            <div class="card border mb-3">

                <div class="card-body">

                    <div class="row align-items-center">

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

                            <h5 class="mb-2">

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


                            </h5>

                            <p class="mb-1">

                                <strong>Kelas :</strong>

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


                            </p>

                            <p class="mb-1">

                                <strong>Jam :</strong>

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


                                -

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


                            </p>

                            <p class="mb-0">

                                <strong>Total Jam :</strong>

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

                            </p>

                        </div>

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

                            <?php if($j->sudah_absen): ?>

                                <button
                                    class="btn btn-success"
                                    disabled>

                                    <i class="fas fa-check-circle"></i>

                                    Sudah Absen

                                </button>

                            <?php else: ?>

                                <form
                                    action="/absensi/hadir/<?php echo e($j->id); ?>"
                                    method="POST">

                                    <?php echo csrf_field(); ?>

                                    <button
                                        class="btn btn-primary">

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

                                        Absen Mengajar

                                    </button>

                                </form>

                            <?php endif; ?>

                        </div>

                    </div>

                </div>

            </div>

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

        <?php else: ?>

            <div class="alert alert-warning">

                Tidak ada jadwal mengajar hari ini.

            </div>

        <?php endif; ?>

        <hr>

        <a href="/izin/create"
            class="btn btn-warning">

            <i class="fas fa-file-signature"></i>

            Ajukan Izin

        </a>

        <a href="/absensi/riwayat"
            class="btn btn-primary">

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

            Riwayat

        </a>

        <a href="/absensi/rekap"
            class="btn btn-info">

            <i class="fas fa-chart-line"></i>

            Rekap

        </a>

    </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\sistem-gaji-sekolah\resources\views/absensi/index.blade.php ENDPATH**/ ?>