<form action="<?php echo e(route('super-admin.users.update','id='.$user->id)); ?>" method="POST" role="form" id="form1"
      enctype="multipart/form-data">
    <?php echo csrf_field(); ?>

    <div class="row mt-3">
        <div class="col-md-12">
            <div class="form-group">
                <label class="form-label" for="employee_id"><?php echo e(__('messages.employee_name')); ?> <span
                        class="text-danger">*</span></label>
                <select class="form-select select2" name="employee_id" id="employee_id" required>
                    <?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dta): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($dta->id); ?>" <?php echo e(($user->employee_id === $dta->id) ? 'selected' : ''); ?>><?php echo e($dta->employee_name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="username"><?php echo e(__('messages.name')); ?><span
                        class="text-danger">*</span></label>
                <input type="text" class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="name" id="username"
                       placeholder="Enter name" value="<?php echo e(($user->name) ?? old('name')); ?>" readonly required/>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="useremail"><?php echo e(__('messages.email')); ?><span
                        class="text-danger">*</span></label>
                <input type="email" class="form-control <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="email"
                       id="useremail"
                       placeholder="Enter email" value="<?php echo e(($user->email) ?? old('email')); ?>" readonly required/>
            </div>
        </div>
    </div>

    <div class="row mt-3">
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="useraddress"><?php echo e(__('messages.address')); ?></label>
                <input type="text" class="form-control" name="address" placeholder="Enter address" id="useraddress"
                       value="<?php echo e(($user->address) ?? old('address')); ?>" readonly/>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="userphone"><?php echo e(__('messages.phone')); ?></label>
                <input type="text" class="form-control" name="phone" placeholder="ex: 017XXXXXXXX" id="userphone"
                       value="<?php echo e(($user->phone) ?? old('phone')); ?>" readonly/>
            </div>
        </div>
    </div>
    <div class="row mt-3">
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="usergender"><?php echo e(__('messages.gender')); ?> <span class="text-danger">*</span></label>
                <select class="form-control" name="gender" id="usergender">
                    <option value=""> Select Gender</option>
                    <option value="male" <?php echo e(($user->gender === 'male') ? 'selected' : ''); ?>>Male</option>
                    <option value="female" <?php echo e(($user->gender === 'female') ? 'selected' : ''); ?>>Female</option>
                    <option value="other" <?php echo e(($user->gender === 'other') ? 'selected' : ''); ?>>Other</option>
                </select>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="user_roles"><?php echo e(__('messages.assign_roles')); ?> <span
                        class="text-danger">*</span></label>
                <select class="form-control <?php $__errorArgs = ['assign_roles'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                        name="assign_roles" id="user_roles">
                    <option value="">Select Roles</option>
                    <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option
                            value="<?php echo e($item->id); ?>" <?php echo e($user->hasRole($item->name) ? 'selected' : ''); ?>><?php echo e($item->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>
    </div>
    <div class="row mt-3">
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label" for="organizationEdit"><?php echo e(__('messages.branch')); ?> <span
                        class="text-danger">*</span></label>
                <select class="form-select js-example-basic-multiple <?php $__errorArgs = ['organizations'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                        name="organizations[]" id="organizationEdit" multiple="multiple" required>
                    <?php $__currentLoopData = $organizations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $organization): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($organization->id); ?>"
                                <?php $__currentLoopData = $user->organizations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fa): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if($organization->id === $fa->id): ?> selected="selected"<?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>><?php echo e($organization->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>
    </div>
    <div class="row mt-3">
        <div class="col-md-6">
            <div class="form-group">
                <label class="form-label"><?php echo e(__('messages.profile_photo')); ?></label>
                <input type="file" class="form-control" name="profile_photo" accept="image/*">
            </div>
        </div>
    </div>
    <div class="row mt-3" style="height: 70px;">
        <div class="col-md-4">
            <div class="form-group">
                <label class="form-label"><?php echo e(__('messages.status')); ?></label><br>
                <label>
                    <input type="radio" class="form-check-input" name="status"
                           value="active" <?php echo e(($user->status === 'active') ? 'checked' : ''); ?>/> Active
                </label>
                <label>
                    <input type="radio" class="form-check-input ms-3" name="status"
                           value="inactive" <?php echo e(($user->status === 'inactive') ? 'checked' : ''); ?>/> Inactive
                </label>
            </div>
        </div>
    </div>
    <div class="mt-3 d-flex justify-content-end">
        <button type="button" class="btn  me-2" data-bs-dismiss="modal"
                style="background: #EAECF0;"><?php echo e(__('messages.close')); ?>

        </button>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user.edit')): ?>
            <button type="submit" class="btn btn-primary"><?php echo e(__('messages.update')); ?></button>
        <?php endif; ?>
    </div>
</form>
<script>
    $(document).ready(function ($) {
        $('.select2-multiple').select2({
            dropdownParent: $('#userCreateModal'),
            width: 'resolve',
        });
        $('.select2').select2({
            dropdownParent: $('#user_edit_modal'),
            width: 'resolve',
        });
    });
    $('#doctor_check_edit').change(function() {
        if($(this).is(':checked')) {
            console.log('Checkbox is checked');
            $('.doctorType_section_edit').removeClass('d-none');
        }
    });
    $('#other_check_edit').change(function() {
        if($(this).is(':checked')) {
            console.log('Checkbox is other');
            $('.doctorType_section_edit').addClass('d-none');
        }
    });
</script>

<?php /**PATH D:\laragon\www\hr_and_att\resources\views/backend/user/edit.blade.php ENDPATH**/ ?>