<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\AppLayout::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <div class="flex justify-between items-center w-full">
            <h2 class="font-semibold text-xl text-gray-800 leading-tight">
                <?php echo e(__('BioTime Devices')); ?>

            </h2>
            <div class="flex space-x-2">
                <form action="<?php echo e(route('attendance.sync')); ?>" method="POST" class="inline m-0">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="inline-flex items-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-500 active:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition ease-in-out duration-150 shadow-sm">
                        <?php echo e(__('Sync BioTime API')); ?>

                    </button>
                </form>
                <a href="<?php echo e(route('biotime-devices.create')); ?>" class="inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition ease-in-out duration-150 shadow-sm ml-2">
                    <?php echo e(__('Add Device')); ?>

                </a>
            </div>
        </div>
     <?php $__env->endSlot(); ?>

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <?php if(session('success')): ?>
                <div class="mb-4 p-4 bg-green-100 border border-green-400 text-green-700 rounded">
                    <?php echo e(session('success')); ?>

                </div>
            <?php endif; ?>

            <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6 text-gray-900">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-widest">SN</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-widest">Alias</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-widest">IP Address</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-widest">Status</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-widest">Locked</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-widest">Last Activity</th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-widest">Actions</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <?php $__currentLoopData = $devices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $device): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap font-mono text-sm"><?php echo e($device->sn); ?></td>
                                    <td class="px-6 py-4 whitespace-nowrap"><?php echo e($device->alias ?? 'N/A'); ?></td>
                                    <td class="px-6 py-4 whitespace-nowrap"><?php echo e($device->ip_address ?? 'N/A'); ?></td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo e($device->display_status === 'online' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'); ?>">
                                            <?php echo e(ucfirst($device->display_status)); ?>

                                        </span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo e($device->is_active ? 'bg-gray-100 text-gray-800' : 'bg-orange-100 text-orange-800'); ?>">
                                            <?php echo e($device->is_active ? 'No' : 'Yes'); ?>

                                        </span>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-xs text-gray-500">
                                        <?php echo e($device->last_activity ? $device->last_activity->diffForHumans() : 'Never'); ?>

                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                                        <a href="<?php echo e(route('biotime-devices.edit', $device)); ?>" class="text-indigo-600 hover:text-indigo-900 mr-3">Edit</a>
                                        <?php if(Auth::user()->is_admin || Auth::user()->hasRole('systemadmin') || Auth::user()->hasRole('superadmin')): ?>
                                            <form action="<?php echo e(route('biotime-devices.toggle-lock', $device)); ?>" method="POST" class="inline mr-3">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="text-orange-600 hover:text-orange-900" onclick="return confirm('Are you sure?')">
                                                    <?php echo e($device->is_active ? 'Lock' : 'Unlock'); ?>

                                                </button>
                                            </form>
                                        <?php endif; ?>
                                        <?php if(Auth::user()->is_admin || Auth::user()->hasRole('systemadmin') || Auth::user()->hasRole('superadmin')): ?>
                                            <form action="<?php echo e(route('biotime-devices.sync-employees', $device)); ?>" method="POST" class="inline mr-3">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="text-emerald-600 hover:text-emerald-900" onclick="return confirm('Queue sync data to this device?')">
                                                    Sync Data
                                                </button>
                                            </form>
                                        <?php endif; ?>
                                        <?php if(Auth::user()->is_admin || Auth::user()->hasRole('systemadmin') || Auth::user()->hasRole('superadmin')): ?>
                                            <form action="<?php echo e(route('biotime-devices.read-info', $device)); ?>" method="POST" class="inline mr-3">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="text-slate-600 hover:text-slate-900" onclick="return confirm('Queue read device info?')">
                                                    Read Info
                                                </button>
                                            </form>
                                        <?php endif; ?>
                                        <?php if(Auth::user()->is_admin || Auth::user()->hasRole('systemadmin') || Auth::user()->hasRole('superadmin')): ?>
                                            <form action="<?php echo e(route('biotime-devices.remove-admin', $device)); ?>" method="POST" class="inline mr-3">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="text-rose-600 hover:text-rose-900" onclick="return confirm('Remove admin access from this device?')">
                                                    Remove Admin
                                                </button>
                                            </form>
                                        <?php endif; ?>
                                        <?php if(Auth::user()->is_admin || Auth::user()->hasRole('systemadmin') || Auth::user()->hasRole('superadmin')): ?>
                                            <form action="<?php echo e(route('biotime-devices.sync-users-from-device', $device)); ?>" method="POST" class="inline mr-3">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="text-cyan-600 hover:text-cyan-900" onclick="return confirm('Queue sync device data to software?')">
                                                    Sync Device Data
                                                </button>
                                            </form>
                                        <?php endif; ?>
                                        <form action="<?php echo e(route('biotime-devices.destroy', $device)); ?>" method="POST" class="inline">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('DELETE'); ?>
                                            <button type="submit" class="text-red-600 hover:text-red-900" onclick="return confirm('Are you sure?')">Delete</button>
                                        </form>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                    <div class="mt-4">
                        <?php echo e($devices->links()); ?>

                    </div>
                </div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\hr\resources\views/attendance/devices/index.blade.php ENDPATH**/ ?>