

<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <div><?php echo e(__('إضافة مستخدم')); ?></div>
                <a class="btn btn-sm btn-secondary" href="<?php echo e(route('users.index')); ?>"><?php echo e(__('رجوع')); ?></a>
            </div>

            <div class="card-body">
                <?php if($errors->any()): ?>
                    <div class="alert alert-danger">
                        <ul class="mb-0">
                            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li><?php echo e($error); ?></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                <?php endif; ?>

                <form method="POST" action="<?php echo e(route('users.store')); ?>">
                    <?php echo csrf_field(); ?>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('الاسم')); ?></label>
                        <input class="form-control" name="name" value="<?php echo e(old('name')); ?>" required>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('البريد الإلكتروني')); ?></label>
                        <input class="form-control" type="email" name="email" value="<?php echo e(old('email')); ?>" required>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('الوحدة التنظيمية')); ?></label>
                        <select class="form-select" name="organizational_unit_id">
                            <option value=""><?php echo e(__('بدون')); ?></option>
                            <?php $__currentLoopData = $organizationalUnits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $unit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($unit->id); ?>" <?php if(old('organizational_unit_id') == $unit->id): echo 'selected'; endif; ?>><?php echo e($unit->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('كلمة المرور')); ?></label>
                        <input class="form-control" type="password" name="password" required>
                    </div>

                    <div class="mb-3">
                        <label class="form-label"><?php echo e(__('تأكيد كلمة المرور')); ?></label>
                        <input class="form-control" type="password" name="password_confirmation" required>
                    </div>

                    <button class="btn btn-primary" type="submit"><?php echo e(__('حفظ')); ?></button>
                </form>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp82\htdocs\GeneralProject-form\resources\views/users/create.blade.php ENDPATH**/ ?>