@extends('layout.app')
@section('content')
    <div class="card">
        <div class="card-body">
            <form method="POST" action="{{ route('updateRedUserGroup', $user->id) }}" enctype="multipart/form-data" name="editForm">
                @method('put')
                @csrf

                <div class="row">
                    {{-- <div class="col-md-6 form-group">
                        <label for="id">Id</label> --}}
                        <input class="form-control" name="id" id="id" type="hidden" value="{{$user->id}}">
                    {{-- </div> --}}

                    <div class="col-md-6 form-group">
                        <label for="user_name">User name</label>
                        <input class="form-control" name="user_name" id="user_name" required type="text" value="{{$user->username}}">
                    </div>

                    <div class="col-md-6 form-group">
                        <label for="attribute">Groupname</label>
                        <input class="form-control" name="groupname" id="groupname" type="text" required value="{{$user->groupname}}">
                    </div>

                    <div class="col-md-6 form-group">
                        <label for="op">Priority</label>
                        <input class="form-control" name="priority" id="priority" type="text" value="{{$user->priority}}" required>
                    </div>

                </div>
                <div class="form-group float-right">
                    <button class="btn btn-primary" type="submit" >Update</button>
                </div>
            </form>


        </div>
    </div>






@endsection
@section('ajax')
<script>
    $(function() {
        $('#search_btn').on('click', function() {
            var userid = $('#search_input').val();
            if(userid){

                $.ajax({
                    url: '{{ route('search-in-redcheck') }}',
                    type: "GET",
                    data: {
                        userid: userid
                    },
                    success: function(data) {
                        $('#result').html(data);
                    }
                });
            }
        });
    });
</script>
@endsection
