<?php if (isset($component)) { $__componentOriginalb998c89882eab8e1df2af93927d4d429 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb998c89882eab8e1df2af93927d4d429 = $attributes; } ?>
<?php $component = App\View\Components\Dashboard\Layout::resolve(['title' => __('dashboard.services')] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Dashboard\Layout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="container-fluid">

        <!-- Page Header -->
        <div class="row">
            <div class="col-12">
                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                    <h4 class="mb-sm-0 font-size-18"><?php echo e(__('dashboard.services')); ?></h4>

                    <div class="page-title-right d-flex align-items-center">
                        <div class="btn btn-list">
                            <a href="<?php echo e(route('dashboard.services.create')); ?>" class="btn ripple btn-primary">
                                <i class="fas fa-plus-circle"></i> <?php echo e(__('dashboard.add')); ?>

                            </a>
                            <button id="btn_active" class="btn ripple btn-dark">
                                <i class="fas fa-eye"></i> <?php echo e(__('dashboard.publish/unpublish')); ?>

                            </button>
                            <button id="btn_delete" class="btn ripple btn-danger">
                                <i class="fas fa-trash"></i> <?php echo e(__('dashboard.delete')); ?>

                            </button>
                        </div>

                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard.home')); ?>">Dashboard</a></li>
                            <li class="breadcrumb-item active"><?php echo e(__('dashboard.services')); ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- End Page Header -->

        <!-- Table -->
        <div class="row">
            <div class="col-12">
                <div class="dashboard-table-container">
                    <div class="card-header">
                        <h4><?php echo e(__('dashboard.services')); ?></h4>
                    </div>
                    <div class="card-body">
                        <table id="datatable-buttons" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th class="text-center" style="width: 50px;">
                                        <input type="checkbox" id="checkAll" class="form-check-input">
                                    </th>
                                    <th><?php echo e(__('dashboard.id')); ?></th>
                                    <th><?php echo e(__('dashboard.name_en')); ?></th>
                                    <th><?php echo e(__('dashboard.name_ar')); ?></th>
                                    <th><?php echo e(__('dashboard.order')); ?></th>
                                    <th><?php echo e(__('dashboard.image')); ?></th>
                                    <th><?php echo e(__('dashboard.parent')); ?></th>
                                    <th><?php echo e(__('dashboard.status')); ?></th>
                                    <th><?php echo e(__('dashboard.actions')); ?></th>
                                </tr>
                            </thead>


                            <tbody>
                                <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr id="<?php echo e($service->id); ?>">
                                        <td class="text-center">
                                            <input type="checkbox" name="checkbox" class="check-inputs form-check-input"
                                                value="<?php echo e($service->id); ?>">
                                        </td>
                                        <td><a
                                                href="<?php echo e(route('dashboard.services.edit', $service->id)); ?>"><?php echo e($service->id); ?></a>
                                        </td>
                                        <td><a
                                                href="<?php echo e(route('dashboard.services.edit', $service->id)); ?>"><?php echo e($service->getTranslation('name', 'en')); ?></a>
                                        </td>
                                        <td><a
                                                href="<?php echo e(route('dashboard.services.edit', $service->id)); ?>"><?php echo e($service->getTranslation('name', 'ar')); ?></a>
                                        </td>

                                        <td><a
                                                href="<?php echo e(route('dashboard.services.edit', $service->id)); ?>"><?php echo e($service->order); ?></a>
                                        </td>
                                        <td>
                                            <a href="<?php echo e(route('dashboard.services.edit', $service->id)); ?>">
                                                <img src="<?php echo e($service->image_path); ?>" width="70">
                                            </a>
                                        </td>
                                        <td>
                                            <a href="<?php echo e(route('dashboard.services.edit', $service->id)); ?>">
                                                <?php echo e($service->parent ? $service->parent->getTranslation('name', 'ar') : __('dashboard.no_parent')); ?>

                                            </a>
                                        </td>
                                        <td>
                                            <?php if($service->status == 1): ?>
                                                <span class="status-badge active"><?php echo e(__('dashboard.yes')); ?></span>
                                            <?php else: ?>
                                                <span class="status-badge inactive"><?php echo e(__('dashboard.no')); ?></span>
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <div class="action-buttons">
                                                <form
                                                    action="<?php echo e(route('dashboard.services.toggle-status', $service->id)); ?>"
                                                    method="POST" class="d-inline">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('PATCH'); ?>
                                                    <button type="submit"
                                                        class="btn-action <?php echo e($service->status ? 'unpublish' : 'publish'); ?>"
                                                        title="<?php echo e($service->status ? __('dashboard.unpublish') : __('dashboard.publish')); ?>">
                                                        <i
                                                            class="fas fa-<?php echo e($service->status ? 'eye-slash' : 'eye'); ?>"></i>
                                                    </button>
                                                </form>
                                                <a href="<?php echo e(route('dashboard.services.edit', $service->id)); ?>"
                                                    class="btn-action edit" title="<?php echo e(__('dashboard.edit')); ?>">
                                                    <i class="fas fa-edit"></i>
                                                </a>
                                                <form action="<?php echo e(route('dashboard.services.destroy', $service->id)); ?>"
                                                    method="POST" class="d-inline">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn-action delete"
                                                        title="<?php echo e(__('dashboard.delete')); ?>"
                                                        onclick="return confirm('هل أنت متأكد من الحذف؟')">
                                                        <i class="fas fa-trash"></i>
                                                    </button>
                                                </form>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- end cardaa -->
            </div> <!-- end col -->
        </div>
        <!-- end row -->
    </div>


    <?php $__env->startPush('scripts'); ?>
        <script>
            $(document).ready(function() {
                // التحقق من أن الجدول لم يتم تهيئته مسبقاً
                if (!$.fn.DataTable.isDataTable('#datatable-buttons')) {
                    // تهيئة الجدول البسيط
                    $('#datatable-buttons').DataTable({
                        "responsive": true,
                        "autoWidth": false,
                        "pageLength": 25,
                        "language": {
                            "url": "//cdn.datatables.net/plug-ins/1.10.25/i18n/Arabic.json"
                        }
                    });
                }

                // checkboxes بسيط
                $('#checkAll').on('click', function() {
                    $('.check-inputs').prop('checked', this.checked);
                });

                $('.check-inputs').on('click', function() {
                    var totalCheckboxes = $('.check-inputs').length;
                    var checkedCheckboxes = $('.check-inputs:checked').length;
                    $('#checkAll').prop('checked', totalCheckboxes === checkedCheckboxes);
                });
            });
        </script>
    <?php $__env->stopPush(); ?>

    <?php $__env->startSection('script'); ?>
    <?php $__env->stopSection(); ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb998c89882eab8e1df2af93927d4d429)): ?>
<?php $attributes = $__attributesOriginalb998c89882eab8e1df2af93927d4d429; ?>
<?php unset($__attributesOriginalb998c89882eab8e1df2af93927d4d429); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb998c89882eab8e1df2af93927d4d429)): ?>
<?php $component = $__componentOriginalb998c89882eab8e1df2af93927d4d429; ?>
<?php unset($__componentOriginalb998c89882eab8e1df2af93927d4d429); ?>
<?php endif; ?>
<?php /**PATH /home/egypetoo/public_html/resources/views/Dashboard/Services/index.blade.php ENDPATH**/ ?>