
<?php $__env->startSection('container'); ?>
    <div class="row">
        <!-- left column -->
        <div class="col-md-12">
            <!-- jquery validation -->
            <?php if(session()->has('error')): ?>
                <div class="alert alert-danger text-center">
                    <?php echo e(session()->get('error')); ?>

                </div>
            <?php endif; ?>
            <?php if(session()->has('success')): ?>
                <div class="alert alert-success text-center">
                    <?php echo e(session()->get('success')); ?>

                </div>
            <?php endif; ?>
            <div class="card card-primary">
                <div class="card-header">
                    <h3 class="card-title">แก้ไขข้อมูล</h3>
                </div>
                <!-- /.card-header -->
                <!-- form start -->
                <form action="<?php echo e(route('user.update', $data->username)); ?>" method="post">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>
                    <div class="card-body">
                        <div class="form-group">
                            <label for="exampleInputEmail1">Username</label>
                            <input type="text" name="username" class="form-control" id="username" placeholder="Username"
                                value="<?php echo e($data->username); ?>">
                            <small class="text-danger"><?php echo e($errors->first('username')); ?></small>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputPassword1">Password</label>
                            <input type="password" name="password" id="password" class="form-control" id="password"
                                placeholder="Password">
                            <small class="text-danger"><?php echo e($errors->first('password')); ?></small>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">ชื่อ</label>
                            <input type="text" name="firstname" class="form-control" id="firstname" placeholder="Firstname"
                                value="<?php echo e($data->firstname); ?>">
                            <small class="text-danger"><?php echo e($errors->first('firstname')); ?></small>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">นามสกุล</label>
                            <input type="text" name="lastname" class="form-control" id="lastname" placeholder="Lastname"
                                value="<?php echo e($data->lastname); ?>">
                            <small class="text-danger"><?php echo e($errors->first('lastname')); ?></small>
                        </div>
                        <div class="form-group">
                            <label for="role">สิทธิ์การใช้งาน</label>
                            <select class="custom-select" name="role" id="role">
                                <option value="1" <?php echo e($data->role == 1 ? 'selected' : ''); ?>>ผู้ใช้งานทั่วไป</option>
                                <option value="2" <?php echo e($data->role == 2 ? 'selected' : ''); ?>>ผู้ดูแลระบบ</option>
                            </select>
                        </div>
                    </div>
                    <!-- /.card-body -->
                    <div class="card-footer">
                        <button type="submit" class="btn btn-success">บันทึก</button>
                    </div>
                </form>
            </div>
            <!-- /.card -->
        </div>
        <!--/.col (left) -->
        <!-- right column -->

        <!--/.col (right) -->
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Mos\Desktop\tik\resources\views/admin/form_edit/users/users.blade.php ENDPATH**/ ?>