@extends('layout.app')
@section('content')
    <div class="card">
        <div class="card-body">
            <form method="POST" action="{{ route('updateRedcheck', $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">Attribute</label>
                        <input class="form-control" name="attribute" id="attribute" type="text" required value="{{$user->attribute}}">
                    </div>

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

                    <div class="col-md-6 form-group">
                        <label for="value">Value</label>
                        <input class="form-control" name="value" id="value" type="text" value="{{$user->value}}" 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
