<div>
    <?php
    $user = Auth::user();
    $departments = \App\Models\Faculty::pluck('department')->unique()->toArray();
    ?>
    <div class="pd-20 card-box mb-30">
        <div class="row mb-20">
            <div class="col-md-4">
                <label for="search"><b class="text-secondary">Search</b>:</label>
                <input wire:model.live="search" type="text" id="search" class="form-control" placeholder="Search faculty...">
            </div>
            <div class="col-md-6">
                <label for="department"><b class="text-secondary">Department</b>:</label>
                <select wire:model.live="department" id="department" name="department" class="custom-select form-control"
                    <?php if($user->type === 'admin'): ?> disabled <?php endif; ?>
                    >
                    <?php if($user->type === 'superAdmin'): ?>
                    <option value="">-- Select Department --</option>
                    <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dept): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option
                        value="<?php echo e($dept); ?>">
                        <?php echo e($dept); ?>

                    </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                    <?php if($user->type === 'admin'): ?>
                    <option
                        value="<?php echo e($user->department); ?>">
                        <?php echo e($user->department); ?>

                    </option>
                    <?php endif; ?>
                </select>

                <?php if($user->type === 'admin'): ?>
                <!-- Hidden input to actually submit the value since the select is disabled -->
                <input type="hidden" name="department" value="<?php echo e($user->department); ?>">
                <?php endif; ?>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped table-auto table-sm">
                <thead class="bg-secondary text-white">
                    <tr>
                        <th scope="col">#ID</th>
                        <th scope="col">Image</th>
                        <th scope="col">Name</th>
                        <th scope="col">Position</th>
                        <th scope="col">Department</th>
                        <th scope="col">Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $faculties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $faculty): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td scope="row"><?php echo e($faculty->id); ?></td>
                        <td>
                            
                            <?php if($faculty->profile_picture): ?>
                            <img src="<?php echo e(asset('/images/faculty/' . $faculty->profile_picture)); ?>" width="100" alt="<?php echo e($faculty->faculty_name); ?>">
                            <?php else: ?>
                            <span>No Image</span>
                            <?php endif; ?>
                        </td>
                        <td><?php echo e($faculty->faculty_name); ?></td>
                        <td><?php echo e($faculty->faculty_position); ?></td>
                        <td><?php echo e($faculty->department); ?></td>
                        <td class="table-actions">
                            <a href="<?php echo e(route('admin.edit_faculty', ['id'=>$faculty->id])); ?>" data-color="#265ed7" style="color:rgb(38, 94, 215)">
                                <i class="icon-copy dw dw-edit2"></i>
                            </a>
                            <a href="javascript:;" wire:click="deleteFaculty(<?php echo e($faculty->id); ?>)" data-color="#e95959" style="color:rgb(233, 89, 89)">
                                <i class="icon-copy dw dw-delete-3"></i>
                            </a>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="6" class="text-center">No faculty found.</td>
                    </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    <div class="block mt-1">
        <?php echo e($faculties->links('livewire::simple-bootstrap')); ?>

    </div>
    </div>
</div><?php /**PATH C:\xampp\htdocs\larablog\resources\views\livewire\admin\faculties.blade.php ENDPATH**/ ?>