<?php echo $__env->make('massages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div class="table-responsive recentOrderTable">
    <table class="table verticle-middle table-responsive-md" id="example4">
        <thead>
            <tr>
                <th scope="col">الرقم</th>
                <th scope="col">الاسم</th>
                <th scope="col">المسمى الوظيفي</th>
                <th scope="col">الحالة</th>
                <th scope="col">العنوان</th>
                <th scope="col">رقم الجوال</th>
                <th scope="col">العمليات</th>
            </tr>
        </thead>
        <tbody>
            <?php if(isset($employees)): ?>
                <?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $employee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td>
                            <?php if(isset($employee->id)): ?>
                                <?php echo e($employee->id); ?>

                            <?php endif; ?>
                        </td>
                        <td>
                            <?php if(isset($employee->name)): ?>
                                <?php echo e($employee->name); ?>

                            <?php endif; ?>
                        </td>
                        <td>
                            <?php if(isset($employee->role)): ?>
                                <?php if($employee->role == 1): ?>
                                    مدير
                                <?php elseif($employee->role == 2): ?>
                                    محاسب
                                <?php else: ?>
                                    عامل طرمبة
                                <?php endif; ?>
                            <?php endif; ?>
                        </td>
                        <td>
                            <?php if(isset($employee)): ?>
                            <?php if(isset($employee->system)): ?>
                                <?php if(isset($employee->profile)): ?>
                            <?php if($employee->system->is_active == -1): ?>
                            <span class="badge badge-rounded badge-danger">موقف</span>
                            <?php else: ?>
                            <span class="badge badge-rounded badge-primary">نشط</span>
                            <?php endif; ?>
                            <?php endif; ?>
                            <?php endif; ?>
                        <?php endif; ?>

                        </td>
                        <td>
                            <?php if(isset($employee->profile->address)): ?>
                                <?php echo e($employee->profile->address); ?>

                            <?php else: ?>
                                لايوجد
                            <?php endif; ?>
                        </td>
                        <td>
                            <?php if(isset($employee->profile->phone)): ?>
                                <?php echo e($employee->profile->phone); ?>

                            <?php else: ?>
                                لايوجد
                            <?php endif; ?>
                        </td>

                        <td>
                            <div class="dropdown custom-dropdown mb-0">
                                <div class="btn sharp btn-primary tp-btn" data-bs-toggle="dropdown">
                                    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
                                        width="18px" height="18px" viewBox="0 0 24 24" version="1.1">
                                        <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                                            <rect x="0" y="0" width="24" height="24" />
                                            <circle fill="#000000" cx="12" cy="5" r="2" />
                                            <circle fill="#000000" cx="12" cy="12" r="2" />
                                            <circle fill="#000000" cx="12" cy="19" r="2" />
                                        </g>
                                    </svg>
                                </div>
                                <div class="dropdown-menu">
                                    <button type="button"  value=""
                                        <?php $__currentLoopData = $registries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $registry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if(isset($employee->id)): ?>
                                                <?php if($employee->id == $registry->operation_id): ?>
                                                    data-id="<?php echo e($registry->operation_id); ?>"
                                                <?php endif; ?>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        class="registry update dropdown-item"
                                        href="update"><i class="bi bi-pencil-square text-success ms-3"></i>
                                        سجل العمليات
                                    </button>
                                    <?php if(isset($employee)): ?>
                                        <?php if(isset($employee->system)): ?>
                                            <?php if(isset($employee->profile)): ?>
                                                <button type="button" value=""
                                                data-bs-toggle="modal" 
                                                data-bs-target="#editEmployee"
                                                    data-id="<?php echo e($employee->id); ?>"
                                                    data-role="<?php echo e($employee->role); ?>" 
                                                    data-name="<?php echo e($employee->name); ?>"
                                                    data-phone="<?php echo e($employee->profile->phone); ?>"
                                                    data-address="<?php echo e($employee->profile->address); ?>"
                                                     class="edit dropdown-item"
                                                    href="edit transaction-details.html">
                                                    <i class="bi bi-pencil-square text-success ms-3"></i>تعديل</button>
                                                <?php if($employee->system->is_active == 1): ?>
                                                <button type="button" value="" data-id="<?php echo e($employee->id); ?>"
                                                    data-is_active="<?php echo e($employee->system->is_active); ?>" data-title="الموظف"
                                                    data-route='<?php echo e(route('toggleEmployee')); ?>' class="toggle dropdown-item"
                                                    href="toggle "><i class="fa fa-trash ms-3 text-danger"></i>إيقاف</button>
                                                   
                                                        <?php else: ?>
                                                  <button type="button" value="" data-id="<?php echo e($employee->id); ?>"
                                                            data-is_active="<?php echo e($employee->system->is_active); ?>" data-title="الموظف"
                                                            data-route='<?php echo e(route('toggleEmployee')); ?>' class="toggle dropdown-item"
                                                            href="toggle "><i class="fa fa-trash ms-3 text-success"></i>تفعيل</button>
                                                   
                                                        <?php endif; ?>
                                            <?php endif; ?>
                                        <?php endif; ?>
                                    <?php endif; ?>


                                </div>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>

        </tbody>
    </table>
</div>
<?php /**PATH C:\Users\Nasser\Desktop\petrol_store\resources\views/employees/tables/all.blade.php ENDPATH**/ ?>