<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?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\AppLayout::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm max-w-4xl mx-auto">
        <form method="POST" action="<?php echo e(route('admin.users.update', $user)); ?>">
            <?php echo csrf_field(); ?>
            <?php echo method_field('PUT'); ?>
            <h2 class="text-lg font-semibold text-center mb-6"><?php echo e(__('تعديل المستخدم')); ?></h2>
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6 px-6">
                
                <div class="flex flex-col gap-1">
                    <label for="name" class="form-label"><?php echo e(__('الاسم')); ?></label>
                    <input id="name" name="name" type="text" required
                        class="bg-muted dark:bg-input/30 border border-input rounded-md p-2"
                        value="<?php echo e(old('name', $user->name)); ?>">
                </div>
                
                <div class="flex flex-col gap-1">
                    <label for="email" class="form-label"><?php echo e(__('البريد الإلكتروني')); ?></label>
                    <input id="email" name="email" type="email" required
                        class="bg-muted dark:bg-input/30 border border-input rounded-md p-2"
                        value="<?php echo e(old('email', $user->email)); ?>">
                </div>

                <div class="flex flex-col gap-1">
                    <label for="password" class="form-label"><?php echo e(__('كلمة المرور الجديدة (اتركها فارغة للإبقاء على الحالية)')); ?></label>
                    <input id="password" name="password" type="password"
                        class="bg-muted dark:bg-input/30 border border-input rounded-md p-2">
                </div>

                <div class="flex flex-col gap-1">
                    <label for="role" class="form-label"><?php echo e(__('الدور')); ?></label>
                    <select id="role" name="role" required
                        class="bg-muted dark:bg-input/30 border border-input rounded-md p-2">
                        <option value="user" <?php if(old('role', $user->role) == 'user'): echo 'selected'; endif; ?>><?php echo e(__('مستخدم')); ?></option>
                        <option value="admin" <?php if(old('role', $user->role) == 'admin'): echo 'selected'; endif; ?>><?php echo e(__('أدمن')); ?></option>
                    </select>
                </div>

                <div class="flex flex-col gap-1">
                    <label for="plan_id" class="form-label"><?php echo e(__('الباقة الحالية')); ?></label>
                    <select id="plan_id" name="plan_id" required
                        class="bg-muted dark:bg-input/30 border border-input rounded-md p-2">
                        <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($plan->id); ?>" <?php if(old('plan_id', $user->plan_id) == $plan->id): echo 'selected'; endif; ?>>
                                <?php echo e($plan->title); ?> - <?php echo e($plan->price); ?>$ / <?php echo e($plan->period_days); ?> <?php echo e($plan->period_type); ?>

                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>

                <div class="flex flex-col gap-1">
                    <label for="access_expires_at" class="form-label"><?php echo e(__('تاريخ انتهاء الوصول (اختياري)')); ?></label>
                    <input id="access_expires_at" name="access_expires_at" type="date"
                        class="bg-muted dark:bg-input/30 border border-input rounded-md p-2"
                        value="<?php echo e(old('access_expires_at', $user->access_expires_at ? $user->access_expires_at->format('Y-m-d') : '')); ?>">
                </div>

            </div>
            <div class="flex justify-center gap-4 px-6 pt-6">
                <button type="submit"
                    class="rounded-md bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 px-6 py-2">
                    <?php echo e(__('تحديث')); ?>

                </button>
                <a href="<?php echo e(route('admin.users.index')); ?>"
                    class="rounded-md bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/90 px-6 py-2">
                    <?php echo e(__('إلغاء')); ?>

                </a>
            </div>
        </form>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH /www/wwwroot/fast.rompure.com/fast.rompure.com/resources/views/admin/users/edit.blade.php ENDPATH**/ ?>