

<?php $__env->startSection('css'); ?>
<!-- Table css -->
<link href="<?php echo e(URL::asset('plugins/RWD-Table-Patterns/dist/css/rwd-table.min.css')); ?>" rel="stylesheet" type="text/css" media="screen">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
<div class="col-sm-6">
    <h4 class="page-title text-left">Attendance</h4>
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="javascript:void(0);">Home</a></li>
        <li class="breadcrumb-item"><a href="javascript:void(0);">Attendance</a></li>


    </ol>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('button'); ?>

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

<?php $__env->startSection('content'); ?>
<?php echo $__env->make('includes.flash', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-body">

                <div class="table-rep-plugin">
                    <div class="table-responsive mb-0" data-pattern="priority-columns">
                        <table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">

                         `<thead>
    <tr>
        <th scope="col">Device name</th> <!-- Corrected closing tag for th -->
        <th scope="col">ID Number</th>
        <th scope="col">Serial Number</th>
        <th scope="col">State</th>
        <th scope="col">Timestamp</th>
        <th scope="col">Type</th>
        <th scope="col">Value</th>
    </tr>
</thead>
<tbody>
    <?php
     $sl = 1; 

    $attendanceFaceTypeMap = [
                                '15' => ['class' => 'badge-success', 'label' => 'Face'],
                                '4' => ['class' => 'badge-danger', 'label' => 'Card'],
                                '1' => ['class' => 'badge-primary', 'label' => 'Fingerprint'],
                            
                                ];


                                $attendanceTypeMap = [
                                '0' => ['class' => 'badge-success', 'label' => 'Check-in'],
                                '1' => ['class' => 'badge-danger', 'label' => 'Check-out'],
                                '2' => ['class' => 'badge-primary', 'label' => 'Break-out'],
                                '3' => ['class' => 'badge-dark', 'label' => 'Break-in'],
                                '7' => ['class' => 'badge-secondary', 'label' => 'Door-pm'],
                                '6' => ['class' => 'badge-warning', 'label' => 'Door-am'],
                                '4' => ['class' => 'badge-dark', 'label' => 'OverCheck-in'],
                                '5' => ['class' => 'badge-dark', 'label' => 'OverCheck-out'],
                                ];  

                        


                                ?>



    <?php $__currentLoopData = $attendanceData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php $__currentLoopData = $data['attendances']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attendance): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td><?php echo e($data['devicename']); ?></td> <!-- Add this line to include the device IP -->
                <td><?php echo e($attendance['id']); ?></td>
                <td><?php echo e($attendance['uid']); ?></td>

                <td>
                    <?php if(isset($attendanceFaceTypeMap[$attendance['state']])): ?>
                        <span class="badge badge-pill float-left <?php echo e($attendanceFaceTypeMap[$attendance['state']]['class']); ?>">
                            <?php echo e($attendanceFaceTypeMap[$attendance['state']]['label']); ?>

                        </span>
                    <?php else: ?>
                        <span class="badge badge-danger badge-pill float-left">Unknown</span>
                    <?php endif; ?>
                </td>

                <td><?php echo e($attendance['timestamp']); ?></td>

                <td>
                    <?php if(isset($attendanceTypeMap[$attendance['type']])): ?>
                        <span class="badge badge-pill float-left <?php echo e($attendanceTypeMap[$attendance['type']]['class']); ?>">
                            <?php echo e($attendanceTypeMap[$attendance['type']]['label']); ?>

                        </span>
                    <?php else: ?>
                        <span class="badge badge-danger badge-pill float-left">Unknown</span>
                    <?php endif; ?>
                </td>

                <td><?php echo e($attendance['type']); ?></td>
            </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
`


                        </table>

                
</body>
</html>



                        
                    </div>
                </div>

            </div>
        </div>
    </div> <!-- end col -->
</div> <!-- end row -->

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


<?php $__env->startSection('script'); ?>
<!-- Responsive-table-->
<script src="<?php echo e(URL::asset('plugins/RWD-Table-Patterns/dist/js/rwd-table.min.js')); ?>"></script>

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

<?php $__env->startSection('script'); ?>
<script>
    $(function() {
        $('.table-responsive').responsiveTable({
            addDisplayAllBtn: 'btn btn-secondary'
        });
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\crud-three\resources\views/admin/attendances.blade.php ENDPATH**/ ?>