<?php $__env->startSection('title', 'Edit Pengguna'); ?>

<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-header"><h3 class="card-title">Form Edit User</h3></div>
    <div class="card-body">
        <form action="<?php echo e(route('pengguna.update', $user->id)); ?>" method="POST">
            <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">Nama</label>
                <div class="col-sm-10"><input type="text" name="name" class="form-control" value="<?php echo e($user->name); ?>" required></div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">Email</label>
                <div class="col-sm-10"><input type="email" name="email" class="form-control" value="<?php echo e($user->email); ?>" required></div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">NIM (isi jika mahasiswa)</label>
                <div class="col-sm-10"><input type="text" name="nim" class="form-control" value="<?php echo e($user->nim); ?>"></div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">Password</label>
                <div class="col-sm-10"><input type="password" name="password" class="form-control" placeholder="Kosongkan jika tidak ingin mengubah password"></div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label">Role</label>
                <div class="col-sm-10">
                    <select name="role" class="form-control" required>
                        <option value="admin" <?php echo e($user->role == 'admin' ? 'selected' : ''); ?>>Admin Fakultas</option>
                        <option value="ketua_bagian" <?php echo e($user->role == 'ketua_bagian' ? 'selected' : ''); ?>>Ketua Bagian</option>
                        <option value="wadek1" <?php echo e($user->role == 'wadek1' ? 'selected' : ''); ?>>Wakil Dekan 1</option>
                        <option value="operator" <?php echo e($user->role == 'operator' ? 'selected' : ''); ?>>Operator</option>
                        <option value="mahasiswa" <?php echo e($user->role == 'mahasiswa' ? 'selected' : ''); ?>>Mahasiswa</option>
                    </select>
                </div>
            </div>
            <button type="submit" class="btn btn-primary">Update User</button>
            <a href="<?php echo e(route('pengguna.index')); ?>" class="btn btn-secondary">Batal</a>
        </form>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /opt/lampp/htdocs/skripsifh/resources/views/pengguna/edit.blade.php ENDPATH**/ ?>