

<?php $__env->startSection('title', 'إدارة المحافظات'); ?>
<?php $__env->startSection('page-title', 'إدارة المحافظات'); ?>
<?php $__env->startSection('page-icon', 'fas fa-map-marked-alt'); ?>

<?php $__env->startSection('content'); ?>
<div class="row g-3 mb-4">
    <div class="col-12">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <div>
                    <i class="fas fa-map-marked-alt"></i>
                    قائمة المحافظات
                </div>
                <a href="<?php echo e(route('admin.governorates.create')); ?>" class="btn btn-primary btn-sm">
                    <i class="fas fa-plus"></i> إضافة محافظة جديدة
                </a>
            </div>
            <div class="card-body p-0">
                <?php if($governorates->count() > 0): ?>
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>الاسم بالعربية</th>
                                    <th>الاسم بالإنجليزية</th>
                                    <th>الرمز</th>
                                    <th>عدد المدن</th>
                                    <th>الإحداثيات</th>
                                    <th>الترتيب</th>
                                    <th>الحالة</th>
                                    <th>الإجراءات</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $governorates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $governorate): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($governorate->id); ?></td>
                                        <td><?php echo e($governorate->name_ar); ?></td>
                                        <td><?php echo e($governorate->name_en); ?></td>
                                        <td>
                                            <span class="badge badge-info"><?php echo e($governorate->code); ?></span>
                                        </td>
                                        <td>
                                            <span class="badge badge-secondary"><?php echo e($governorate->cities_count); ?></span>
                                        </td>
                                        <td>
                                            <?php if($governorate->latitude && $governorate->longitude): ?>
                                                <small style="color: var(--text-muted);">
                                                    <?php echo e($governorate->latitude); ?>, <?php echo e($governorate->longitude); ?>

                                                </small>
                                            <?php else: ?>
                                                <span style="color: var(--text-muted);">غير محدد</span>
                                            <?php endif; ?>
                                        </td>
                                        <td><?php echo e($governorate->sort_order); ?></td>
                                        <td>
                                            <?php if($governorate->is_active): ?>
                                                <span class="badge badge-success">نشط</span>
                                            <?php else: ?>
                                                <span class="badge badge-danger">غير نشط</span>
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <div class="btn-group" role="group">
                                                <a href="<?php echo e(route('admin.governorates.show', $governorate)); ?>"
                                                   class="btn btn-info btn-sm" title="عرض">
                                                    <i class="fas fa-eye"></i>
                                                </a>
                                                <a href="<?php echo e(route('admin.governorates.edit', $governorate)); ?>"
                                                   class="btn btn-warning btn-sm" title="تعديل">
                                                    <i class="fas fa-edit"></i>
                                                </a>
                                                <form action="<?php echo e(route('admin.governorates.toggle-status', $governorate)); ?>"
                                                      method="POST" class="d-inline">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('PATCH'); ?>
                                                    <button type="submit" class="btn btn-<?php echo e($governorate->is_active ? 'secondary' : 'success'); ?> btn-sm"
                                                            title="<?php echo e($governorate->is_active ? 'إلغاء التفعيل' : 'تفعيل'); ?>">
                                                        <i class="fas fa-<?php echo e($governorate->is_active ? 'pause' : 'play'); ?>"></i>
                                                    </button>
                                                </form>
                                                <form action="<?php echo e(route('admin.governorates.destroy', $governorate)); ?>"
                                                      method="POST" class="d-inline"
                                                      onsubmit="return confirm('هل أنت متأكد من حذف هذه المحافظة؟')">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn btn-danger btn-sm" title="حذف">
                                                        <i class="fas fa-trash"></i>
                                                    </button>
                                                </form>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="p-3 border-top" style="border-color: rgba(255,255,255,0.04) !important;">
                        <?php echo e($governorates->links()); ?>

                    </div>
                <?php else: ?>
                    <div class="empty-state">
                        <i class="fas fa-map-marked-alt d-block"></i>
                        لا توجد محافظات
                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wamp64\www\taxi_app\resources\views/admin/governorates/index.blade.php ENDPATH**/ ?>