
<?php $__env->startSection('title', 'رسائل الاهتمام'); ?>
<?php $__env->startSection('content'); ?>

    <?php if (isset($component)) { $__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa = $component; } ?>
<?php $component = App\View\Components\Dashboard\LinksBar::resolve(['links' => [
        [
            'name' => 'رسائل الاهتمام',
        ],
    ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('dashboard.links-bar'); ?>
<?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\Dashboard\LinksBar::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa)): ?>
<?php $component = $__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa; ?>
<?php unset($__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa); ?>
<?php endif; ?><!-- links bar -->

    <section id="">


        <div class="box table-responsive">
            <table class="table table-modern table-modern-sm table-inverse">
                <thead class="thead-inverse">
                    <tr>
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['interest_read', 'interest_delete'])): ?>
                            <th>التحكم</th>
                        <?php endif; ?>
                        <th>الاسم</th>
                        <th>البريد الإلكتروني</th>
                        <th>رقم الهاتف</th>
                        <th>تاريخ الإضافة</th>
                        <th>الحالة</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $rows; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="<?php echo e($row->is_read ? 'table-light' : 'table-warning'); ?> parents">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['interest_read', 'interest_delete'])): ?>
                                <td>

                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('interest_delete')): ?>
                                        <!-- زر الحذف -->
                                        <form class="ajax-delete d-inline-block" action="<?php echo e(route('interests.destroy')); ?>"
                                            method="POST">
                                            <?php echo method_field('DELETE'); ?>
                                            <?php echo csrf_field(); ?>
                                            <input type="hidden" class="id" name="id" value="<?php echo e($row->id); ?>">
                                            <button type="submit" class="btn-sm btn btn-soft-danger"
                                                data-delete="هل انت متأكد من حذف : <?php echo e($row->name); ?>">
                                                <i class="fa fa-trash-alt"></i>
                                            </button>
                                        </form>
                                    <?php endif; ?>

                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('interest_read')): ?>
                                        <?php if(!$row->is_read): ?>
                                            <form action="<?php echo e(route('interests.read', $row->id)); ?>" method="POST"
                                                class="d-inline-block">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="btn btn-sm btn-success">
                                                    <i class="fa fa-check"></i> تم القراءة
                                                </button>
                                            </form>
                                        <?php endif; ?>
                                    <?php endif; ?>

                                </td>
                            <?php endif; ?>

                            <td><?php echo e($row->name); ?></td>
                            <td><?php echo e($row->email ?? '-'); ?></td>
                            <td><?php echo e($row->phone ?? '-'); ?></td>
                            <td><?php echo e($row->created_at->format('Y-m-d H:i')); ?></td>
                            <td>
                                <?php echo $row->is_read
                                    ? "<span class='badge badge-success'>مقروء</span>"
                                    : "<span class='badge badge-warning'>غير مقروء</span>"; ?>

                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="6" class="text-center pt-4 text-muted">لا توجد بيانات بعد</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div><!-- end box table -->


    </section><!-- section -->

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

<?php echo $__env->make('dashboard.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\internal-real-estate\resources\views/dashboard/interest/index.blade.php ENDPATH**/ ?>