<?php $__env->startSection('content'); ?>
  <?php $success = false; ?>
    <?php if(\Session::has('error')): ?>
        <div class="alert alert-danger">
            <?php echo \Session::get('error'); ?>

        </div>
    <?php endif; ?>
    <?php if(\Session::has('success')): ?>
    <?php $success = true; ?> 
        <div class="alert alert-success">
            <?php echo \Session::get('success'); ?>

        </div>
    <?php endif; ?>

    <div class="page-content fade-in-up">
     <div class="row">
        <div class="col-md-6">
            <div class="ibox">
                <form class="form-purple" action="<?php echo e(route('admin_users_save')); ?>" method="post">
                    <input type="hidden" name="userId" value="<?php echo e(@$userData->id); ?>">
                    <div class="ibox-head">
                        <div class="ibox-title"><?php echo e(__('Add Users')); ?></div>
                    </div>
                    <div class="ibox-body">
                         <div class="form-group mb-4">
                            <label><?php echo e(__('Name')); ?></label>
                            <input class="form-control" name="name" data-validation="required" type="text" placeholder="Neuro Dignostics" value="<?php echo e(@$userData->name); ?>">
                        </div> 
                         <div class="form-group mb-4">
                            <label><?php echo e(__('Email')); ?></label>
                            <input class="form-control" name="email" data-validation="required email" type="email" placeholder="user@neurodignostics.com" value="<?php echo e(@$userData->email); ?>">
                        </div> 
                         <div class="form-group mb-4">
                            <label><?php echo e(__('Password')); ?></label>
                            <input class="form-control" name="password" data-validation="required" type="password" placeholder="Password" value="<?php echo e(@$userData->password); ?>">
                        </div> 
                        <div class="form-group mb-4">
                            <label>Select Role</label>
                            <select class="form-control form-control-air" name="roles[]" multiple="" data-validation="required">
                                <?php $__currentLoopData = $roleData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php echo e($selected = ''); ?>

                                    <?php if($id > 0): ?>
                                        <?php if(array_search($row->id, array_column($selectedRoles, 'id')) !== false): ?>
                                            <?php echo e($selected = 'selected'); ?>

                                        <?php endif; ?>
                                    <?php endif; ?>
                                    <option <?php echo e($selected); ?> value="<?php echo e($row->id); ?>"><?php echo e(ucfirst($row->name)); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    <div class="ibox-footer">
                        <button title="Submit" class="btn btn-primary mr-2" type="submit" name="btn-submit" value="submit"><?php echo e(__('Send Notifications')); ?></button>
                        <!-- <button class="btn btn-outline-secondary" type="reset">Cancel</button> -->
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- JS FORM VALIDATION -->

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<script>
  $.validate({
    lang: 'en'
  });
</script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>