<?php $__env->startSection('css'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
  <div class="fade-in">
    <div class="row">
      <div class="col-sm-12">
        <div class="card">
          <div class="card-header"><h4>Create New User</h4></div>
            <div class="card-body">
            <?php if($errors->any()): ?>
                <div class="alert alert-danger">
                    <ul>
                        <?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; ?>
                <?php if(Session::has('message')): ?>
                    <div class="alert alert-success" role="alert"><?php echo e(Session::get('message')); ?></div>
                <?php endif; ?>
                <form method="POST" action="<?php echo e(route('users.store')); ?>">
                    <?php echo csrf_field(); ?>
                    <table class="table table-bordered datatable">
                        <tbody>
                            <tr>
                                <th>
                                   First Name
                                </th>
                                <td>
                                    <input class="form-control" name="fname" type="text" value="<?php echo e(old('fname')); ?>" required>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                  Last Name
                                </th>
                                <td>
                                    <input class="form-control" name="lname" type="text" value="<?php echo e(old('lname')); ?>" required>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                   Contact
                                </th>
                                <td>
                                    <input class="form-control" name="contact_number" type="number" value="<?php echo e(old('contact_number')); ?>" required>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                   Email
                                </th>
                                <td>
                                    <input class="form-control" name="email" type="email" value="<?php echo e(old('email')); ?>" required>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                   Role
                                </th>
                                <td>
                                    <select class="form-control" name="role">
                                        <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($role->name); ?>" <?php echo e(old('role') == $role->name? "selected":""); ?>><?php echo e($role->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                   Password
                                </th>
                                <td>
                                    <input class="form-control" name="password" type="text" value="<?php echo e(old('password')); ?>" required>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <button class="btn btn-primary" type="submit">Save</button>
                    <a class="btn btn-primary" href="<?php echo e(route('users.index')); ?>">Return</a>
                </form>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\pec_portal\resources\views/dashboard/admin/userCreate.blade.php ENDPATH**/ ?>